CAT2 Peripheral Driver Library

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...
 

Detailed Description

Function Documentation

◆ Cy_USBPD_Adc_Init()

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.

Parameters
contextThe 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.
adcIdADC ID. cy_en_usbpd_adc_id_t
Returns
CY_USBPD_STAT_SUCCESS if operation is successful, CY_USBPD_STAT_BAD_PARAM if the context pointer or adcID is invalid.

◆ Cy_USBPD_Adc_VoltToLevel()

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.

Parameters
contextThe 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.
adcIdADC ID. cy_en_usbpd_adc_id_t
voltVoltage in millivolt
Returns
uint8_t 8-bit ADC reading corresponding to Voltage.

◆ Cy_USBPD_Adc_LevelToVolt()

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.

Parameters
contextThe 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.
adcIdADC ID. cy_en_usbpd_adc_id_t
levelThe 8-bit ADC reading.
Returns
uint16_t Returns voltage in mV.

◆ Cy_USBPD_Adc_GetVbusVolt()

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.

Parameters
contextThe 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.
adcIdADC ID. cy_en_usbpd_adc_id_t
levelThe 8-bit ADC reading.
Returns
uint16_t Returns voltage in mV.

◆ Cy_USBPD_Adc_FreeRunCtrl()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
levelComparator level (8-bit ADC count)
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Adc_CompCtrl()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
levelComparator level (8-bit ADC count)
intCfgInterrupt configuration
cbCallback to be called on interrupt.

◆ Cy_USBPD_Adc_CompSample()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
levelValue(8-bit ADC count) to compare the input voltage against.
Returns
bool Returns true if voltage > level, false otherwise.

◆ Cy_USBPD_Adc_GetCompStatus()

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.

Parameters
contextThe 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.
adcIdADC ID.
Returns
bool Returns the comparator output.

◆ Cy_USBPD_Adc_Sample()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
Returns
uint8_t Returns the ADC sampled value in counts.

◆ Cy_USBPD_Adc_Calibrate()

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.

Parameters
contextThe 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.
adcIdADC ID.
Returns
uint16_t Returns the VDDD value in mV after calibration.

◆ Cy_USBPD_Adc_SelectVref()

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.

Parameters
contextThe 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.
adcIdADC ID.
vrefSelADC reference selection.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Adc_GetVbusLevel()

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.

Parameters
contextThe 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.
adcIdADC ID.
voltVoltage in 50mV units.
perPercentage margin on the voltage.
Returns
uint8_t Returns the ADC level.

◆ Cy_USBPD_Adc_MeasureInternalTemp()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
Returns
int16_t Internal temperature in degree celsius units.

◆ Cy_USBPD_Adc_MeasureVbusIn()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
Returns
uint16_t VBus voltage in mV units.

◆ Cy_USBPD_Adc_MeasureVbus()

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.

Parameters
contextThe 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.
adcIdADC ID.
inputADC input source.
Returns
uint16_t VBus voltage in mV units.

◆ Cy_USBPD_Vbus_SetDetachParams()

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.

Parameters
contextThe 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.
adcIdADC ID. cy_en_usbpd_adc_id_t
adcInpADC input source.

◆ Cy_USBPD_Adc_IntrHandler()

void Cy_USBPD_Adc_IntrHandler ( cy_stc_usbpd_context_t context)

ADC Comparator Interrupt Handler function.

Parameters
contextThe 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_USBPD_V5V_IsSupplyOn()

bool Cy_USBPD_V5V_IsSupplyOn ( cy_stc_usbpd_context_t context)

Checks whether the 5V supply to provide VConn power is present.

Parameters
contextThe 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.
Returns
bool Returns true if 5V supply is present, false otherwise for CCG3/6/6DF/PMG1S3. Returns true by default for all the other devices.

◆ Cy_USBPD_Vconn_Enable()

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.

Parameters
contextThe 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.
channelChannel index, where CC1 = 0, CC2 = 1.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Vconn_Disable()

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.

Parameters
contextThe 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.
channelChannel index, where CC1 = 0, CC2 = 1.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Vconn_GatePullUp_Enable()

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

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Vconn_IsPresent()

bool Cy_USBPD_Vconn_IsPresent ( cy_stc_usbpd_context_t context,
uint8_t  channel 
)

This function checks the status of the VConn.

Parameters
contextThe 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.
channelChannel index, where CC1 = 0, CC2 = 1.
Returns
bool Returns true if Vconn is turned on, false otherwise.

◆ Cy_USBPD_VbusDiv_To_AMuxDiscon()

bool Cy_USBPD_VbusDiv_To_AMuxDiscon ( cy_stc_usbpd_context_t context)

Disconnect the internal VBus divider from AMUX bus.

Parameters
contextThe 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.
Returns
bool Return true if disconnected, false if disconnection not allowed.

◆ Cy_USBPD_Vbus_FrsRxEnable()

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.

Parameters
contextThe 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.
Returns
bool Returns true if success, otherwise returns false.

◆ Cy_USBPD_Vbus_FrsRxDisable()

bool Cy_USBPD_Vbus_FrsRxDisable ( cy_stc_usbpd_context_t context)

Disables the fast role swap receive functionality.

Parameters
contextThe 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.
Returns
bool Returns true if success, otherwise returns false.

◆ Cy_USBPD_Vbus_FrsRx_IntrHandler()

void Cy_USBPD_Vbus_FrsRx_IntrHandler ( cy_stc_usbpd_context_t context)

Fast Role Swap Receive Interrupt Handler function.

Parameters
contextThe 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_USBPD_Vbus_FrsTxEnable()

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.

Parameters
contextThe 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.
Returns
bool Returns true if success, otherwise returns false.

◆ Cy_USBPD_Vbus_FrsTxDisable()

bool Cy_USBPD_Vbus_FrsTxDisable ( cy_stc_usbpd_context_t context)

Disables the fast role swap transmit functionality.

Parameters
contextThe 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.
Returns
bool Returns true if success, otherwise returns false.

◆ Cy_USBPD_Vbus_GdrvRstEdgeDet()

void Cy_USBPD_Vbus_GdrvRstEdgeDet ( cy_stc_usbpd_context_t context,
bool  pgdoType 
)

Resets the gate driver edge detector to clear any fault state.

Parameters
contextThe 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.
pgdoTypeFlag indicating the gate driver to be cleared, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Vbus_RemoveIntrnlFbDiv()

void Cy_USBPD_Vbus_RemoveIntrnlFbDiv ( cy_stc_usbpd_context_t context)

Removes internal feedback resistor divider.

Parameters
contextThe 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_USBPD_Vbus_GdrvIsSnkFetOn()

bool Cy_USBPD_Vbus_GdrvIsSnkFetOn ( cy_stc_usbpd_context_t context)

Check whether the Sink FET has been turned on.

Parameters
contextThe 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.
Returns
bool Returns true if the sink path is on to allow system to charge.

◆ Cy_USBPD_Adc_GetVbatVolt()

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.

Parameters
contextThe 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.
adcIdADC ID for voltage measurement.
levelPD_ADC_NUM levels
Returns
uint16_t Battery Voltage

◆ Cy_USBPD_MeasureVbat()

uint16_t Cy_USBPD_MeasureVbat ( cy_stc_usbpd_context_t context)

This function measures the battery voltage on Vin.

Parameters
contextThe 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.
Returns
uint16_t Returns the battery voltage on Vin.

◆ Cy_USBPD_PfetDynDsEnable()

void Cy_USBPD_PfetDynDsEnable ( cy_stc_usbpd_context_t context)

Dynamically change the VBUS FET drive strength.

Parameters
contextThe 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_USBPD_Vbus_GdrvPfetOn()

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.

Parameters
contextThe 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.
turnOnSeqTurn On sequence On PMG1S2, this bit selects which FET turns on first.
  • 0: FET 0 turns on first.
  • 1: FET 1 turns on first.

◆ Cy_USBPD_Vbus_GdrvPfetOff()

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.

Parameters
contextThe 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.
turnOffSeqTurn Off sequence On PMG1S2, this bit selects which FET turns on first.
  • 0: FET 0 turns on first.
  • 1: FET 1 turns on first.

◆ Cy_USBPD_Vbus_GdrvCfetOn()

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.

Parameters
contextThe 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.
turnOnSeqTurn On sequence On PMG1S2, this bit selects which FET turns on first.
  • 0: FET 0 turns on first.
  • 1: FET 1 turns on first.

◆ Cy_USBPD_Vbus_GdrvCfetOff()

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.

Parameters
contextThe 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.
turnOffSeqTurn Off sequence On PMG1S2, this bit selects which FET turns on first.
  • 0: FET 0 turns on first.
  • 1: FET 1 turns on first.

◆ Cy_USBPD_Vbus_NgdoOn()

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.

Parameters
contextThe 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.
pfetFlag indicating whether the NGDO is connected to Provider FET
  • 0: Connected to Consumer FET.
  • 1: Connected to Provider FET.

◆ Cy_USBPD_Vbus_NgdoSetDriveStrength()

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.

Parameters
contextThe 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.
valueThe drive strength value with bit step size (current) as 150nA. Max value allowed is 4200nA (0x1C).

◆ Cy_USBPD_Vbus_NgdoOff()

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.

Parameters
contextThe 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.
pfetFlag indicating whether the NGDO is connected to Provider FET
  • 0: Connected to Consumer FET.
  • 1: Connected to Provider FET.

◆ Cy_USBPD_Vbus_DischargeOn()

void Cy_USBPD_Vbus_DischargeOn ( cy_stc_usbpd_context_t context)

Turn on the internal VBus discharge path.

Parameters
contextThe 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_USBPD_Vbus_DischargeOff()

void Cy_USBPD_Vbus_DischargeOff ( cy_stc_usbpd_context_t context)

Turn off the internal VBus discharge path.

Parameters
contextThe 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_USBPD_VbusIn_DischargeOn()

void Cy_USBPD_VbusIn_DischargeOn ( cy_stc_usbpd_context_t context)

Turn on the internal VBUS_IN discharge path.

Parameters
contextThe 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_USBPD_VbusIn_DischargeOff()

void Cy_USBPD_VbusIn_DischargeOff ( cy_stc_usbpd_context_t context)

Turn off the internal VBUS_IN discharge path.

Parameters
contextThe 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_USBPD_Vbus_MeasureCur()

uint16_t Cy_USBPD_Vbus_MeasureCur ( cy_stc_usbpd_context_t context)

Sample the VBus current using ADC.

Parameters
contextThe 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.
Returns
uint16_t Returns sampled current

◆ Cy_USBPD_Vbus_NgdoG1Ctrl()

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.

Parameters
contextThe 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.
valueGate-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.

◆ Cy_USBPD_Vbus_NgdoEqCtrl()

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.

Parameters
contextThe 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.
valueGate-1 control value. False: Disable the equalizer. True: Enable the equalizer.

◆ Cy_USBPD_Vbus_HalCleanup()

void Cy_USBPD_Vbus_HalCleanup ( cy_stc_usbpd_context_t context)

This function cleans up the PD block after a disconnect.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Vbus_Mon_SetDivider()

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.

Parameters
contextThe 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.
dividerDivider Ratio between VBUS_MON voltage and VBus voltage.

◆ Cy_USBPD_Hal_Remove_Internal_Fb_Res_Div()

void Cy_USBPD_Hal_Remove_Internal_Fb_Res_Div ( cy_stc_usbpd_context_t context)

Removes internal feedback res divider.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_VbatGndScpLevelSet()

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.

Parameters
contextThe 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_levelCurrent level
Returns
None

◆ Cy_USBPD_Fault_VbatGndScpEn()

void Cy_USBPD_Fault_VbatGndScpEn ( cy_stc_usbpd_context_t context,
bool  pctrl,
uint8_t  mode 
)

Enables VBAT-GND SCP Fault.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
modeVBAT-GND SCP Fault Mode.
Returns
None

◆ Cy_USBPD_Fault_VbatGndScpDis()

void Cy_USBPD_Fault_VbatGndScpDis ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disables VBAT-GND SCP Fault.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
Returns
None

◆ Cy_USBPD_Fault_BrownOutDetEn()

void Cy_USBPD_Fault_BrownOutDetEn ( cy_stc_usbpd_context_t context)

Enables the detection of Brown Out Fault.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_BrownOutDetDis()

void Cy_USBPD_Fault_BrownOutDetDis ( cy_stc_usbpd_context_t context)

Disables the detection of Brown Out Fault.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_BrownOutStatus()

bool Cy_USBPD_Fault_BrownOutStatus ( cy_stc_usbpd_context_t context)

Returns the status of Brown Out Fault.

Parameters
contextThe 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.
Returns
bool Returns the status of Brown Out Fault.

◆ Cy_USBPD_Fault_VregInrushDetEn()

void Cy_USBPD_Fault_VregInrushDetEn ( cy_stc_usbpd_context_t context)

Enables the detection of Vreg Inrush Fault.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_VregInrushDetDis()

void Cy_USBPD_Fault_VregInrushDetDis ( cy_stc_usbpd_context_t context)

Disables the detection of Vreg Inrush Fault.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_VregInrushStatus()

bool Cy_USBPD_Fault_VregInrushStatus ( cy_stc_usbpd_context_t context)

Returns the status of Vreg Inrush Fault.

Parameters
contextThe 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.
Returns
bool Returns the status of Vreg Inrush Fault.

◆ Cy_USBPD_Fault_Vbat_OvpIntrHandler()

void Cy_USBPD_Fault_Vbat_OvpIntrHandler ( cy_stc_usbpd_context_t context)

VBAT OVP fault interrupt handler function.

Parameters
contextThe 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_USBPD_Fault_Vbat_UvpIntrHandler()

void Cy_USBPD_Fault_Vbat_UvpIntrHandler ( cy_stc_usbpd_context_t context)

VBAT UVP fault interrupt handler function.

Parameters
contextThe 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_USBPD_Fault_Vbat_OcpIntrHandler()

void Cy_USBPD_Fault_Vbat_OcpIntrHandler ( cy_stc_usbpd_context_t context)

VBAT OCP fault interrupt handler function.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_Vbus_OvpIntrHandler()

void Cy_USBPD_Fault_Vbus_OvpIntrHandler ( cy_stc_usbpd_context_t context)

VBUS OVP fault interrupt handler function.

Parameters
contextThe 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_USBPD_Fault_Vbus_UvpIntrHandler()

void Cy_USBPD_Fault_Vbus_UvpIntrHandler ( cy_stc_usbpd_context_t context)

VBUS UVP fault interrupt handler function.

Parameters
contextThe 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_USBPD_Fault_Vconn_OcpIntrHandler()

void Cy_USBPD_Fault_Vconn_OcpIntrHandler ( cy_stc_usbpd_context_t context)
  • VCONN OCP fault interrupt handler function.
Parameters
contextThe 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_USBPD_Fault_Vbus_RcpIntrHandler()

void Cy_USBPD_Fault_Vbus_RcpIntrHandler ( cy_stc_usbpd_context_t context)

VBUS RCP fault interrupt handler function.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_Vbus_ScpIntrHandler()

void Cy_USBPD_Fault_Vbus_ScpIntrHandler ( cy_stc_usbpd_context_t context)

VBUS SCP fault interrupt handler function.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_Vbus_OcpIntrHandler()

void Cy_USBPD_Fault_Vbus_OcpIntrHandler ( cy_stc_usbpd_context_t context)

VBUS OCP fault interrupt handler function.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_CcOvp_IntrHandler()

void Cy_USBPD_Fault_CcOvp_IntrHandler ( cy_stc_usbpd_context_t context)

CC OVP fault interrupt handler function.

Parameters
contextThe 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_USBPD_Fault_SbuOvp_IntrHandler()

void Cy_USBPD_Fault_SbuOvp_IntrHandler ( cy_stc_usbpd_context_t context)

SBU OVP fault interrupt handler function.

Parameters
contextThe 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_USBPD_Fault_Vbus_OcpEnable()

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.

Parameters
contextThe 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.
currentContract current in mA units.
cbCallback function to be called on fault detection.

◆ Cy_USBPD_Fault_Vbus_OcpDisable()

void Cy_USBPD_Fault_Vbus_OcpDisable ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disables the Over Current Protection (OCP)

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
Returns
None

◆ Cy_USBPD_Fault_Vbus_OvpEnable()

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.

Parameters
contextThe 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.
voltContract Voltage in mV units.
cbCallback function to be called on fault detection.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbus_OvpDisable()

void Cy_USBPD_Fault_Vbus_OvpDisable ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disable Over Voltage Protection (OVP) control.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbus_UvpEnable()

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.

Parameters
contextThe 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.
voltContract Voltage in mV units.
cbCallback function to be called on fault detection.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbus_UvpDisable()

void Cy_USBPD_Fault_Vbus_UvpDisable ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disable Under Voltage Protection (UVP) control.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbat_OvpEnable()

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.

Parameters
contextThe 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.
thresholdOVP Voltage threshold in mV units.
filterSelFilter value
cbCallback function to be called on fault detection.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbat_OvpDisable()

void Cy_USBPD_Fault_Vbat_OvpDisable ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disable Over Voltage Protection (OVP) control.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbat_UvpEnable()

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.

Parameters
contextThe 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.
thresholdUVP threshold Voltage in mV units.
filterSelFilter value
cbCallback function to be called on fault detection.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbat_UvpDisable()

void Cy_USBPD_Fault_Vbat_UvpDisable ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disable Under Voltage Protection (UVP) control.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.

◆ Cy_USBPD_Fault_Vbat_OcpEnable()

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.

Parameters
contextThe 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.
currentCharging current in mA units.
cbCallback function to be called on fault detection.

◆ Cy_USBPD_Fault_Vbat_OcpDisable()

void Cy_USBPD_Fault_Vbat_OcpDisable ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disables the Battery Over Current Protection (OCP)

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
Returns
None

◆ Cy_USBPD_Fault_Voutbb_RcpEnable()

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.

Parameters
contextThe 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.
cbCallback function to be called on fault detection.
Returns
None

◆ Cy_USBPD_Fault_Voutbb_RcpDisable()

void Cy_USBPD_Fault_Voutbb_RcpDisable ( cy_stc_usbpd_context_t context)

Disables the detection of Buck-boost Vout RCP Fault.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_Vconn_OcpEnable()

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.

Parameters
contextThe 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.
cbCallback function to be called on fault detection.

◆ Cy_USBPD_Fault_Vconn_OcpDisable()

void Cy_USBPD_Fault_Vconn_OcpDisable ( cy_stc_usbpd_context_t context)

Disable Over-Current detection on the VConn power source.

Parameters
contextThe 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_USBPD_Fault_Vconn_ScpEnable()

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.

Parameters
contextThe 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.
cbCallback function to be called on fault detection.

◆ Cy_USBPD_Fault_Vconn_ScpDisable()

void Cy_USBPD_Fault_Vconn_ScpDisable ( cy_stc_usbpd_context_t context)

Disable short circuit detection on the VConn power source.

Parameters
contextThe 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_USBPD_Fault_Vbus_ScpEnable()

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).

Parameters
contextThe 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.
currentContract current in mA units.
cbCallback function to be called on fault detection.
Returns
None

◆ Cy_USBPD_Fault_Vbus_ScpDisable()

void Cy_USBPD_Fault_Vbus_ScpDisable ( cy_stc_usbpd_context_t context)

Disable Short Circuit Protection (SCP) control.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_Vbus_RcpEnable()

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).

Parameters
contextThe 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.
voltContract Voltage in mV units.
cbCallback function to be called on fault detection.
Returns
None

◆ Cy_USBPD_Fault_Vbus_RcpDisable()

void Cy_USBPD_Fault_Vbus_RcpDisable ( cy_stc_usbpd_context_t context)

Disable Reverse Current Protection (RCP) control.

Parameters
contextThe 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.
Returns
None

◆ Cy_USBPD_Fault_FetAutoModeEnable()

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.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
filterIndexcy_en_usbpd_vbus_filter_id_t enumerated type for various faults

◆ Cy_USBPD_Fault_FetAutoModeDisable()

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.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
filterIndexcy_en_usbpd_vbus_filter_id_t enumerated type for various faults

◆ Cy_USBPD_Fault_CcSbuSetCB()

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.

Parameters
contextThe 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.
cbCallback function to be called on fault detection.
Returns
None

◆ Cy_USBPD_Fault_VinUvpEn()

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.

Parameters
contextThe 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.
thresholdVin UVP Threshold
cbCallback
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
modeVin UVP Mode
Returns
None

◆ Cy_USBPD_Fault_VinUvpDis()

void Cy_USBPD_Fault_VinUvpDis ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disables VIN UVP fault.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
Returns
None

◆ Cy_USBPD_Fault_VinOvpEn()

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.

Parameters
contextThe 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.
thresholdVin OVP Threshold
cbCallback
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
modeVin OVP Mode
Returns
None

◆ Cy_USBPD_Fault_VinOvpDis()

void Cy_USBPD_Fault_VinOvpDis ( cy_stc_usbpd_context_t context,
bool  pctrl 
)

Disables VIN OVP Fault.

Parameters
contextThe 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.
pctrlFlag indicating the type of gate driver to be controlled, true for P_CTRL and false for C_CTRL.
Returns
None

◆ Cy_USBPD_CcOvpControl()

void Cy_USBPD_CcOvpControl ( cy_stc_usbpd_context_t context,
bool  flag 
)

This function enables/disables the CC OVP.

Parameters
contextThe 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.
flagFlag to indicate to enable or disable the fault.
Returns
None.

◆ Cy_USBPD_Vbus_V5vChangeDetectHandler()

void Cy_USBPD_Vbus_V5vChangeDetectHandler ( cy_stc_usbpd_context_t context)

VCONN 5V supply change interrupt handler function.

Parameters
contextThe 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_USBPD_Vbus_Ctrl_FbGetIdacStep()

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.

Parameters
new_voltNew voltage to reach
cur_voltCurrent voltage
Returns
int16_t Returns required signed iDAC step change.

◆ Cy_USBPD_Vbus_GetTrimIdac()

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.

Parameters
contextThe 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_mvVoltage in millivolts
Returns
int16_t Returns the iDAC value.

◆ Cy_USBPD_Vbus_SystemClockDisable()

void Cy_USBPD_Vbus_SystemClockDisable ( cy_stc_usbpd_context_t context)

Disables the system clocks while entering into sleep.

Parameters
contextThe 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_USBPD_Vbus_SystemClockEnable()

void Cy_USBPD_Vbus_SystemClockEnable ( cy_stc_usbpd_context_t context)

Enables the system clocks with old stored value while wakeup.

Parameters
contextThe 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.