CAT2 Peripheral Driver Library

Functions

cy_en_usbpd_status_t Cy_USBPD_Hpd_ReceiveInit (cy_stc_usbpd_context_t *context, cy_cb_usbpd_hpd_events_t cbk)
 Enables the HPD-Receive functionality for the specified PD port based on passed context. More...
 
cy_en_usbpd_status_t Cy_USBPD_Hpd_TransmitInit (cy_stc_usbpd_context_t *context, cy_cb_usbpd_hpd_events_t cbk)
 Enables the HPD-Transmit functionality for the specified PD port. More...
 
void Cy_USBPD_Hpd_SleepEntry (cy_stc_usbpd_context_t *context)
 Prepares the HPD transmit block for deep-sleep. More...
 
void Cy_USBPD_Hpd_Wakeup (cy_stc_usbpd_context_t *context, bool value)
 Restores the HPD Tx signal driver after device wakes up from deep-sleep. More...
 
bool Cy_USBPD_Hpd_ReceiveGetStatus (cy_stc_usbpd_context_t *context)
 This function is used to fetch the current state of the signal if the HPD receive block is turned ON. More...
 
void Cy_USBPD_Hpd_RxSleepEntry (cy_stc_usbpd_context_t *context, bool hpdState)
 Prepares the HPD RX block for deep-sleep. More...
 
void Cy_USBPD_Hpd_RxWakeup (cy_stc_usbpd_context_t *context)
 Restores the HPD Tx signal driver after device wakes up from deep-sleep. More...
 
cy_en_usbpd_status_t Cy_USBPD_Hpd_Deinit (cy_stc_usbpd_context_t *context)
 Disable the HPD functionality on the specified PD port. More...
 
bool Cy_USBPD_Hpdt_IsCommandActive (cy_stc_usbpd_context_t *context)
 Checks whether the CtrlReg Command is already started. More...
 
cy_en_usbpd_status_t Cy_USBPD_Hpd_TransmitSendevt (cy_stc_usbpd_context_t *context, cy_en_usbpd_hpd_events_t evtype)
 Sends the desired HPD event out through the HPD GPIO. More...
 
void Cy_USBPD_Hpd_Intr0Handler (cy_stc_usbpd_context_t *context)
 HPD Interrupt handler. More...
 
void Cy_USBPD_Hpd_Intr1Handler (cy_stc_usbpd_context_t *context)
 HPD Interrupt handler. More...
 

Detailed Description

Function Documentation

◆ Cy_USBPD_Hpd_ReceiveInit()

cy_en_usbpd_status_t Cy_USBPD_Hpd_ReceiveInit ( cy_stc_usbpd_context_t context,
cy_cb_usbpd_hpd_events_t  cbk 
)

Enables the HPD-Receive functionality for the specified PD port based on passed context.

This function shall be used in DP Sink designs and should not be combined with the Cy_USBPD_Hpd_TransmitInit call.

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.
cbkCallback function to be called when there is an HPD event.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Hpd_TransmitInit()

cy_en_usbpd_status_t Cy_USBPD_Hpd_TransmitInit ( cy_stc_usbpd_context_t context,
cy_cb_usbpd_hpd_events_t  cbk 
)

Enables the HPD-Transmit functionality for the specified PD port.

This function shall be used in DP source designs and should not be combined with the Cy_USBPD_Hpd_ReceiveInit call.

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.
cbkCallback function to be used for command completion event.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Hpd_SleepEntry()

void Cy_USBPD_Hpd_SleepEntry ( cy_stc_usbpd_context_t context)

Prepares the HPD transmit block for deep-sleep.

This function changes the IO mode of the HPD signal to GPIO, so as to avoid glitches on the signal during the active - sleep - active power mode transitions of the 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.
Returns
None

◆ Cy_USBPD_Hpd_Wakeup()

void Cy_USBPD_Hpd_Wakeup ( cy_stc_usbpd_context_t context,
bool  value 
)

Restores the HPD Tx signal driver after device wakes up from deep-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.
valueStartup value for the HPD signal. The APP layer is expected to identify the desired (PLUG/UNPLUG) state of the signal and pass it to the PDL.
Returns
None

◆ Cy_USBPD_Hpd_ReceiveGetStatus()

bool Cy_USBPD_Hpd_ReceiveGetStatus ( cy_stc_usbpd_context_t context)

This function is used to fetch the current state of the signal if the HPD receive block is 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
true if HPD input from GPIO is high false if HPD input from GPIO is low

◆ Cy_USBPD_Hpd_RxSleepEntry()

void Cy_USBPD_Hpd_RxSleepEntry ( cy_stc_usbpd_context_t context,
bool  hpdState 
)

Prepares the HPD RX block for deep-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.
hpdStateConnection status of HPD.
Returns
None

◆ Cy_USBPD_Hpd_RxWakeup()

void Cy_USBPD_Hpd_RxWakeup ( cy_stc_usbpd_context_t context)

Restores the HPD Tx signal driver after device wakes up from deep-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.
Returns
None

◆ Cy_USBPD_Hpd_Deinit()

cy_en_usbpd_status_t Cy_USBPD_Hpd_Deinit ( cy_stc_usbpd_context_t context)

Disable the HPD functionality on the specified PD port.

This is used for HPD receive as well transmit de-initialization.

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
cy_en_usbpd_status_t

◆ Cy_USBPD_Hpdt_IsCommandActive()

bool Cy_USBPD_Hpdt_IsCommandActive ( cy_stc_usbpd_context_t context)

Checks whether the CtrlReg Command is already started.

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
Returns true if not started, false otherwise.

◆ Cy_USBPD_Hpd_TransmitSendevt()

cy_en_usbpd_status_t Cy_USBPD_Hpd_TransmitSendevt ( cy_stc_usbpd_context_t context,
cy_en_usbpd_hpd_events_t  evtype 
)

Sends the desired HPD event out through the HPD GPIO.

Only the CY_USBPD_HPD_EVENT_UNPLUG, CY_USBPD_HPD_EVENT_UNPLUG and CY_USBPD_HPD_EVENT_IRQ events should be requested.

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.
evtypeType of HPD event to be sent.
Returns
cy_en_usbpd_status_t

◆ Cy_USBPD_Hpd_Intr0Handler()

void Cy_USBPD_Hpd_Intr0Handler ( cy_stc_usbpd_context_t context)

HPD Interrupt handler.

Expected to be called from PD Interrupt 0 handler.

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_Hpd_Intr1Handler()

void Cy_USBPD_Hpd_Intr1Handler ( cy_stc_usbpd_context_t context)

HPD Interrupt handler.

Expected to be called from PD Interrupt 1 handler.

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.