Functions | |
cy_en_usbpd_status_t | Cy_USBPD_Adc_Init (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId) |
Initializes the PD ADC block. More... | |
uint8_t | Cy_USBPD_Adc_VoltToLevel (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, uint16_t volt) |
Converts the voltage in millivolts to ADC units. More... | |
uint16_t | Cy_USBPD_Adc_LevelToVolt (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, uint8_t level) |
Converts the ADC units to voltage in millivolts. More... | |
uint16_t | Cy_USBPD_Adc_GetVbusVolt (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, uint8_t level) |
Converts the ADC level to VBUS voltage in millivolts. More... | |
cy_en_usbpd_status_t | Cy_USBPD_Adc_FreeRunCtrl (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input, uint8_t level) |
Configures the ADC for comparator functionality with the requested threshold with no interrupts enabled. More... | |
void | Cy_USBPD_Adc_CompCtrl (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input, uint8_t level, cy_en_usbpd_adc_int_t intCfg, cy_cb_adc_events_t cb) |
Configures the ADC for comparator functionality with the requested threshold, and registers a callback which shall be called when the comparator output changes. More... | |
bool | Cy_USBPD_Adc_CompSample (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input, uint8_t level) |
Temporarily configures the comparator as requested and checks whether the input exceeds the specified digital level. More... | |
bool | Cy_USBPD_Adc_GetCompStatus (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId) |
Gets the current comparator status. More... | |
uint8_t | Cy_USBPD_Adc_Sample (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input) |
Samples the ADC. More... | |
uint16_t | Cy_USBPD_Adc_Calibrate (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId) |
Calibrates the specified ADC for operation. More... | |
cy_en_usbpd_status_t | Cy_USBPD_Adc_SelectVref (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_vref_t vrefSel) |
Selects the reference voltage used by the ADC block on the PMG1 device. More... | |
uint8_t | Cy_USBPD_Adc_GetVbusLevel (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, uint16_t volt, int8_t per) |
Gets the ADC level that corresponds to the actual voltage on vbus. More... | |
int16_t | Cy_USBPD_Adc_MeasureInternalTemp (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input) |
Measure the temperature using ADC and internal BJT temperature sensor. More... | |
uint16_t | Cy_USBPD_Adc_MeasureVbusIn (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input) |
Measure the current voltage on the VBus-in. More... | |
uint16_t | Cy_USBPD_Adc_MeasureVbus (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t input) |
Measure the current voltage on the VBus-Supply. More... | |
void | Cy_USBPD_Vbus_SetDetachParams (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, cy_en_usbpd_adc_input_t adcInp) |
Select the comparator block and input setting used for VBus detach detection. More... | |
void | Cy_USBPD_Adc_IntrHandler (cy_stc_usbpd_context_t *context) |
ADC Comparator Interrupt Handler function. More... | |
bool | Cy_USBPD_V5V_IsSupplyOn (cy_stc_usbpd_context_t *context) |
Checks whether the 5V supply to provide VConn power is present. More... | |
cy_en_usbpd_status_t | Cy_USBPD_Vconn_Enable (cy_stc_usbpd_context_t *context, uint8_t channel) |
Turns on Vconn for the specified channel. More... | |
cy_en_usbpd_status_t | Cy_USBPD_Vconn_Disable (cy_stc_usbpd_context_t *context, uint8_t channel) |
Turns Off Vconn for the specified channel. More... | |
void | Cy_USBPD_Vconn_GatePullUp_Enable (cy_stc_usbpd_context_t *context) |
Enable the gate pull up to limit the inrush current. More... | |
bool | Cy_USBPD_Vconn_IsPresent (cy_stc_usbpd_context_t *context, uint8_t channel) |
This function checks the status of the VConn. More... | |
bool | Cy_USBPD_VbusDiv_To_AMuxDiscon (cy_stc_usbpd_context_t *context) |
Disconnect the internal VBus divider from AMUX bus. More... | |
bool | Cy_USBPD_Vbus_FrsRxEnable (cy_stc_usbpd_context_t *context) |
Enables the fast role swap receive functionality. More... | |
bool | Cy_USBPD_Vbus_FrsRxDisable (cy_stc_usbpd_context_t *context) |
Disables the fast role swap receive functionality. More... | |
void | Cy_USBPD_Vbus_FrsRx_IntrHandler (cy_stc_usbpd_context_t *context) |
Fast Role Swap Receive Interrupt Handler function. More... | |
bool | Cy_USBPD_Vbus_FrsTxEnable (cy_stc_usbpd_context_t *context) |
Enables the fast role swap transmit functionality. More... | |
bool | Cy_USBPD_Vbus_FrsTxDisable (cy_stc_usbpd_context_t *context) |
Disables the fast role swap transmit functionality. More... | |
void | Cy_USBPD_Vbus_GdrvRstEdgeDet (cy_stc_usbpd_context_t *context, bool pgdoType) |
Resets the gate driver edge detector to clear any fault state. More... | |
void | Cy_USBPD_Vbus_RemoveIntrnlFbDiv (cy_stc_usbpd_context_t *context) |
Removes internal feedback resistor divider. More... | |
bool | Cy_USBPD_Vbus_GdrvIsSnkFetOn (cy_stc_usbpd_context_t *context) |
Check whether the Sink FET has been turned on. More... | |
uint16_t | Cy_USBPD_Adc_GetVbatVolt (cy_stc_usbpd_context_t *context, cy_en_usbpd_adc_id_t adcId, uint8_t level) |
Returns the ADC Battery voltage. More... | |
uint16_t | Cy_USBPD_MeasureVbat (cy_stc_usbpd_context_t *context) |
This function measures the battery voltage on Vin. More... | |
void | Cy_USBPD_PfetDynDsEnable (cy_stc_usbpd_context_t *context) |
Dynamically change the VBUS FET drive strength. More... | |
void | Cy_USBPD_Vbus_GdrvPfetOn (cy_stc_usbpd_context_t *context, bool turnOnSeq) |
Turn on producer FET using the internal gate driver or dedicated GPIO. More... | |
void | Cy_USBPD_Vbus_GdrvPfetOff (cy_stc_usbpd_context_t *context, bool turnOffSeq) |
Turn OFF producer FET using the internal gate driver or dedicated GPIO. More... | |
void | Cy_USBPD_Vbus_GdrvCfetOn (cy_stc_usbpd_context_t *context, bool turnOnSeq) |
Turn on consumer FET using the internal gate driver or dedicated GPIO. More... | |
void | Cy_USBPD_Vbus_GdrvCfetOff (cy_stc_usbpd_context_t *context, bool turnOffSeq) |
Turn OFF consumer FET using the internal gate driver or dedicated GPIO. More... | |
void | Cy_USBPD_Vbus_NgdoOn (cy_stc_usbpd_context_t *context, bool pfet) |
Turns on the FET using the internal NGDO. More... | |
void | Cy_USBPD_Vbus_NgdoSetDriveStrength (cy_stc_usbpd_context_t *context, uint8_t value) |
Set the drive strength of the producer FET using the internal gate driver. More... | |
void | Cy_USBPD_Vbus_NgdoOff (cy_stc_usbpd_context_t *context, bool pfet) |
Turns off the FET using the internal NGDO. More... | |
void | Cy_USBPD_Vbus_DischargeOn (cy_stc_usbpd_context_t *context) |
Turn on the internal VBus discharge path. More... | |
void | Cy_USBPD_Vbus_DischargeOff (cy_stc_usbpd_context_t *context) |
Turn off the internal VBus discharge path. More... | |
void | Cy_USBPD_VbusIn_DischargeOn (cy_stc_usbpd_context_t *context) |
Turn on the internal VBUS_IN discharge path. More... | |
void | Cy_USBPD_VbusIn_DischargeOff (cy_stc_usbpd_context_t *context) |
Turn off the internal VBUS_IN discharge path. More... | |
uint16_t | Cy_USBPD_Vbus_MeasureCur (cy_stc_usbpd_context_t *context) |
Sample the VBus current using ADC. More... | |
void | Cy_USBPD_Vbus_NgdoG1Ctrl (cy_stc_usbpd_context_t *context, bool value) |
Control the Gate-1 on the VBUS-C side of the Gate driver circuit. More... | |
void | Cy_USBPD_Vbus_NgdoEqCtrl (cy_stc_usbpd_context_t *context, bool value) |
Enable/Disable the equalizer between the Gates and Source/Drain of the Gate driver circuit. More... | |
void | Cy_USBPD_Vbus_HalCleanup (cy_stc_usbpd_context_t *context) |
This function cleans up the PD block after a disconnect. More... | |
void | Cy_USBPD_Vbus_Mon_SetDivider (cy_stc_usbpd_context_t *context, uint8_t divider) |
Specify the voltage division ratio between the voltage applied on VBUS_MON and the actual VBus voltage. More... | |
void | Cy_USBPD_Hal_Remove_Internal_Fb_Res_Div (cy_stc_usbpd_context_t *context) |
Removes internal feedback res divider. More... | |
void | Cy_USBPD_Fault_VbatGndScpLevelSet (cy_stc_usbpd_context_t *context, cy_en_usbpd_vbat_gnd_scp_level_t cur_level) |
Sets threshold for VBAT-GND SCP. More... | |
void | Cy_USBPD_Fault_VbatGndScpEn (cy_stc_usbpd_context_t *context, bool pctrl, uint8_t mode) |
Enables VBAT-GND SCP Fault. More... | |
void | Cy_USBPD_Fault_VbatGndScpDis (cy_stc_usbpd_context_t *context, bool pctrl) |
Disables VBAT-GND SCP Fault. More... | |
void | Cy_USBPD_Fault_BrownOutDetEn (cy_stc_usbpd_context_t *context) |
Enables the detection of Brown Out Fault. More... | |
void | Cy_USBPD_Fault_BrownOutDetDis (cy_stc_usbpd_context_t *context) |
Disables the detection of Brown Out Fault. More... | |
bool | Cy_USBPD_Fault_BrownOutStatus (cy_stc_usbpd_context_t *context) |
Returns the status of Brown Out Fault. More... | |
void | Cy_USBPD_Fault_VregInrushDetEn (cy_stc_usbpd_context_t *context) |
Enables the detection of Vreg Inrush Fault. More... | |
void | Cy_USBPD_Fault_VregInrushDetDis (cy_stc_usbpd_context_t *context) |
Disables the detection of Vreg Inrush Fault. More... | |
bool | Cy_USBPD_Fault_VregInrushStatus (cy_stc_usbpd_context_t *context) |
Returns the status of Vreg Inrush Fault. More... | |
void | Cy_USBPD_Fault_Vbat_OvpIntrHandler (cy_stc_usbpd_context_t *context) |
VBAT OVP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbat_UvpIntrHandler (cy_stc_usbpd_context_t *context) |
VBAT UVP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbat_OcpIntrHandler (cy_stc_usbpd_context_t *context) |
VBAT OCP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbus_OvpIntrHandler (cy_stc_usbpd_context_t *context) |
VBUS OVP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbus_UvpIntrHandler (cy_stc_usbpd_context_t *context) |
VBUS UVP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vconn_OcpIntrHandler (cy_stc_usbpd_context_t *context) |
void | Cy_USBPD_Fault_Vbus_RcpIntrHandler (cy_stc_usbpd_context_t *context) |
VBUS RCP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbus_ScpIntrHandler (cy_stc_usbpd_context_t *context) |
VBUS SCP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbus_OcpIntrHandler (cy_stc_usbpd_context_t *context) |
VBUS OCP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_CcOvp_IntrHandler (cy_stc_usbpd_context_t *context) |
CC OVP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_SbuOvp_IntrHandler (cy_stc_usbpd_context_t *context) |
SBU OVP fault interrupt handler function. More... | |
void | Cy_USBPD_Fault_Vbus_OcpEnable (cy_stc_usbpd_context_t *context, uint32_t current, cy_cb_vbus_fault_t cb) |
Enable Over Current Protection (OCP) control using the internal Current Sense Amplifier. More... | |
void | Cy_USBPD_Fault_Vbus_OcpDisable (cy_stc_usbpd_context_t *context, bool pctrl) |
Disables the Over Current Protection (OCP) More... | |
void | Cy_USBPD_Fault_Vbus_OvpEnable (cy_stc_usbpd_context_t *context, uint16_t volt, cy_cb_vbus_fault_t cb, bool pctrl) |
Enable Over Voltage Protection (OVP) control using the internal UV-OV block. More... | |
void | Cy_USBPD_Fault_Vbus_OvpDisable (cy_stc_usbpd_context_t *context, bool pctrl) |
Disable Over Voltage Protection (OVP) control. More... | |
void | Cy_USBPD_Fault_Vbus_UvpEnable (cy_stc_usbpd_context_t *context, uint16_t volt, cy_cb_vbus_fault_t cb, bool pctrl) |
Enable Under Voltage Protection (UVP) control using the internal UV-OV block. More... | |
void | Cy_USBPD_Fault_Vbus_UvpDisable (cy_stc_usbpd_context_t *context, bool pctrl) |
Disable Under Voltage Protection (UVP) control. More... | |
void | Cy_USBPD_Fault_Vbat_OvpEnable (cy_stc_usbpd_context_t *context, uint16_t threshold, uint8_t filterSel, cy_cb_vbus_fault_t cb, bool pctrl) |
Enable Over Voltage Protection (OVP) control using the internal UV-OV block. More... | |
void | Cy_USBPD_Fault_Vbat_OvpDisable (cy_stc_usbpd_context_t *context, bool pctrl) |
Disable Over Voltage Protection (OVP) control. More... | |
void | Cy_USBPD_Fault_Vbat_UvpEnable (cy_stc_usbpd_context_t *context, uint16_t threshold, uint8_t filterSel, cy_cb_vbus_fault_t cb, bool pctrl) |
Enable Under Voltage Protection (UVP) control using the internal UV-OV block. More... | |
void | Cy_USBPD_Fault_Vbat_UvpDisable (cy_stc_usbpd_context_t *context, bool pctrl) |
Disable Under Voltage Protection (UVP) control. More... | |
void | Cy_USBPD_Fault_Vbat_OcpEnable (cy_stc_usbpd_context_t *context, uint32_t current, cy_cb_vbus_fault_t cb) |
Enable Battery Over Current Protection (OCP) control using the internal Current Sense Amplifier. More... | |
void | Cy_USBPD_Fault_Vbat_OcpDisable (cy_stc_usbpd_context_t *context, bool pctrl) |
Disables the Battery Over Current Protection (OCP) More... | |
void | Cy_USBPD_Fault_Voutbb_RcpEnable (cy_stc_usbpd_context_t *context, cy_cb_vbus_fault_t cb) |
Enables the detection of Buck-boost Vout RCP Fault. More... | |
void | Cy_USBPD_Fault_Voutbb_RcpDisable (cy_stc_usbpd_context_t *context) |
Disables the detection of Buck-boost Vout RCP Fault. More... | |
void | Cy_USBPD_Fault_Vconn_OcpEnable (cy_stc_usbpd_context_t *context, cy_cb_vbus_fault_t cb) |
Enable Over-Current detection on the VConn power source. More... | |
void | Cy_USBPD_Fault_Vconn_OcpDisable (cy_stc_usbpd_context_t *context) |
Disable Over-Current detection on the VConn power source. More... | |
void | Cy_USBPD_Fault_Vconn_ScpEnable (cy_stc_usbpd_context_t *context, cy_cb_vbus_fault_t cb) |
Enable short circuit detection on the VConn power source. More... | |
void | Cy_USBPD_Fault_Vconn_ScpDisable (cy_stc_usbpd_context_t *context) |
Disable short circuit detection on the VConn power source. More... | |
void | Cy_USBPD_Fault_Vbus_ScpEnable (cy_stc_usbpd_context_t *context, uint32_t current, cy_cb_vbus_fault_t cb) |
Enable Short Circuit Protection (SCP). More... | |
void | Cy_USBPD_Fault_Vbus_ScpDisable (cy_stc_usbpd_context_t *context) |
Disable Short Circuit Protection (SCP) control. More... | |
void | Cy_USBPD_Fault_Vbus_RcpEnable (cy_stc_usbpd_context_t *context, uint16_t volt, cy_cb_vbus_fault_t cb) |
Enable Reverse Current Protection (RCP). More... | |
void | Cy_USBPD_Fault_Vbus_RcpDisable (cy_stc_usbpd_context_t *context) |
Disable Reverse Current Protection (RCP) control. More... | |
void | Cy_USBPD_Fault_FetAutoModeEnable (cy_stc_usbpd_context_t *context, bool pctrl, cy_en_usbpd_vbus_filter_id_t filterIndex) |
Enable automatic hardware control on a gate driver due to a specified comparator and output filter. More... | |
void | Cy_USBPD_Fault_FetAutoModeDisable (cy_stc_usbpd_context_t *context, bool pctrl, cy_en_usbpd_vbus_filter_id_t filterIndex) |
Disable automatic hardware control on a gate driver due to a specified comparator and output filter. More... | |
void | Cy_USBPD_Fault_CcSbuSetCB (cy_stc_usbpd_context_t *context, cy_cb_vbus_fault_t cb) |
Register a callback function for CC/SBU OVP faults. More... | |
void | Cy_USBPD_Fault_VinUvpEn (cy_stc_usbpd_context_t *context, uint16_t threshold, cy_cb_adc_events_t cb, bool pctrl, cy_en_usbpd_vbus_uvp_mode_t mode) |
Enables VIN UVP Fault. More... | |
void | Cy_USBPD_Fault_VinUvpDis (cy_stc_usbpd_context_t *context, bool pctrl) |
Disables VIN UVP fault. More... | |
void | Cy_USBPD_Fault_VinOvpEn (cy_stc_usbpd_context_t *context, uint16_t threshold, cy_cb_adc_events_t cb, bool pctrl, cy_en_usbpd_vbus_ovp_mode_t mode) |
Enables VIN OVP Fault. More... | |
void | Cy_USBPD_Fault_VinOvpDis (cy_stc_usbpd_context_t *context, bool pctrl) |
Disables VIN OVP Fault. More... | |
void | Cy_USBPD_CcOvpControl (cy_stc_usbpd_context_t *context, bool flag) |
This function enables/disables the CC OVP. More... | |
void | Cy_USBPD_Vbus_V5vChangeDetectHandler (cy_stc_usbpd_context_t *context) |
VCONN 5V supply change interrupt handler function. More... | |
int16_t | Cy_USBPD_Vbus_Ctrl_FbGetIdacStep (uint16_t new_volt, uint16_t cur_volt) |
This function returns the signed iDAC step change required to reach the new voltage specified from the current voltage specified. More... | |
int16_t | Cy_USBPD_Vbus_GetTrimIdac (cy_stc_usbpd_context_t *context, uint16_t volt_mv) |
This function returns the iDAC value to be used for attaining the voltage. More... | |
void | Cy_USBPD_Vbus_SystemClockDisable (cy_stc_usbpd_context_t *context) |
Disables the system clocks while entering into sleep. More... | |
void | Cy_USBPD_Vbus_SystemClockEnable (cy_stc_usbpd_context_t *context) |
Enables the system clocks with old stored value while wakeup. More... | |
cy_en_usbpd_status_t Cy_USBPD_Adc_Init | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId | ||
) |
Initializes the PD ADC block.
This function enables the PD block and the registers required for ADC operation. It then calibrates the ADC to identify the VDDD voltage. It does not start any ADC operations.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. cy_en_usbpd_adc_id_t |
uint8_t Cy_USBPD_Adc_VoltToLevel | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
uint16_t | volt | ||
) |
Converts the voltage in millivolts to ADC units.
It takes a 16-bit voltage value in millivolts and returns the corresponding 8-bit ADC reading. This function does not perform any ADC operations.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. cy_en_usbpd_adc_id_t |
volt | Voltage in millivolt |
uint16_t Cy_USBPD_Adc_LevelToVolt | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
uint8_t | level | ||
) |
Converts the ADC units to voltage in millivolts.
It takes an 8-bit ADC reading and returns the corresponding 16-bit voltage value in millivolts. This function does not perform any ADC operations.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. cy_en_usbpd_adc_id_t |
level | The 8-bit ADC reading. |
uint16_t Cy_USBPD_Adc_GetVbusVolt | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
uint8_t | level | ||
) |
Converts the ADC level to VBUS voltage in millivolts.
It takes an 8-bit ADC reading and returns the corresponding 16-bit voltage value in millivolts. This function does not perform any ADC operations. Cy_USBPD_Adc_Sample should be called to convert a divided version of VBus to ADC levels before calling this function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. cy_en_usbpd_adc_id_t |
level | The 8-bit ADC reading. |
cy_en_usbpd_status_t Cy_USBPD_Adc_FreeRunCtrl | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input, | ||
uint8_t | level | ||
) |
Configures the ADC for comparator functionality with the requested threshold with no interrupts enabled.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
level | Comparator level (8-bit ADC count) |
void Cy_USBPD_Adc_CompCtrl | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input, | ||
uint8_t | level, | ||
cy_en_usbpd_adc_int_t | intCfg, | ||
cy_cb_adc_events_t | cb | ||
) |
Configures the ADC for comparator functionality with the requested threshold, and registers a callback which shall be called when the comparator output changes.
This function configures the ADC block as a comparator. The function takes the input to be configured and the ADC comparator threshold. It also takes a callback. If the callback is not NULL, then the threshold is configured and interrupts are enabled. If the callback is NULL, then the ADC / comparator is set to the low power state and interrupts are disabled.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
level | Comparator level (8-bit ADC count) |
intCfg | Interrupt configuration |
cb | Callback to be called on interrupt. |
bool Cy_USBPD_Adc_CompSample | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input, | ||
uint8_t | level | ||
) |
Temporarily configures the comparator as requested and checks whether the input exceeds the specified digital level.
This function restores the comparator to its previous state after operation. This is useful when the comparator is already configured to function with a certain input and level with interrupt and another reading needs to be done without having to re-configure the block after the sampling.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
level | Value(8-bit ADC count) to compare the input voltage against. |
bool Cy_USBPD_Adc_GetCompStatus | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId | ||
) |
Gets the current comparator status.
This function does not configure the ADC / comparator. It just returns the current state of the comparator. If true is returned, then the input voltage is greater than the reference and if false, the input voltage is lower than the reference.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
uint8_t Cy_USBPD_Adc_Sample | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input | ||
) |
Samples the ADC.
This function enables the ADC block to function as an ADC and returns the sample value in ADC units. This function disables any previously configured comparator interrupts / settings before sampling and restores them after the sampling is done. If any interrupt scenario happens across the sampling, the information is lost.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
uint16_t Cy_USBPD_Adc_Calibrate | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId | ||
) |
Calibrates the specified ADC for operation.
This function calibrates the specified ADC by identifying the VDDD voltage for reference. It should be noted that by calling the function, the previously calculated threshold levels may have to be changed based on the VDDD reading. The VDDD level is calculated based on the bandgap voltage which is expected to be constant.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
cy_en_usbpd_status_t Cy_USBPD_Adc_SelectVref | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_vref_t | vrefSel | ||
) |
Selects the reference voltage used by the ADC block on the PMG1 device.
A 2.0 V supply generated by the RefGen block in the PD IP is used as ADC reference by default. This API can be used to select the VDDD supply as the ADC reference. This is useful in cases where voltages greater than 2.0 V need to be measured.
Note: Since the VDDD supply level could vary across time, the ADC volts per division value needs to be calibrated before taking any ADC readings.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
vrefSel | ADC reference selection. |
uint8_t Cy_USBPD_Adc_GetVbusLevel | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
uint16_t | volt, | ||
int8_t | per | ||
) |
Gets the ADC level that corresponds to the actual voltage on vbus.
It also takes into account the VBus monitor divider.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
volt | Voltage in 50mV units. |
per | Percentage margin on the voltage. |
int16_t Cy_USBPD_Adc_MeasureInternalTemp | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input | ||
) |
Measure the temperature using ADC and internal BJT temperature sensor.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
uint16_t Cy_USBPD_Adc_MeasureVbusIn | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input | ||
) |
Measure the current voltage on the VBus-in.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
uint16_t Cy_USBPD_Adc_MeasureVbus | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | input | ||
) |
Measure the current voltage on the VBus-Supply.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. |
input | ADC input source. |
void Cy_USBPD_Vbus_SetDetachParams | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
cy_en_usbpd_adc_input_t | adcInp | ||
) |
Select the comparator block and input setting used for VBus detach detection.
PMG1 will use the selected settings to detect Type-C disconnection based on removal of the VBus power.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID. cy_en_usbpd_adc_id_t |
adcInp | ADC input source. |
void Cy_USBPD_Adc_IntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
ADC Comparator Interrupt Handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_V5V_IsSupplyOn | ( | cy_stc_usbpd_context_t * | context | ) |
Checks whether the 5V supply to provide VConn power is present.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_usbpd_status_t Cy_USBPD_Vconn_Enable | ( | cy_stc_usbpd_context_t * | context, |
uint8_t | channel | ||
) |
Turns on Vconn for the specified channel.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
channel | Channel index, where CC1 = 0, CC2 = 1. |
cy_en_usbpd_status_t Cy_USBPD_Vconn_Disable | ( | cy_stc_usbpd_context_t * | context, |
uint8_t | channel | ||
) |
Turns Off Vconn for the specified channel.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
channel | Channel index, where CC1 = 0, CC2 = 1. |
void Cy_USBPD_Vconn_GatePullUp_Enable | ( | cy_stc_usbpd_context_t * | context | ) |
Enable the gate pull up to limit the inrush current.
This function needs to be called after at least 500 us of Cy_USBPD_Vconn_Enable
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Vconn_IsPresent | ( | cy_stc_usbpd_context_t * | context, |
uint8_t | channel | ||
) |
This function checks the status of the VConn.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
channel | Channel index, where CC1 = 0, CC2 = 1. |
bool Cy_USBPD_VbusDiv_To_AMuxDiscon | ( | cy_stc_usbpd_context_t * | context | ) |
Disconnect the internal VBus divider from AMUX bus.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Vbus_FrsRxEnable | ( | cy_stc_usbpd_context_t * | context | ) |
Enables the fast role swap receive functionality.
Callback registered in Cy_USBPD_Phy_Init will be called when FRS signal is received.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Vbus_FrsRxDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disables the fast role swap receive functionality.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_FrsRx_IntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
Fast Role Swap Receive Interrupt Handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Vbus_FrsTxEnable | ( | cy_stc_usbpd_context_t * | context | ) |
Enables the fast role swap transmit functionality.
Callback registered in Cy_USBPD_Phy_Init will be called when FRS signal is received.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Vbus_FrsTxDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disables the fast role swap transmit functionality.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_GdrvRstEdgeDet | ( | cy_stc_usbpd_context_t * | context, |
bool | pgdoType | ||
) |
Resets the gate driver edge detector to clear any fault state.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pgdoType | Flag indicating the gate driver to be cleared, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Vbus_RemoveIntrnlFbDiv | ( | cy_stc_usbpd_context_t * | context | ) |
Removes internal feedback resistor divider.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Vbus_GdrvIsSnkFetOn | ( | cy_stc_usbpd_context_t * | context | ) |
Check whether the Sink FET has been turned on.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
uint16_t Cy_USBPD_Adc_GetVbatVolt | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_adc_id_t | adcId, | ||
uint8_t | level | ||
) |
Returns the ADC Battery voltage.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
adcId | ADC ID for voltage measurement. |
level | PD_ADC_NUM levels |
uint16_t Cy_USBPD_MeasureVbat | ( | cy_stc_usbpd_context_t * | context | ) |
This function measures the battery voltage on Vin.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_PfetDynDsEnable | ( | cy_stc_usbpd_context_t * | context | ) |
Dynamically change the VBUS FET drive strength.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_GdrvPfetOn | ( | cy_stc_usbpd_context_t * | context, |
bool | turnOnSeq | ||
) |
Turn on producer FET using the internal gate driver or dedicated GPIO.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
turnOnSeq | Turn On sequence On PMG1S2, this bit selects which FET turns on first.
|
void Cy_USBPD_Vbus_GdrvPfetOff | ( | cy_stc_usbpd_context_t * | context, |
bool | turnOffSeq | ||
) |
Turn OFF producer FET using the internal gate driver or dedicated GPIO.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
turnOffSeq | Turn Off sequence On PMG1S2, this bit selects which FET turns on first.
|
void Cy_USBPD_Vbus_GdrvCfetOn | ( | cy_stc_usbpd_context_t * | context, |
bool | turnOnSeq | ||
) |
Turn on consumer FET using the internal gate driver or dedicated GPIO.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
turnOnSeq | Turn On sequence On PMG1S2, this bit selects which FET turns on first.
|
void Cy_USBPD_Vbus_GdrvCfetOff | ( | cy_stc_usbpd_context_t * | context, |
bool | turnOffSeq | ||
) |
Turn OFF consumer FET using the internal gate driver or dedicated GPIO.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
turnOffSeq | Turn Off sequence On PMG1S2, this bit selects which FET turns on first.
|
void Cy_USBPD_Vbus_NgdoOn | ( | cy_stc_usbpd_context_t * | context, |
bool | pfet | ||
) |
Turns on the FET using the internal NGDO.
This API is only applicable to PMG1S3.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pfet | Flag indicating whether the NGDO is connected to Provider FET
|
void Cy_USBPD_Vbus_NgdoSetDriveStrength | ( | cy_stc_usbpd_context_t * | context, |
uint8_t | value | ||
) |
Set the drive strength of the producer FET using the internal gate driver.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
value | The drive strength value with bit step size (current) as 150nA. Max value allowed is 4200nA (0x1C). |
void Cy_USBPD_Vbus_NgdoOff | ( | cy_stc_usbpd_context_t * | context, |
bool | pfet | ||
) |
Turns off the FET using the internal NGDO.
This API is only applicable to PMG1S3.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pfet | Flag indicating whether the NGDO is connected to Provider FET
|
void Cy_USBPD_Vbus_DischargeOn | ( | cy_stc_usbpd_context_t * | context | ) |
Turn on the internal VBus discharge path.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_DischargeOff | ( | cy_stc_usbpd_context_t * | context | ) |
Turn off the internal VBus discharge path.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_VbusIn_DischargeOn | ( | cy_stc_usbpd_context_t * | context | ) |
Turn on the internal VBUS_IN discharge path.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_VbusIn_DischargeOff | ( | cy_stc_usbpd_context_t * | context | ) |
Turn off the internal VBUS_IN discharge path.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
uint16_t Cy_USBPD_Vbus_MeasureCur | ( | cy_stc_usbpd_context_t * | context | ) |
Sample the VBus current using ADC.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_NgdoG1Ctrl | ( | cy_stc_usbpd_context_t * | context, |
bool | value | ||
) |
Control the Gate-1 on the VBUS-C side of the Gate driver circuit.
This is only applicable to PMG1S3 device.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
value | Gate-1 control value. False: Gate-1 is pulled down to turn the FET off. True: Gate-1 is allowed to charge for turning on the FET. |
void Cy_USBPD_Vbus_NgdoEqCtrl | ( | cy_stc_usbpd_context_t * | context, |
bool | value | ||
) |
Enable/Disable the equalizer between the Gates and Source/Drain of the Gate driver circuit.
Use this API after turning off Gate-1 during Pfet turn Off sequence. This is only applicable to PMG1S3 device.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
value | Gate-1 control value. False: Disable the equalizer. True: Enable the equalizer. |
void Cy_USBPD_Vbus_HalCleanup | ( | cy_stc_usbpd_context_t * | context | ) |
This function cleans up the PD block after a disconnect.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_Mon_SetDivider | ( | cy_stc_usbpd_context_t * | context, |
uint8_t | divider | ||
) |
Specify the voltage division ratio between the voltage applied on VBUS_MON and the actual VBus voltage.
The commonly used resistor divider ratio used is 1:10, giving a voltage division ratio of 1/11.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
divider | Divider Ratio between VBUS_MON voltage and VBus voltage. |
void Cy_USBPD_Hal_Remove_Internal_Fb_Res_Div | ( | cy_stc_usbpd_context_t * | context | ) |
Removes internal feedback res divider.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_VbatGndScpLevelSet | ( | cy_stc_usbpd_context_t * | context, |
cy_en_usbpd_vbat_gnd_scp_level_t | cur_level | ||
) |
Sets threshold for VBAT-GND SCP.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
cur_level | Current level |
void Cy_USBPD_Fault_VbatGndScpEn | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl, | ||
uint8_t | mode | ||
) |
Enables VBAT-GND SCP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
mode | VBAT-GND SCP Fault Mode. |
void Cy_USBPD_Fault_VbatGndScpDis | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disables VBAT-GND SCP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_BrownOutDetEn | ( | cy_stc_usbpd_context_t * | context | ) |
Enables the detection of Brown Out Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_BrownOutDetDis | ( | cy_stc_usbpd_context_t * | context | ) |
Disables the detection of Brown Out Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Fault_BrownOutStatus | ( | cy_stc_usbpd_context_t * | context | ) |
Returns the status of Brown Out Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_VregInrushDetEn | ( | cy_stc_usbpd_context_t * | context | ) |
Enables the detection of Vreg Inrush Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_VregInrushDetDis | ( | cy_stc_usbpd_context_t * | context | ) |
Disables the detection of Vreg Inrush Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_USBPD_Fault_VregInrushStatus | ( | cy_stc_usbpd_context_t * | context | ) |
Returns the status of Vreg Inrush Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbat_OvpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBAT OVP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbat_UvpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBAT UVP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbat_OcpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBAT OCP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_OvpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBUS OVP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_UvpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBUS UVP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vconn_OcpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_RcpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBUS RCP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_ScpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBUS SCP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_OcpIntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VBUS OCP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_CcOvp_IntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
CC OVP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_SbuOvp_IntrHandler | ( | cy_stc_usbpd_context_t * | context | ) |
SBU OVP fault interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_OcpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint32_t | current, | ||
cy_cb_vbus_fault_t | cb | ||
) |
Enable Over Current Protection (OCP) control using the internal Current Sense Amplifier.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
current | Contract current in mA units. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Vbus_OcpDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disables the Over Current Protection (OCP)
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbus_OvpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | volt, | ||
cy_cb_vbus_fault_t | cb, | ||
bool | pctrl | ||
) |
Enable Over Voltage Protection (OVP) control using the internal UV-OV block.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
volt | Contract Voltage in mV units. |
cb | Callback function to be called on fault detection. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
DONOT APPLY THRESHOLD FOR WLC1 DEVICE SERIES
void Cy_USBPD_Fault_Vbus_OvpDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disable Over Voltage Protection (OVP) control.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbus_UvpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | volt, | ||
cy_cb_vbus_fault_t | cb, | ||
bool | pctrl | ||
) |
Enable Under Voltage Protection (UVP) control using the internal UV-OV block.
UVP is only expected to be used while PD-port is the power source.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
volt | Contract Voltage in mV units. |
cb | Callback function to be called on fault detection. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
defined(CY_DEVICE_CCG7S) && !defined(CY_DEVICE_SERIES_WLC1) && !defined(CY_DEVICE_CCG7D)
defined(CY_DEVICE_CCG7S) && !defined(CY_DEVICE_SERIES_WLC1) && !defined(CY_DEVICE_CCG7D)
void Cy_USBPD_Fault_Vbus_UvpDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disable Under Voltage Protection (UVP) control.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbat_OvpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | threshold, | ||
uint8_t | filterSel, | ||
cy_cb_vbus_fault_t | cb, | ||
bool | pctrl | ||
) |
Enable Over Voltage Protection (OVP) control using the internal UV-OV block.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
threshold | OVP Voltage threshold in mV units. |
filterSel | Filter value |
cb | Callback function to be called on fault detection. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbat_OvpDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disable Over Voltage Protection (OVP) control.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbat_UvpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | threshold, | ||
uint8_t | filterSel, | ||
cy_cb_vbus_fault_t | cb, | ||
bool | pctrl | ||
) |
Enable Under Voltage Protection (UVP) control using the internal UV-OV block.
UVP is only expected to be used while PD-port is the power source.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
threshold | UVP threshold Voltage in mV units. |
filterSel | Filter value |
cb | Callback function to be called on fault detection. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbat_UvpDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disable Under Voltage Protection (UVP) control.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Vbat_OcpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint32_t | current, | ||
cy_cb_vbus_fault_t | cb | ||
) |
Enable Battery Over Current Protection (OCP) control using the internal Current Sense Amplifier.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
current | Charging current in mA units. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Vbat_OcpDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disables the Battery Over Current Protection (OCP)
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_Voutbb_RcpEnable | ( | cy_stc_usbpd_context_t * | context, |
cy_cb_vbus_fault_t | cb | ||
) |
Enables the detection of Buck-boost Vout RCP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Voutbb_RcpDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disables the detection of Buck-boost Vout RCP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vconn_OcpEnable | ( | cy_stc_usbpd_context_t * | context, |
cy_cb_vbus_fault_t | cb | ||
) |
Enable Over-Current detection on the VConn power source.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Vconn_OcpDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disable Over-Current detection on the VConn power source.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vconn_ScpEnable | ( | cy_stc_usbpd_context_t * | context, |
cy_cb_vbus_fault_t | cb | ||
) |
Enable short circuit detection on the VConn power source.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Vconn_ScpDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disable short circuit detection on the VConn power source.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_ScpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint32_t | current, | ||
cy_cb_vbus_fault_t | cb | ||
) |
Enable Short Circuit Protection (SCP).
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
current | Contract current in mA units. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Vbus_ScpDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disable Short Circuit Protection (SCP) control.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_Vbus_RcpEnable | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | volt, | ||
cy_cb_vbus_fault_t | cb | ||
) |
Enable Reverse Current Protection (RCP).
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
volt | Contract Voltage in mV units. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_Vbus_RcpDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disable Reverse Current Protection (RCP) control.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Fault_FetAutoModeEnable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl, | ||
cy_en_usbpd_vbus_filter_id_t | filterIndex | ||
) |
Enable automatic hardware control on a gate driver due to a specified comparator and output filter.
Does not affect automatic control of the gate driver by other comparators of filters.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
filterIndex | cy_en_usbpd_vbus_filter_id_t enumerated type for various faults |
void Cy_USBPD_Fault_FetAutoModeDisable | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl, | ||
cy_en_usbpd_vbus_filter_id_t | filterIndex | ||
) |
Disable automatic hardware control on a gate driver due to a specified comparator and output filter.
Does not affect automatic control of the gate driver by other comparators of filters.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
filterIndex | cy_en_usbpd_vbus_filter_id_t enumerated type for various faults |
void Cy_USBPD_Fault_CcSbuSetCB | ( | cy_stc_usbpd_context_t * | context, |
cy_cb_vbus_fault_t | cb | ||
) |
Register a callback function for CC/SBU OVP faults.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
cb | Callback function to be called on fault detection. |
void Cy_USBPD_Fault_VinUvpEn | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | threshold, | ||
cy_cb_adc_events_t | cb, | ||
bool | pctrl, | ||
cy_en_usbpd_vbus_uvp_mode_t | mode | ||
) |
Enables VIN UVP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
threshold | Vin UVP Threshold |
cb | Callback |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
mode | Vin UVP Mode |
void Cy_USBPD_Fault_VinUvpDis | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disables VIN UVP fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_Fault_VinOvpEn | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | threshold, | ||
cy_cb_adc_events_t | cb, | ||
bool | pctrl, | ||
cy_en_usbpd_vbus_ovp_mode_t | mode | ||
) |
Enables VIN OVP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
threshold | Vin OVP Threshold |
cb | Callback |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
mode | Vin OVP Mode |
void Cy_USBPD_Fault_VinOvpDis | ( | cy_stc_usbpd_context_t * | context, |
bool | pctrl | ||
) |
Disables VIN OVP Fault.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
pctrl | Flag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL. |
void Cy_USBPD_CcOvpControl | ( | cy_stc_usbpd_context_t * | context, |
bool | flag | ||
) |
This function enables/disables the CC OVP.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
flag | Flag to indicate to enable or disable the fault. |
void Cy_USBPD_Vbus_V5vChangeDetectHandler | ( | cy_stc_usbpd_context_t * | context | ) |
VCONN 5V supply change interrupt handler function.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
int16_t Cy_USBPD_Vbus_Ctrl_FbGetIdacStep | ( | uint16_t | new_volt, |
uint16_t | cur_volt | ||
) |
This function returns the signed iDAC step change required to reach the new voltage specified from the current voltage specified.
It does not rely on the actual voltage global variables but the parameters to the function. The calculation is done without any voltage accuracy improvement algorithm and is used by the control algorithms to reach the required voltage.
new_volt | New voltage to reach |
cur_volt | Current voltage |
int16_t Cy_USBPD_Vbus_GetTrimIdac | ( | cy_stc_usbpd_context_t * | context, |
uint16_t | volt_mv | ||
) |
This function returns the iDAC value to be used for attaining the voltage.
It calculates the value based on the TRIM setting loaded in SFLASH and is applicable only for opto-isolator based designs.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
volt_mv | Voltage in millivolts |
void Cy_USBPD_Vbus_SystemClockDisable | ( | cy_stc_usbpd_context_t * | context | ) |
Disables the system clocks while entering into sleep.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_USBPD_Vbus_SystemClockEnable | ( | cy_stc_usbpd_context_t * | context | ) |
Enables the system clocks with old stored value while wakeup.
context | The pointer to the context structure cy_stc_usbpd_context_t allocated by the user. The structure is used during the USBPD operation for internal configuration and data retention. The user must not modify anything in this structure. |