Macros | |
#define | CY_USBPD_GET_MAX(a, b) (((a) > (b)) ? (a) : (b)) |
Get the maximum from among two numbers. More... | |
#define | CY_USBPD_GET_MIN(a, b) (((a) > (b)) ? (b) : (a)) |
Get the minimum from among two numbers. More... | |
#define | CY_USBPD_DIV_ROUND_UP(x, y) (((x) + ((y) - 1)) / (y)) |
Integer division - round up to next integer. More... | |
#define | CY_USBPD_DIV_ROUND_NEAREST(x, y) (((x) + ((y) / 2u)) / (y)) |
Integer division - round to nearest integer. More... | |
#define | CY_USBPD_MAKE_WORD(hi, lo) (((uint16_t)(hi) << 8) | ((uint16_t)(lo))) |
Combine two bytes to create one 16-bit WORD. More... | |
#define | CY_USBPD_MAKE_DWORD(b3, b2, b1, b0) |
Combine four bytes to create one 32-bit DWORD. More... | |
#define | CY_USBPD_MAKE_DWORD_FROM_WORD(hi, lo) (((uint32_t)(hi) << 16) | ((uint32_t)(lo))) |
Combine two WORDs to create one DWORD. More... | |
#define | CY_USBPD_WORD_GET_MSB(w) ((uint8_t)((w) >> 8)) |
Retrieve the MSB from a WORD. More... | |
#define | CY_USBPD_WORD_GET_LSB(w) ((uint8_t)((w) & 0xFF)) |
Retrieve the LSB from a WORD. More... | |
#define | CY_USBPD_BYTE_GET_UPPER_NIBBLE(w) ((uint8_t)(((w) >> 4) & 0xF)) |
Retrieve the Upper nibble from a BYTE. More... | |
#define | CY_USBPD_BYTE_GET_LOWER_NIBBLE(w) ((uint8_t)((w) & 0xF)) |
Retrieve the Lower nibble from a BYTE. More... | |
#define | CY_USBPD_DWORD_GET_BYTE0(dw) ((uint8_t)((dw) & 0xFFUL)) |
Retrieve the LSB from a DWORD. More... | |
#define | CY_USBPD_DWORD_GET_BYTE1(dw) ((uint8_t)(((dw) >> 8) & 0xFFUL)) |
Retrieve the bits 15-8 from a DWORD. More... | |
#define | CY_USBPD_DWORD_GET_BYTE2(dw) ((uint8_t)(((dw) >> 16) & 0xFFUL)) |
Retrieve the bits 23-16 from a DWORD. More... | |
#define | CY_USBPD_DWORD_GET_BYTE3(dw) ((uint8_t)(((dw) >> 24) & 0xFFUL)) |
Retrieve the MSB from a DWORD. More... | |
#define | CCG_FLASH_ROW_SHIFT_NUM (6u) |
Flash row shift number. More... | |
#define | CY_USBPD_REV_BYTE_ORDER(b, i) |
Macro to combine 4 bytes in reverse order to make a 32-bit integer. More... | |
#define | CY_USBPD_REG_FIELD_UPDATE(reg, field, value) ((reg) = (((reg) & ~(field##_MASK)) | ((value) << (field##_POS)))) |
Update a single field in a register. More... | |
#define | CY_USBPD_REG_FIELD_UPDATE_MTB(reg, field, value) ((reg) = (((reg) & ~(field##_Msk)) | ((value) << (field##_Pos)))) |
Update a single field in a register. More... | |
#define | CY_USBPD_REG_FIELD_GET(reg, field) (((reg) & field##_MASK) >> field##_POS) |
Retrieve a specific field from a register. More... | |
#define | LSCSA_DEF_RSENSE_P0 (50u) |
Default RSENSE value is 5mOhm. More... | |
#define | LSCSA_DEF_RSENSE_P1 (50u) |
Default RSENSE value is 5mOhm. More... | |
#define | CY_PD_VSAFE_5V_FRS_SWAP_RX_MARGIN (10) |
VSafe5V margin for Fast Role Swap. More... | |
#define | TYPEC_PORT_0_IDX (0u) |
USB-C port number 0. More... | |
#define | TYPEC_PORT_1_IDX (1u) |
USB-C port number 1. More... | |
#define | NO_OF_TYPEC_PORTS (1u) |
CYPD8229_52LQXI part and CYPD8229_52LQXIT part has the same silicon ID. More... | |
#define | PMG1_PD_DUALPORT_ENABLE (0u) |
Single USB-C port supported. More... | |
#define | CY_PD_MAX_EXTD_PKT_WORDS (65u) |
Maximum extended message 32-bit words. More... | |
#define | CY_PD_VSAFE_0V (800u) |
Vbus voltage = 0.8 V. | |
#define | CY_PD_VSAFE_3_6V (3600u) |
Vbus voltage = 3.6 V. | |
#define | CY_PD_VSAFE_5V (5000u) |
Vbus voltage = 5.0 V. | |
#define | CY_PD_VSAFE_9V (9000u) |
Vbus voltage = 9.0 V. | |
#define | CY_PD_VSAFE_12V (12000u) |
Vbus voltage = 12.0 V. | |
#define | CY_PD_VSAFE_13V (13000u) |
Vbus voltage = 13.0 V. | |
#define | CY_PD_VSAFE_15V (15000u) |
Vbus voltage = 15.0 V. | |
#define | CY_PD_VSAFE_19V (19000u) |
Vbus voltage = 19.0 V. | |
#define | CY_PD_VSAFE_20V (20000u) |
Vbus voltage = 20.0 V. | |
#define | CY_PD_VSAFE_28V (28000u) |
Vbus voltage = 28.0 V. | |
#define | CY_PD_VSAFE_36V (36000u) |
Vbus voltage = 36.0 V. | |
#define | CY_PD_VSAFE_48V (48000u) |
Vbus voltage = 48.0 V. | |
#define | CY_PD_EPR_MIN_WATT (100u) |
PDP 100 W. | |
#define | CY_PD_EPR_MAX_28V_WATT (140u) |
PDP 140 W. | |
#define | CY_PD_EPR_MAX_36V_WATT (180u) |
PDP 180 W. | |
#define | CY_PD_EPR_MAX_48V_WATT (240u) |
PDP 240 W. | |
#define | ROUND_UP(x, y) ( ( ( (x) + ((y) - 1) ) / y ) * y) |
Round Up. | |
#define | ROUND_DOWN(x, y) ( ( (x) / y ) * y) |
Round Down. | |
#define | CY_PD_CC_CHANNEL_1 (0u) |
Reference to CC_1 pin in the Type-C connector. More... | |
#define | CY_PD_CC_CHANNEL_2 (1u) |
Reference to CC_2 pin in the Type-C connector. More... | |
#define | CY_PD_DR_PR_ROLE(dataRole, pwrRole) (((pwrRole) << 8) | ((dataRole) << 5)) |
Macro to update DR and PR role in PD header. More... | |
#define CY_USBPD_GET_MAX | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Get the maximum from among two numbers.
#define CY_USBPD_GET_MIN | ( | a, | |
b | |||
) | (((a) > (b)) ? (b) : (a)) |
Get the minimum from among two numbers.
#define CY_USBPD_DIV_ROUND_UP | ( | x, | |
y | |||
) | (((x) + ((y) - 1)) / (y)) |
Integer division - round up to next integer.
#define CY_USBPD_DIV_ROUND_NEAREST | ( | x, | |
y | |||
) | (((x) + ((y) / 2u)) / (y)) |
Integer division - round to nearest integer.
#define CY_USBPD_MAKE_WORD | ( | hi, | |
lo | |||
) | (((uint16_t)(hi) << 8) | ((uint16_t)(lo))) |
Combine two bytes to create one 16-bit WORD.
#define CY_USBPD_MAKE_DWORD | ( | b3, | |
b2, | |||
b1, | |||
b0 | |||
) |
Combine four bytes to create one 32-bit DWORD.
#define CY_USBPD_MAKE_DWORD_FROM_WORD | ( | hi, | |
lo | |||
) | (((uint32_t)(hi) << 16) | ((uint32_t)(lo))) |
Combine two WORDs to create one DWORD.
#define CY_USBPD_WORD_GET_MSB | ( | w | ) | ((uint8_t)((w) >> 8)) |
Retrieve the MSB from a WORD.
#define CY_USBPD_WORD_GET_LSB | ( | w | ) | ((uint8_t)((w) & 0xFF)) |
Retrieve the LSB from a WORD.
#define CY_USBPD_BYTE_GET_UPPER_NIBBLE | ( | w | ) | ((uint8_t)(((w) >> 4) & 0xF)) |
Retrieve the Upper nibble from a BYTE.
#define CY_USBPD_BYTE_GET_LOWER_NIBBLE | ( | w | ) | ((uint8_t)((w) & 0xF)) |
Retrieve the Lower nibble from a BYTE.
#define CY_USBPD_DWORD_GET_BYTE0 | ( | dw | ) | ((uint8_t)((dw) & 0xFFUL)) |
Retrieve the LSB from a DWORD.
#define CY_USBPD_DWORD_GET_BYTE1 | ( | dw | ) | ((uint8_t)(((dw) >> 8) & 0xFFUL)) |
Retrieve the bits 15-8 from a DWORD.
#define CY_USBPD_DWORD_GET_BYTE2 | ( | dw | ) | ((uint8_t)(((dw) >> 16) & 0xFFUL)) |
Retrieve the bits 23-16 from a DWORD.
#define CY_USBPD_DWORD_GET_BYTE3 | ( | dw | ) | ((uint8_t)(((dw) >> 24) & 0xFFUL)) |
Retrieve the MSB from a DWORD.
#define CCG_FLASH_ROW_SHIFT_NUM (6u) |
Flash row shift number.
#define CY_USBPD_REV_BYTE_ORDER | ( | b, | |
i | |||
) |
Macro to combine 4 bytes in reverse order to make a 32-bit integer.
b | Input array of bytes to be combined. |
i | Index into the input byte array. |
#define CY_USBPD_REG_FIELD_UPDATE | ( | reg, | |
field, | |||
value | |||
) | ((reg) = (((reg) & ~(field##_MASK)) | ((value) << (field##_POS)))) |
Update a single field in a register.
It first clears the field and then updates the data.
#define CY_USBPD_REG_FIELD_UPDATE_MTB | ( | reg, | |
field, | |||
value | |||
) | ((reg) = (((reg) & ~(field##_Msk)) | ((value) << (field##_Pos)))) |
Update a single field in a register.
It first clears the field and then updates the data.
#define CY_USBPD_REG_FIELD_GET | ( | reg, | |
field | |||
) | (((reg) & field##_MASK) >> field##_POS) |
Retrieve a specific field from a register.
#define LSCSA_DEF_RSENSE_P0 (50u) |
Default RSENSE value is 5mOhm.
#define LSCSA_DEF_RSENSE_P1 (50u) |
Default RSENSE value is 5mOhm.
#define CY_PD_VSAFE_5V_FRS_SWAP_RX_MARGIN (10) |
VSafe5V margin for Fast Role Swap.
#define TYPEC_PORT_0_IDX (0u) |
USB-C port number 0.
Supported on all PMG1/CCGx devices.
#define TYPEC_PORT_1_IDX (1u) |
USB-C port number 1.
Supported only on the Dual Port devices.
#define NO_OF_TYPEC_PORTS (1u) |
CYPD8229_52LQXI part and CYPD8229_52LQXIT part has the same silicon ID.
Single USB-C port supported.
#define PMG1_PD_DUALPORT_ENABLE (0u) |
Single USB-C port supported.
#define CY_PD_MAX_EXTD_PKT_WORDS (65u) |
Maximum extended message 32-bit words.
Each word is 32 bit.
#define CY_PD_CC_CHANNEL_1 (0u) |
Reference to CC_1 pin in the Type-C connector.
#define CY_PD_CC_CHANNEL_2 (1u) |
Reference to CC_2 pin in the Type-C connector.
#define CY_PD_DR_PR_ROLE | ( | dataRole, | |
pwrRole | |||
) | (((pwrRole) << 8) | ((dataRole) << 5)) |
Macro to update DR and PR role in PD header.