This section describes the HPI function prototypes.
Functions | |
bool | Cy_Hpi_IsEcReady (cy_stc_hpi_context_t *context) |
Checks for EC initialization complete event is received. More... | |
void | Cy_Hpi_SetEvent (cy_stc_hpi_context_t *context, uint8_t evtCode) |
Updates the Interrupt Status register and assert the EC_INT pin. More... | |
void | Cy_Hpi_ClearEvent (cy_stc_hpi_context_t *context, uint8_t evtCode) |
Clears the Interrupt Status register and deassert the EC_INT pin. More... | |
void | Cy_Hpi_UcsiRegReset (cy_stc_hpi_context_t *context) |
Clears the Status and Control register. More... | |
void | Cy_Hpi_UcsiClearStatusBit (cy_stc_hpi_context_t *context, uint8_t bitIdx) |
Clears the appropriate bit_idx to '0' in the Status register. More... | |
void | Cy_Hpi_UcsiSetStatusBit (cy_stc_hpi_context_t *context, uint8_t bitIdx) |
Sets appropriate bit index to '1' in the Status register. More... | |
uint8_t | Cy_Hpi_GetUcsiControl (cy_stc_hpi_context_t *context) |
Gets the UCSI Control register value. More... | |
uint8_t | Cy_Hpi_GetStatusBit (cy_stc_hpi_context_t *context, uint8_t bitIdx) |
Gets the UCSI Status bit. More... | |
uint8_t * | Cy_Hpi_UcsiGetStatusRegAddr (cy_stc_hpi_context_t *context) |
Gets the UCSI Status register address. More... | |
uint8_t * | Cy_Hpi_UcsiGetControlRegAddr (cy_stc_hpi_context_t *context) |
Gets the UCSI Control register address. More... | |
bool | Cy_Hpi_IsVdmEcCtrlEnabled (cy_stc_hpi_context_t *context, uint8_t port) |
Checks if the EC control of VDMs is enabled. More... | |
bool | Cy_Hpi_IsExtdMsgEcCtrlEnabled (cy_stc_hpi_context_t *context, uint8_t port) |
Checks whether the handling of extended messages by EC is enabled. More... | |
uint8_t | Cy_Hpi_GetEcActiveModes (cy_stc_hpi_context_t *context, uint8_t port) |
Gets the active EC alternate modes value. More... | |
bool | Cy_Hpi_QueuePdMsg (cy_stc_hpi_context_t *context, cy_en_hpi_reg_section_t section, uint8_t status, uint16_t len1, uint8_t *data1, uint16_t len2, uint8_t *data2) |
PDStack and application layers sends event and extended message notifications to the EC through the HPI registers. More... | |
void | Cy_Hpi_PdEventHandler (cy_stc_hpi_context_t *context, uint8_t port, uint8_t evt, const void *data) |
Receives PD events from the stack and to update the HPI registers. More... | |
void | Cy_Hpi_SendHwErrorEvent (cy_stc_hpi_context_t *context, uint8_t port, uint8_t errType) |
Notifies the EC for a system hardware access error. More... | |
void | Cy_Hpi_SetHpiVersion (cy_stc_hpi_context_t *context, uint32_t hpiVers) |
Sets the HPI version info. More... | |
void | Cy_Hpi_SetHpiVersionExt (cy_stc_hpi_context_t *context, uint32_t hpiVers) |
This function sets the HPI version extended information. More... | |
void | Cy_Hpi_SetModeRegs (cy_stc_hpi_context_t *context, uint8_t devMode, uint8_t modeReason) |
Updates the Device and Boot modes reason in HPI registers. More... | |
void | Cy_Hpi_UpdateVersions (cy_stc_hpi_context_t *context, uint8_t *blVersion, uint8_t *fw1Version, uint8_t *fw2Version) |
Updates the firmware version information in the HPI registers. More... | |
void | Cy_Hpi_UpdateRegs (cy_stc_hpi_context_t *context, uint8_t section, uint8_t offset, uint8_t *data, uint8_t size) |
Updates the information in the HPI registers. More... | |
void * | Cy_Hpi_GetDevAddr (cy_stc_hpi_context_t *context) |
API to fetch the base address of the HPI Device register space. More... | |
void | Cy_Hpi_UpdateFwLocations (cy_stc_hpi_context_t *context, uint16_t fw1Location, uint16_t fw2Location) |
Updates the firmware location HPI registers. More... | |
bool | Cy_Hpi_RegEnqueueEvent (cy_stc_hpi_context_t *context, cy_en_hpi_reg_section_t section, uint8_t status, uint16_t length, uint8_t *data) |
PDStack and application layers send event notifications to the EC through the HPI registers. More... | |
uint8_t | Cy_Hpi_GetConsFetStatus (cy_stc_hpi_context_t *context, uint8_t port) |
Retrieves the current value of consumer FET Status register. More... | |
void | Cy_Hpi_UpdateConsFetStatus (cy_stc_hpi_context_t *context, uint8_t port, uint8_t status) |
Updates the consumer FET status associated with a port. More... | |
uint8_t | Cy_Hpi_GetPortEnable (cy_stc_hpi_context_t *context) |
Gets the Port Enable register value. More... | |
uint8_t | Cy_Hpi_GetSysPwrState (cy_stc_hpi_context_t *context) |
Gets the content of the HPI System power State register. More... | |
uint8_t * | Cy_Hpi_BbGetVersion (cy_stc_hpi_context_t *context) |
Gets the Billboard firmware version. More... | |
void | Cy_Hpi_BbRegUpdate (cy_stc_hpi_context_t *context, uint8_t bbRegAddr, void *data) |
Updates the content of the Billboard Control register. More... | |
uint32_t | Cy_Hpi_BbGetReg (cy_stc_hpi_context_t *context, uint8_t bbRegAddr) |
Gets the current content of the Billboard Control register. More... | |
void | Cy_Hpi_SetUserdefWriteHandler (cy_stc_hpi_context_t *context, cy_hpi_write_cbk_t wrHandler) |
Enables handling of EC writes to the user-defined HPI register region in the application code. More... | |
bool | Cy_Hpi_InitUserdefRegs (cy_stc_hpi_context_t *context, uint16_t regAddr, uint8_t size, uint8_t *data) |
Initializes the contents of the user-defined registers that are part of the HPI register space. More... | |
void | Cy_Hpi_Task (cy_stc_hpi_context_t *context) |
Handles the commands from the EC through the HPI registers. More... | |
void | Cy_Hpi_SetEcInterrupt (cy_stc_hpi_context_t *context, bool enable) |
Configures HPI to use the EC_INT pin for interrupt mode. More... | |
void | Cy_Hpi_SendFwReadyEvent (cy_stc_hpi_context_t *context) |
Sends a firmware-ready notification through HPI to the EC. More... | |
void | Cy_Hpi_SetPortEventMask (cy_stc_hpi_context_t *context, uint8_t port, uint32_t mask) |
Updates the event mask value for the specified PD port. More... | |
ATTRIBUTES_HPISS_HPI void | Cy_Hpi_SetPortBcStatus (cy_stc_hpi_context_t *context, uint8_t port, uint8_t bcStatus) |
Updates the BC 1.2 connection status to the HPI interface. More... | |
void | Cy_Hpi_SetFlashParams (cy_stc_hpi_context_t *context, uint32_t flashSize, uint16_t rowSize, uint16_t rowCnt, uint16_t blLastRow) |
Sets the CCG device flash parameters. More... | |
bool | Cy_Hpi_IsAccessed (cy_stc_hpi_context_t *context) |
Checks for any recent HPI accesses since start up. More... | |
void | Cy_Hpi_UpdatePdoChange (cy_stc_hpi_context_t *context, bool disable) |
Enables/disables PDO update through HPI. More... | |
void | Cy_Hpi_Init (cy_stc_hpi_context_t *context, cy_stc_hpi_hw_config_t *ptrHwConfig, cy_stc_hpi_app_cbk_t *ptrAppCbk, void *pdPort0Ctx, void *pdPort1Ctx, uint8_t numPorts) |
Initializes the HPI library variables and registers to their default values, registers the context reference pointers, and enables the I2C interface. More... | |
void | Cy_Hpi_Deinit (cy_stc_hpi_context_t *context) |
Deinitializes the HPI interface. More... | |
bool | Cy_Hpi_SleepAllowed (cy_stc_hpi_context_t *context) |
Checks if the CCG device enters Deep Sleep mode. More... | |
bool | Cy_Hpi_Sleep (cy_stc_hpi_context_t *context) |
Checks whether the I2C interface is idle so that the CCG device can enter into Deep Sleep mode. More... | |
bool | Cy_Hpi_UcsiInitContext (cy_stc_hpi_context_t *ptrHpiContext, void *ptrUcsiContext) |
Registers the UCSI context pointer to the HPI context. More... | |
void | Cy_Hpi_I2cInterruptHandler (cy_stc_hpi_context_t *ptrHpiContext) |
Handles I2C hardware interrupts. More... | |
void | Cy_Hpi_SetResetCount (cy_stc_hpi_context_t *context, uint32_t count) |
Writes the WDT reset count value to a device-specific register. More... | |
void | Cy_Hpi_SendPfEvent (cy_stc_hpi_context_t *ptrHpiContext, uint8_t port, uint8_t evtType) |
Notifies EC about platform-specific events, if mask is enabled. More... | |
void | Cy_Hpi_EnqueuePdPktMsgEvent (cy_stc_hpi_context_t *context, uint8_t port, cy_stc_pd_packet_extd_t *ptrPdPkt, cy_en_hpi_response_t eventType, uint32_t maskBit) |
Enqueues HPI events or PD msgs from PDStack. More... | |
void | Cy_Hpi_InitSromParams (bool pdEn, bool pdCmdEn, bool ucsiEn, bool dualAppEn, const uint32_t *ptrHpiDevMask, const uint32_t *ptrHpiPortMask) |
Initializes the HPI parameters required for HPI lib variant support. More... | |
const uint32_t * | Cy_Hpi_GetDevRegRespMskPtr (void) |
This function returns the address of the HPI Device register response mask array which defines whether the register/cmd access is enabled or disabled. More... | |
const uint32_t * | Cy_Hpi_GetPortRegRespMskPtr (void) |
This function returns the address of the HPI Port register response mask array which defines whether the register/cmd access is enabled or disabled. More... | |
bool Cy_Hpi_IsEcReady | ( | cy_stc_hpi_context_t * | context | ) |
Checks for EC initialization complete event is received.
This function is used by the application to check the EC has sent the EC initialization complete event notification.
context | HPI library context pointer. |
void Cy_Hpi_SetEvent | ( | cy_stc_hpi_context_t * | context, |
uint8_t | evtCode | ||
) |
Updates the Interrupt Status register and assert the EC_INT pin.
context | HPI library context pointer. |
evtCode | Set the event code. |
void Cy_Hpi_ClearEvent | ( | cy_stc_hpi_context_t * | context, |
uint8_t | evtCode | ||
) |
Clears the Interrupt Status register and deassert the EC_INT pin.
context | HPI library context pointer. |
evtCode | Clears the event code. |
void Cy_Hpi_UcsiRegReset | ( | cy_stc_hpi_context_t * | context | ) |
Clears the Status and Control register.
context | HPI library context pointer. |
Clears the Status and Control register.
void Cy_Hpi_UcsiClearStatusBit | ( | cy_stc_hpi_context_t * | context, |
uint8_t | bitIdx | ||
) |
Clears the appropriate bit_idx to '0' in the Status register.
context | HPI library context pointer. |
bitIdx | Clears the bit index. |
Clears the appropriate bit_idx to '0' in the Status register.
void Cy_Hpi_UcsiSetStatusBit | ( | cy_stc_hpi_context_t * | context, |
uint8_t | bitIdx | ||
) |
Sets appropriate bit index to '1' in the Status register.
context | HPI library context pointer. |
bitIdx | Sets the bit index. |
Sets appropriate bit index to '1' in the Status register.
uint8_t Cy_Hpi_GetUcsiControl | ( | cy_stc_hpi_context_t * | context | ) |
Gets the UCSI Control register value.
context | HPI library context pointer. |
Gets the UCSI Control register value.
uint8_t Cy_Hpi_GetStatusBit | ( | cy_stc_hpi_context_t * | context, |
uint8_t | bitIdx | ||
) |
Gets the UCSI Status bit.
context | HPI library context pointer. |
bitIdx | Status bit index. |
Gets the UCSI Status bit.
uint8_t* Cy_Hpi_UcsiGetStatusRegAddr | ( | cy_stc_hpi_context_t * | context | ) |
Gets the UCSI Status register address.
context | HPI library context pointer. |
uint8_t* Cy_Hpi_UcsiGetControlRegAddr | ( | cy_stc_hpi_context_t * | context | ) |
Gets the UCSI Control register address.
context | HPI library context pointer. |
bool Cy_Hpi_IsVdmEcCtrlEnabled | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port | ||
) |
Checks if the EC control of VDMs is enabled.
context | HPI library context pointer. |
port | USB PD port to check the configuration. |
bool Cy_Hpi_IsExtdMsgEcCtrlEnabled | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port | ||
) |
Checks whether the handling of extended messages by EC is enabled.
If not, the CCG firmware will automatically responds with a NOT_SUPPORTED messages.
context | HPI library context pointer. |
port | USB PD port to check the configuration. |
uint8_t Cy_Hpi_GetEcActiveModes | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port | ||
) |
Gets the active EC alternate modes value.
context | HPI library context pointer. |
port | USB PD to check the configuration. |
bool Cy_Hpi_QueuePdMsg | ( | cy_stc_hpi_context_t * | context, |
cy_en_hpi_reg_section_t | section, | ||
uint8_t | status, | ||
uint16_t | len1, | ||
uint8_t * | data1, | ||
uint16_t | len2, | ||
uint8_t * | data2 | ||
) |
PDStack and application layers sends event and extended message notifications to the EC through the HPI registers.
Note that only responses without associated data is sent through the Response register for the HPI_REG_SECTION_DEV section. If any additional response data is required, use the user-defined registers or the response register associated with CY_HPI_REG_SECTION_PORT_0 or CY_HPI_REG_SECTION_PORT_1.
context | HPI library context pointer. |
section | Reports the event through the register section. |
status | The event code to be stored into the Response register. |
len1 | Length of the data associated with the event. |
data1 | Pointer to buffer containing data associated with the event. |
len2 | PD message data length in bytes. |
data2 | Pointer to buffer containing PD message data. |
void Cy_Hpi_PdEventHandler | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port, | ||
uint8_t | evt, | ||
const void * | data | ||
) |
Receives PD events from the stack and to update the HPI registers.
context | HPI library context pointer. |
port | PD port corresponding to the event. |
evt | Event is notified. |
data | Data associated with the event. This is an opaque pointer that needs to be de-referenced based on event type. |
void Cy_Hpi_SendHwErrorEvent | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port, | ||
uint8_t | errType | ||
) |
Notifies the EC for a system hardware access error.
context | HPI library context pointer. |
port | PD port index. |
errType | Detects the type of error. |
void Cy_Hpi_SetHpiVersion | ( | cy_stc_hpi_context_t * | context, |
uint32_t | hpiVers | ||
) |
Sets the HPI version info.
context | HPI library context pointer. |
hpiVers | HPI version information. |
void Cy_Hpi_SetHpiVersionExt | ( | cy_stc_hpi_context_t * | context, |
uint32_t | hpiVers | ||
) |
This function sets the HPI version extended information.
context | HPI Library context pointer. |
hpiVers | HPI version information. |
void Cy_Hpi_SetModeRegs | ( | cy_stc_hpi_context_t * | context, |
uint8_t | devMode, | ||
uint8_t | modeReason | ||
) |
Updates the Device and Boot modes reason in HPI registers.
context | HPI library context pointer. |
devMode | Sets the value into the Device mode register. |
modeReason | Sets the value into the Boot mode reason register. |
void Cy_Hpi_UpdateVersions | ( | cy_stc_hpi_context_t * | context, |
uint8_t * | blVersion, | ||
uint8_t * | fw1Version, | ||
uint8_t * | fw2Version | ||
) |
Updates the firmware version information in the HPI registers.
context | HPI library context pointer. |
blVersion | Buffer contains the Bootloader version information. |
fw1Version | Buffer contains the firmware-1 version information. |
fw2Version | Buffer contains the firmware-2 version information. |
void Cy_Hpi_UpdateRegs | ( | cy_stc_hpi_context_t * | context, |
uint8_t | section, | ||
uint8_t | offset, | ||
uint8_t * | data, | ||
uint8_t | size | ||
) |
Updates the information in the HPI registers.
context | HPI library context pointer. |
section | HPI register section (DEV/PORT-0/PORT-1). |
offset | HPI Device register offset. |
data | Buffer contains the data to be written. |
size | Write the number of bytes of data. |
void* Cy_Hpi_GetDevAddr | ( | cy_stc_hpi_context_t * | context | ) |
API to fetch the base address of the HPI Device register space.
context | HPI library context pointer. |
void Cy_Hpi_UpdateFwLocations | ( | cy_stc_hpi_context_t * | context, |
uint16_t | fw1Location, | ||
uint16_t | fw2Location | ||
) |
Updates the firmware location HPI registers.
context | HPI library context pointer. |
fw1Location | Flash row where FW1 is located. |
fw2Location | Flash row where FW2 is located. |
bool Cy_Hpi_RegEnqueueEvent | ( | cy_stc_hpi_context_t * | context, |
cy_en_hpi_reg_section_t | section, | ||
uint8_t | status, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
PDStack and application layers send event notifications to the EC through the HPI registers.
Note that only responses without associated data can be sent through the Response register for the HPI_REG_SECTION_DEV section. If any additional response data is required, use the user-defined registers or the response register associated with CY_HPI_REG_SECTION_PORT_0 or CY_HPI_REG_SECTION_PORT_1.
context | HPI library context pointer. |
section | Reports the event through the register section. |
status | Stores the event code into the response register. |
length | Length of the data associated with the event. |
data | Pointer to buffer containing data associated with the event. |
uint8_t Cy_Hpi_GetConsFetStatus | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port | ||
) |
Retrieves the current value of consumer FET Status register.
context | HPI library context pointer. |
port | Port for which consumer FET status is to be retrieved. |
void Cy_Hpi_UpdateConsFetStatus | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port, | ||
uint8_t | status | ||
) |
Updates the consumer FET status associated with a port.
context | HPI library context pointer. |
port | Port on which FET status has to be updated. |
status | Stores the new value in the register. |
uint8_t Cy_Hpi_GetPortEnable | ( | cy_stc_hpi_context_t * | context | ) |
Gets the Port Enable register value.
context | HPI library context pointer. |
uint8_t Cy_Hpi_GetSysPwrState | ( | cy_stc_hpi_context_t * | context | ) |
Gets the content of the HPI System power State register.
context | HPI library context pointer. |
uint8_t* Cy_Hpi_BbGetVersion | ( | cy_stc_hpi_context_t * | context | ) |
Gets the Billboard firmware version.
context | HPI library context pointer. |
void Cy_Hpi_BbRegUpdate | ( | cy_stc_hpi_context_t * | context, |
uint8_t | bbRegAddr, | ||
void * | data | ||
) |
Updates the content of the Billboard Control register.
context | HPI library context pointer. |
bbRegAddr | Billboard related register address. |
data | Register write data pointer. |
uint32_t Cy_Hpi_BbGetReg | ( | cy_stc_hpi_context_t * | context, |
uint8_t | bbRegAddr | ||
) |
Gets the current content of the Billboard Control register.
context | HPI library context pointer. |
bbRegAddr | Billboard related register address. |
void Cy_Hpi_SetUserdefWriteHandler | ( | cy_stc_hpi_context_t * | context, |
cy_hpi_write_cbk_t | wrHandler | ||
) |
Enables handling of EC writes to the user-defined HPI register region in the application code.
context | HPI library context pointer. |
wrHandler | Pointer to function that handles the received HPI writes. |
bool Cy_Hpi_InitUserdefRegs | ( | cy_stc_hpi_context_t * | context, |
uint16_t | regAddr, | ||
uint8_t | size, | ||
uint8_t * | data | ||
) |
Initializes the contents of the user-defined registers that are part of the HPI register space.
context | HPI library context pointer. |
regAddr | Updates the base address of registers and stores it in the user-defined address region. |
size | Number of registers to be updated. The upper limit should not exceed the user- defined address region. |
data | Buffer contains the data to be copied into HPI registers. |
void Cy_Hpi_Task | ( | cy_stc_hpi_context_t * | context | ) |
Handles the commands from the EC through the HPI registers.
HPI writes from the EC are handled in interrupt context and any associated work is queued to be handled by this function. The Cy_Hpi_Task is expected to be called periodically from the main task loop of the firmware application.
context | HPI library context pointer. |
void Cy_Hpi_SetEcInterrupt | ( | cy_stc_hpi_context_t * | context, |
bool | enable | ||
) |
Configures HPI to use the EC_INT pin for interrupt mode.
context | HPI library context pointer. |
enable | Checks to enable or disable interrupt mode. |
void Cy_Hpi_SendFwReadyEvent | ( | cy_stc_hpi_context_t * | context | ) |
Sends a firmware-ready notification through HPI to the EC.
This event is sent to the EC to indicate that the device is out of reset and has a loaded firmware.
context | HPI library context pointer. |
void Cy_Hpi_SetPortEventMask | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port, | ||
uint32_t | mask | ||
) |
Updates the event mask value for the specified PD port.
context | HPI library context pointer. |
port | PD port index. |
mask | Event mask value to be set. |
ATTRIBUTES_HPISS_HPI void Cy_Hpi_SetPortBcStatus | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port, | ||
uint8_t | bcStatus | ||
) |
Updates the BC 1.2 connection status to the HPI interface.
context | HPI Library Context pointer. |
port | PD port index. |
bcStatus | BC 1.2 status. |
void Cy_Hpi_SetFlashParams | ( | cy_stc_hpi_context_t * | context, |
uint32_t | flashSize, | ||
uint16_t | rowSize, | ||
uint16_t | rowCnt, | ||
uint16_t | blLastRow | ||
) |
Sets the CCG device flash parameters.
These values are used for the device status reporting and firmware update implementation.
context | HPI library context pointer. |
flashSize | Total device flash size in bytes. |
rowSize | Size of each flash row in bytes. |
rowCnt | Number of flash rows on the device. |
blLastRow | Last flash row assigned to Bootloader. |
bool Cy_Hpi_IsAccessed | ( | cy_stc_hpi_context_t * | context | ) |
Checks for any recent HPI accesses since start up.
context | HPI library context pointer. |
void Cy_Hpi_UpdatePdoChange | ( | cy_stc_hpi_context_t * | context, |
bool | disable | ||
) |
Enables/disables PDO update through HPI.
context | HPI library context pointer. |
disable | Checks if the PDO update is disabled. |
void Cy_Hpi_Init | ( | cy_stc_hpi_context_t * | context, |
cy_stc_hpi_hw_config_t * | ptrHwConfig, | ||
cy_stc_hpi_app_cbk_t * | ptrAppCbk, | ||
void * | pdPort0Ctx, | ||
void * | pdPort1Ctx, | ||
uint8_t | numPorts | ||
) |
Initializes the HPI library variables and registers to their default values, registers the context reference pointers, and enables the I2C interface.
context | HPI library context pointer. |
ptrHwConfig | HPI hardware configuration pointer. |
ptrAppCbk | HPI application-specific callback structure pointer. |
pdPort0Ctx | Pointer to the PDStack port0 context structure. |
pdPort1Ctx | Pointer to the PDStack port1 context structure. |
numPorts | Number of PD ports supported by DUT. |
void Cy_Hpi_Deinit | ( | cy_stc_hpi_context_t * | context | ) |
Deinitializes the HPI interface.
This is used in applications where the HPI master (Billboard controller) in the system can be powered off under control of the CCG device.
context | HPI library context pointer. |
bool Cy_Hpi_SleepAllowed | ( | cy_stc_hpi_context_t * | context | ) |
Checks if the CCG device enters Deep Sleep mode.
context | HPI library context pointer. |
bool Cy_Hpi_Sleep | ( | cy_stc_hpi_context_t * | context | ) |
Checks whether the I2C interface is idle so that the CCG device can enter into Deep Sleep mode.
It also enables an I2C address match as a wake up trigger from Deep Sleep mode. Call the Cy_Hpi_SleepAllowed before calling this function.
context | HPI library context pointer. |
bool Cy_Hpi_UcsiInitContext | ( | cy_stc_hpi_context_t * | ptrHpiContext, |
void * | ptrUcsiContext | ||
) |
Registers the UCSI context pointer to the HPI context.
ptrHpiContext | HPI library context pointer. |
ptrUcsiContext | A void pointer of UCSI context pointer. |
void Cy_Hpi_I2cInterruptHandler | ( | cy_stc_hpi_context_t * | ptrHpiContext | ) |
Handles I2C hardware interrupts.
It must be called by the interrupt handler.
ptrHpiContext | HPI library context pointer. |
void Cy_Hpi_SetResetCount | ( | cy_stc_hpi_context_t * | context, |
uint32_t | count | ||
) |
Writes the WDT reset count value to a device-specific register.
context | HPI library context pointer. |
count | WDT reset count value. |
void Cy_Hpi_SendPfEvent | ( | cy_stc_hpi_context_t * | ptrHpiContext, |
uint8_t | port, | ||
uint8_t | evtType | ||
) |
Notifies EC about platform-specific events, if mask is enabled.
ptrHpiContext | HPI library context pointer. |
port | PD port index. |
evtType | Event type. |
void Cy_Hpi_EnqueuePdPktMsgEvent | ( | cy_stc_hpi_context_t * | context, |
uint8_t | port, | ||
cy_stc_pd_packet_extd_t * | ptrPdPkt, | ||
cy_en_hpi_response_t | eventType, | ||
uint32_t | maskBit | ||
) |
Enqueues HPI events or PD msgs from PDStack.
context | HPI library context pointer. |
port | PD port index. |
ptrPdPkt | Pointer to the PD Pkt. |
eventType | Event type. |
maskBit | Mask bit controls the reporting of HPI events. |
void Cy_Hpi_InitSromParams | ( | bool | pdEn, |
bool | pdCmdEn, | ||
bool | ucsiEn, | ||
bool | dualAppEn, | ||
const uint32_t * | ptrHpiDevMask, | ||
const uint32_t * | ptrHpiPortMask | ||
) |
Initializes the HPI parameters required for HPI lib variant support.
pdEn | true - If PD is enabled otherwise false. |
pdCmdEn | true - If PD commands are enabled otherwise false. |
ucsiEn | true - If UCSI is enabled otherwise false. |
dualAppEn | true - If dual-app mode is enabled, otherwise false. |
ptrHpiDevMask | HPI device register map to identify if the access is enabled or disabled for register/cmd. |
ptrHpiPortMask | HPI Port register map to identify if the access is enabled or disabled for register/cmd. |
const uint32_t* Cy_Hpi_GetDevRegRespMskPtr | ( | void | ) |
This function returns the address of the HPI Device register response mask array which defines whether the register/cmd access is enabled or disabled.
const uint32_t* Cy_Hpi_GetPortRegRespMskPtr | ( | void | ) |
This function returns the address of the HPI Port register response mask array which defines whether the register/cmd access is enabled or disabled.