CAT2 Peripheral Driver Library

The functions provide a set of APIs to handle battery charging operations. More...

Functions

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_Init (cy_stc_usbpd_context_t *context, cy_cb_bc_phy_events_t bcPhyCbk)
 This function initializes the charger detect block and registers a callback function with the charger detect PHY layer. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_En (cy_stc_usbpd_context_t *context)
 This function enables the charging block hardware. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_Dis (cy_stc_usbpd_context_t *context)
 This function disables the charging block hardware in the USB-PD IP. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_ConfigSrcTerm (cy_stc_usbpd_context_t *context, cy_en_usbpd_bch_src_term_t chargerTerm)
 This function applies the desired source terminations on D+/D- lines. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_ConfigSnkTerm (cy_stc_usbpd_context_t *context, cy_en_usbpd_bch_snk_term_t chargerTerm)
 This function applies the desired sink terminations on D+/D- lines. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_RemoveTerm (cy_stc_usbpd_context_t *context)
 This function removes all terminations/voltage sources from D+/D- lines. More...
 
bool Cy_USBPD_Bch_Phy_Config_Comp (cy_stc_usbpd_context_t *context, uint8_t compIdx, cy_en_usbpd_bch_comp_pinput_t pInput, cy_en_usbpd_bch_comp_ninput_t mInput, cy_en_usbpd_bch_vref_t vref, cy_en_usbpd_bch_comp_edge_t edge)
 This function configures and enables one of the charger detect comparators. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_DisableComp (cy_stc_usbpd_context_t *context, uint8_t compIdx)
 This function disables one of the charger detect comparators. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_Isolate_DpDm (cy_stc_usbpd_context_t *context)
 This function isolates the charge detect block from D+/D- lines. More...
 
bool Cy_USBPD_Bch_Phy_CompResult (cy_stc_usbpd_context_t *context, uint8_t compIdx)
 This function checks and returns the comparator output. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_ApplyDpPd (cy_stc_usbpd_context_t *context)
 This function applies pulldown on D+. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_RemoveDpPd (cy_stc_usbpd_context_t *context)
 This function removes pulldown on D+. More...
 
void Cy_USBPD_Bch_ApplyRdatLkgDp (cy_stc_usbpd_context_t *context)
 This function applies RDAT_LKG resistance on D+. More...
 
void Cy_USBPD_Bch_ApplyRdatLkgDm (cy_stc_usbpd_context_t *context)
 This function applies RDAT_LKG resistance on D-. More...
 
void Cy_USBPD_Bch_RemoveRdatLkgDp (cy_stc_usbpd_context_t *context)
 This function removes RDAT_LKG resistance on D+. More...
 
void Cy_USBPD_Bch_RemoveRdatLkgDm (cy_stc_usbpd_context_t *context)
 This function removes RDAT_LKG resistance on D-. More...
 
void Cy_USBPD_Bch_Apply_AppleTermDp (cy_stc_usbpd_context_t *context, cy_en_usbpd_bch_src_term_t appleTermId)
 This function applies Apple source terminations on D+. More...
 
void Cy_USBPD_Bch_Apply_AppleTermDm (cy_stc_usbpd_context_t *context, cy_en_usbpd_bch_src_term_t appleTermId)
 This function applies Apple source terminations on D-. More...
 
void Cy_USBPD_Bch_Apply_VdmSrc (cy_stc_usbpd_context_t *context)
 This function applies VDM_SRC on DM. More...
 
void Cy_USBPD_Bch_Remove_VdmSrc (cy_stc_usbpd_context_t *context)
 This function removes VDM_SRC on DM. More...
 
bool Cy_USBPD_Bch_Is_VdmSrc_On (cy_stc_usbpd_context_t *context)
 Function to check whether VDM_SRC supply is enabled. More...
 
void Cy_USBPD_Bch_Remove_AppleSrcDp (cy_stc_usbpd_context_t *context)
 This function removes Apple source terminations from D+. More...
 
void Cy_USBPD_Bch_Remove_AppleSrcDm (cy_stc_usbpd_context_t *context)
 This function removes Apple source terminations from D-. More...
 
void Cy_USBPD_Bch_Enable_AppleDet (cy_stc_usbpd_context_t *context)
 This function enables Apple Brick ID detection. More...
 
void Cy_USBPD_Bch_Disable_AppleDet (cy_stc_usbpd_context_t *context)
 This function disables Apple Brick ID detection. More...
 
bool Cy_USBPD_Bch_Phy_DpStat (cy_stc_usbpd_context_t *context)
 This function checks status of DP line. More...
 
bool Cy_USBPD_Bch_Phy_DmStat (cy_stc_usbpd_context_t *context)
 This function checks status of DM line. More...
 
void Cy_USBPD_Bch_Phy_Config_DeepSleep (cy_stc_usbpd_context_t *context)
 This function configures the charger detect block for deepsleep entry. More...
 
void Cy_USBPD_Bch_Phy_Config_Wakeup (cy_stc_usbpd_context_t *context)
 This function configures the charger detect block after deepsleep exit. More...
 
void Cy_USBPD_Bch_Intr1Handler (cy_stc_usbpd_context_t *context)
 This function handles the Battery Charging interrupts. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcInit (cy_stc_usbpd_context_t *context)
 This function initialize QC source block. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcStop (cy_stc_usbpd_context_t *context)
 This function deselect the QC source block. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcMasterSenseEn (cy_stc_usbpd_context_t *context)
 This function enable master for hardware to start sensing the pulses on Dplus and Dminus. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcMasterSenseDis (cy_stc_usbpd_context_t *context)
 This function disable master for hardware to stop sensing the pulses on Dplus and Dminus. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcContModeStart (cy_stc_usbpd_context_t *context)
 This function configures the QC3 block, enable QC interrupts and enables master for DP and DM sensing. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcContModeStop (cy_stc_usbpd_context_t *context)
 This function disables QC3 block and interrupts, and also disables the DP/DM master sensing. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSrcInit (cy_stc_usbpd_context_t *context)
 This function enables the AFC source clock, filters and other configurations. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSrcStart (cy_stc_usbpd_context_t *context)
 This function starts the AFC source state machine operations. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSrcStop (cy_stc_usbpd_context_t *context)
 This function stops the AFC source state machine operations. More...
 
void Cy_USBPD_Bch_Afc_Set_Tx_Data (cy_stc_usbpd_context_t *context, uint8_t *dataPtr, uint8_t count)
 This function transmits AFC (Adaptive Fast Charging) data buffer provided. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkInit (cy_stc_usbpd_context_t *context)
 This function initialize the AFC (Adaptive Fast Charging) clock, filters and enables block for sink operations. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkStartPing (cy_stc_usbpd_context_t *context)
 This function sends a ping request to AFC (Adaptive Fast Charging) source. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkStart (cy_stc_usbpd_context_t *context)
 This function configures the AFC (Adaptive Fast Charging) state machine, interrupts and stats the AFC sink operations. More...
 
cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkStop (cy_stc_usbpd_context_t *context)
 This function disables all AFC (Adaptive Fast Charging) interrupt. More...
 
uint8_t * Cy_USBPD_Bch_AfcGetRxDataPtr (cy_stc_usbpd_context_t *context)
 This function returns the AFC (Adaptive Fast Charging) received data pointer. More...
 
uint8_t Cy_USBPD_Bch_AfcGetRxDataCount (cy_stc_usbpd_context_t *context)
 This function returns the AFC(Adaptive Fast Charging) received data count. More...
 
void Cy_USBPD_Bch_AfcLoadTxData (cy_stc_usbpd_context_t *context)
 This function load the USBPD context AFC (Adaptive Fast Charging) tx data into AFC ping pong buffer. More...
 
void Cy_USBPD_Bch_QC3_IntrHandler (cy_stc_usbpd_context_t *context)
 This function handles the QC3 interrupts. More...
 
void Cy_USBPD_Bch_AfcPingPong_IntrHandler (cy_stc_usbpd_context_t *context)
 This function handles the AFC ping pong interrupts and copies data into context buffer. More...
 
void Cy_USBPD_Bch_AfcIdle_IntrHandler (cy_stc_usbpd_context_t *context)
 This function handles the AFC idle interrupt. More...
 
void Cy_USBPD_Bch_AfcReset_IntrHandler (cy_stc_usbpd_context_t *context)
 This function handles the AFC reset interrupt. More...
 
void Cy_USBPD_Bch_Intr0Handler (cy_stc_usbpd_context_t *context)
 This function handles the Battery Charging interrupts related to AFC and QC. More...
 
__STATIC_INLINE int Cy_USBPD_Bch_Get_QcPulseCount (cy_stc_usbpd_context_t *context)
 This function returns the QC3 pulse count stored in the context variable. More...
 
__STATIC_INLINE void Cy_USBPD_Bch_Update_QcPulseCount (cy_stc_usbpd_context_t *context, int new_count)
 This function update the QC3 pulse count in the context variable. More...
 
__STATIC_INLINE uint8_t * Cy_USBPD_Bch_Get_AfcDataPtr (cy_stc_usbpd_context_t *context)
 This function returns the USBPD context AFC received data pointer. More...
 
__STATIC_INLINE uint8_t Cy_USBPD_Bch_Get_AfcDataCount (cy_stc_usbpd_context_t *context)
 This function returns the USBPD context AFC received data count. More...
 

Detailed Description

The functions provide a set of APIs to handle battery charging operations.

Function Documentation

◆ Cy_USBPD_Bch_Phy_Init()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_Init ( cy_stc_usbpd_context_t context,
cy_cb_bc_phy_events_t  bcPhyCbk 
)

This function initializes the charger detect block and registers a callback function with the charger detect PHY layer.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
bcPhyCbkBattery Charging Event Callback function pointer. Must be non-NULL.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_En()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_En ( cy_stc_usbpd_context_t context)

This function enables the charging block hardware.

The Cy_USBPD_Bch_Phy_Init function should previously have been called to initialize the block.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_Dis()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_Dis ( cy_stc_usbpd_context_t context)

This function disables the charging block hardware in the USB-PD IP.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_ConfigSrcTerm()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_ConfigSrcTerm ( cy_stc_usbpd_context_t context,
cy_en_usbpd_bch_src_term_t  chargerTerm 
)

This function applies the desired source terminations on D+/D- lines.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
chargerTermCharger Terminations as per the required protocol
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_ConfigSnkTerm()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_ConfigSnkTerm ( cy_stc_usbpd_context_t context,
cy_en_usbpd_bch_snk_term_t  chargerTerm 
)

This function applies the desired sink terminations on D+/D- lines.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
chargerTermSink Terminations to be applied.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_RemoveTerm()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_RemoveTerm ( cy_stc_usbpd_context_t context)

This function removes all terminations/voltage sources from D+/D- lines.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_Config_Comp()

bool Cy_USBPD_Bch_Phy_Config_Comp ( cy_stc_usbpd_context_t context,
uint8_t  compIdx,
cy_en_usbpd_bch_comp_pinput_t  pInput,
cy_en_usbpd_bch_comp_ninput_t  mInput,
cy_en_usbpd_bch_vref_t  vref,
cy_en_usbpd_bch_comp_edge_t  edge 
)

This function configures and enables one of the charger detect comparators.

This can be used for a quick comparator state check or to configure the PHY to provide an interrupt callback when the comparator state changes

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
compIdxComparator index(0 or 1).
pInputPositive input signal selection
mInputNegative input signal selection
vrefVref value to be used when either input selection is vref.
edgeEdge selection. If edge is selected, then callback registered in Cy_USBPD_Bch_Phy_Init will be called when event fires. If edge is no interrupt, then this function will revert the comparator to its previous settings after comparison is done.
Returns
Comparator output value.

◆ Cy_USBPD_Bch_Phy_DisableComp()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_DisableComp ( cy_stc_usbpd_context_t context,
uint8_t  compIdx 
)

This function disables one of the charger detect comparators.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
compIdxComparator index.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_Isolate_DpDm()

cy_en_usbpd_status_t Cy_USBPD_Bch_Phy_Isolate_DpDm ( cy_stc_usbpd_context_t context)

This function isolates the charge detect block from D+/D- lines.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Phy_CompResult()

bool Cy_USBPD_Bch_Phy_CompResult ( cy_stc_usbpd_context_t context,
uint8_t  compIdx 
)

This function checks and returns the comparator output.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
compIdxComparator index.
Returns
Comparator Output

◆ Cy_USBPD_Bch_ApplyDpPd()

cy_en_usbpd_status_t Cy_USBPD_Bch_ApplyDpPd ( cy_stc_usbpd_context_t context)

This function applies pulldown on D+.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_RemoveDpPd()

cy_en_usbpd_status_t Cy_USBPD_Bch_RemoveDpPd ( cy_stc_usbpd_context_t context)

This function removes pulldown on D+.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_ApplyRdatLkgDp()

void Cy_USBPD_Bch_ApplyRdatLkgDp ( cy_stc_usbpd_context_t context)

This function applies RDAT_LKG resistance on D+.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_ApplyRdatLkgDm()

void Cy_USBPD_Bch_ApplyRdatLkgDm ( cy_stc_usbpd_context_t context)

This function applies RDAT_LKG resistance on D-.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_RemoveRdatLkgDp()

void Cy_USBPD_Bch_RemoveRdatLkgDp ( cy_stc_usbpd_context_t context)

This function removes RDAT_LKG resistance on D+.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_RemoveRdatLkgDm()

void Cy_USBPD_Bch_RemoveRdatLkgDm ( cy_stc_usbpd_context_t context)

This function removes RDAT_LKG resistance on D-.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Apply_AppleTermDp()

void Cy_USBPD_Bch_Apply_AppleTermDp ( cy_stc_usbpd_context_t context,
cy_en_usbpd_bch_src_term_t  appleTermId 
)

This function applies Apple source terminations on D+.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
appleTermIdApple termination ID
Returns
None

◆ Cy_USBPD_Bch_Apply_AppleTermDm()

void Cy_USBPD_Bch_Apply_AppleTermDm ( cy_stc_usbpd_context_t context,
cy_en_usbpd_bch_src_term_t  appleTermId 
)

This function applies Apple source terminations on D-.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
appleTermIdApple termination ID
Returns
None

◆ Cy_USBPD_Bch_Apply_VdmSrc()

void Cy_USBPD_Bch_Apply_VdmSrc ( cy_stc_usbpd_context_t context)

This function applies VDM_SRC on DM.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Remove_VdmSrc()

void Cy_USBPD_Bch_Remove_VdmSrc ( cy_stc_usbpd_context_t context)

This function removes VDM_SRC on DM.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Is_VdmSrc_On()

bool Cy_USBPD_Bch_Is_VdmSrc_On ( cy_stc_usbpd_context_t context)

Function to check whether VDM_SRC supply is enabled.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
True if VDM_SRC supply is ON, false otherwise.

◆ Cy_USBPD_Bch_Remove_AppleSrcDp()

void Cy_USBPD_Bch_Remove_AppleSrcDp ( cy_stc_usbpd_context_t context)

This function removes Apple source terminations from D+.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Remove_AppleSrcDm()

void Cy_USBPD_Bch_Remove_AppleSrcDm ( cy_stc_usbpd_context_t context)

This function removes Apple source terminations from D-.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Enable_AppleDet()

void Cy_USBPD_Bch_Enable_AppleDet ( cy_stc_usbpd_context_t context)

This function enables Apple Brick ID detection.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Disable_AppleDet()

void Cy_USBPD_Bch_Disable_AppleDet ( cy_stc_usbpd_context_t context)

This function disables Apple Brick ID detection.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Phy_DpStat()

bool Cy_USBPD_Bch_Phy_DpStat ( cy_stc_usbpd_context_t context)

This function checks status of DP line.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
True if DP is high, false otherwise.

◆ Cy_USBPD_Bch_Phy_DmStat()

bool Cy_USBPD_Bch_Phy_DmStat ( cy_stc_usbpd_context_t context)

This function checks status of DM line.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
True if DM is high, false otherwise.

◆ Cy_USBPD_Bch_Phy_Config_DeepSleep()

void Cy_USBPD_Bch_Phy_Config_DeepSleep ( cy_stc_usbpd_context_t context)

This function configures the charger detect block for deepsleep entry.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Phy_Config_Wakeup()

void Cy_USBPD_Bch_Phy_Config_Wakeup ( cy_stc_usbpd_context_t context)

This function configures the charger detect block after deepsleep exit.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Intr1Handler()

void Cy_USBPD_Bch_Intr1Handler ( cy_stc_usbpd_context_t context)

This function handles the Battery Charging interrupts.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_QcSrcInit()

cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcInit ( cy_stc_usbpd_context_t context)

This function initialize QC source block.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_QcSrcStop()

cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcStop ( cy_stc_usbpd_context_t context)

This function deselect the QC source block.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_QcSrcMasterSenseEn()

cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcMasterSenseEn ( cy_stc_usbpd_context_t context)

This function enable master for hardware to start sensing the pulses on Dplus and Dminus.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_QcSrcMasterSenseDis()

cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcMasterSenseDis ( cy_stc_usbpd_context_t context)

This function disable master for hardware to stop sensing the pulses on Dplus and Dminus.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_QcSrcContModeStart()

cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcContModeStart ( cy_stc_usbpd_context_t context)

This function configures the QC3 block, enable QC interrupts and enables master for DP and DM sensing.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_QcSrcContModeStop()

cy_en_usbpd_status_t Cy_USBPD_Bch_QcSrcContModeStop ( cy_stc_usbpd_context_t context)

This function disables QC3 block and interrupts, and also disables the DP/DM master sensing.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcSrcInit()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSrcInit ( cy_stc_usbpd_context_t context)

This function enables the AFC source clock, filters and other configurations.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcSrcStart()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSrcStart ( cy_stc_usbpd_context_t context)

This function starts the AFC source state machine operations.

Cy_USBPD_Bch_AfcSrcInit function must be called before this function call.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcSrcStop()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSrcStop ( cy_stc_usbpd_context_t context)

This function stops the AFC source state machine operations.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_Afc_Set_Tx_Data()

void Cy_USBPD_Bch_Afc_Set_Tx_Data ( cy_stc_usbpd_context_t context,
uint8_t *  dataPtr,
uint8_t  count 
)

This function transmits AFC (Adaptive Fast Charging) data buffer provided.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
dataPtrTransmit data buffer pointer
countTransmit data count
Returns
None

◆ Cy_USBPD_Bch_AfcSinkInit()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkInit ( cy_stc_usbpd_context_t context)

This function initialize the AFC (Adaptive Fast Charging) clock, filters and enables block for sink operations.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcSinkStartPing()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkStartPing ( cy_stc_usbpd_context_t context)

This function sends a ping request to AFC (Adaptive Fast Charging) source.

operations.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcSinkStart()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkStart ( cy_stc_usbpd_context_t context)

This function configures the AFC (Adaptive Fast Charging) state machine, interrupts and stats the AFC sink operations.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcSinkStop()

cy_en_usbpd_status_t Cy_USBPD_Bch_AfcSinkStop ( cy_stc_usbpd_context_t context)

This function disables all AFC (Adaptive Fast Charging) interrupt.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Bch_AfcGetRxDataPtr()

uint8_t* Cy_USBPD_Bch_AfcGetRxDataPtr ( cy_stc_usbpd_context_t context)

This function returns the AFC (Adaptive Fast Charging) received data pointer.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
Received data pointer

◆ Cy_USBPD_Bch_AfcGetRxDataCount()

uint8_t Cy_USBPD_Bch_AfcGetRxDataCount ( cy_stc_usbpd_context_t context)

This function returns the AFC(Adaptive Fast Charging) received data count.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
received data count

◆ Cy_USBPD_Bch_AfcLoadTxData()

void Cy_USBPD_Bch_AfcLoadTxData ( cy_stc_usbpd_context_t context)

This function load the USBPD context AFC (Adaptive Fast Charging) tx data into AFC ping pong buffer.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_QC3_IntrHandler()

void Cy_USBPD_Bch_QC3_IntrHandler ( cy_stc_usbpd_context_t context)

This function handles the QC3 interrupts.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_AfcPingPong_IntrHandler()

void Cy_USBPD_Bch_AfcPingPong_IntrHandler ( cy_stc_usbpd_context_t context)

This function handles the AFC ping pong interrupts and copies data into context buffer.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_AfcIdle_IntrHandler()

void Cy_USBPD_Bch_AfcIdle_IntrHandler ( cy_stc_usbpd_context_t context)

This function handles the AFC idle interrupt.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_AfcReset_IntrHandler()

void Cy_USBPD_Bch_AfcReset_IntrHandler ( cy_stc_usbpd_context_t context)

This function handles the AFC reset interrupt.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Intr0Handler()

void Cy_USBPD_Bch_Intr0Handler ( cy_stc_usbpd_context_t context)

This function handles the Battery Charging interrupts related to AFC and QC.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
None

◆ Cy_USBPD_Bch_Get_QcPulseCount()

__STATIC_INLINE int Cy_USBPD_Bch_Get_QcPulseCount ( cy_stc_usbpd_context_t context)

This function returns the QC3 pulse count stored in the context variable.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
QC3 pulse count

◆ Cy_USBPD_Bch_Update_QcPulseCount()

__STATIC_INLINE void Cy_USBPD_Bch_Update_QcPulseCount ( cy_stc_usbpd_context_t context,
int  new_count 
)

This function update the QC3 pulse count in the context variable.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
new_countNew QC3 pulse count received
Returns
None

◆ Cy_USBPD_Bch_Get_AfcDataPtr()

__STATIC_INLINE uint8_t* Cy_USBPD_Bch_Get_AfcDataPtr ( cy_stc_usbpd_context_t context)

This function returns the USBPD context AFC received data pointer.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
AFC received data pointer

◆ Cy_USBPD_Bch_Get_AfcDataCount()

__STATIC_INLINE uint8_t Cy_USBPD_Bch_Get_AfcDataCount ( cy_stc_usbpd_context_t context)

This function returns the USBPD context AFC received data count.

Parameters
contextPointer to the context structure cy_stc_usbpd_context_t.
Returns
AFC received data count