HPI Library
cy_stc_hpi_app_cbk_t Struct Reference

Description

Defines the solution-specific application callback.

Data Fields

void(* ec_intr_write )(bool value)
 Handler to control the HPI EC interrupt pin. More...
 
uint32_t(* sys_get_custom_info_addr )(void)
 Handler to get the alt mode status. More...
 
bool(* hpi_is_event_enabled )(uint8_t port, uint8_t evCode, uint32_t evMask)
 Function to check the HPI event enabled status. More...
 
cy_en_pdstack_status_t(* app_disable_pd_port )(cy_stc_pdstack_context_t *ptrPdStackContext, cy_pdstack_dpm_typec_cmd_cbk_t cbk)
 Wrapper function for PD port disable. More...
 
uint8_t(* alt_mode_get_status )(cy_stc_pdstack_context_t *context)
 Handler to get the alt mode status. More...
 
void(* app_update_sys_pwr_state )(uint8_t state)
 Function updates the system power state. More...
 
bool(* set_custom_svid )(cy_stc_pdstack_context_t *context, uint16_t svid)
 Function sets the custom SVID value from HPI library. More...
 
void(* set_alt_mode_mask )(cy_stc_pdstack_context_t *context, uint16_t mask)
 Function sets the alt mode mask from HPI library. More...
 
bool(* app_vdm_layer_reset )(cy_stc_pdstack_context_t *ptrPdStackContext)
 Restarts the alternate mode layer. More...
 
bool(* eval_app_alt_mode_cmd )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *cmd, uint8_t *data)
 Function analyzes, parses, and run the alternate mode analysis function if the received command is a specific alt mode command. More...
 
bool(* eval_app_alt_hw_cmd )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *cmd_param)
 Function evaluates received application HW command. More...
 
bool(* set_custom_host_cap_control )(cy_stc_pdstack_context_t *context, uint8_t host_config)
 Handler to update the custom host capability. More...
 
bool(* app_set_custom_pid )(cy_stc_pdstack_context_t *context, uint16_t usb_pid)
 Stores the custom PID value in application status. More...
 
bool(* i2cm_gen_i2c_tunnel_cmd )(uint8_t *write_req_data, uint8_t *read_req_data)
 Handler for I2C read and write tunneling. More...
 
bool(* switch_vddd_supply )(cy_stc_pdstack_context_t *context, bool useVsys)
 Function switches the supply from VDDD to VSYS and vice versa. More...
 
uint8_t *(* vdm_get_disc_id_resp )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *resp_len_p)
 Obtain the last DISC_ID response received by the CCG device from a port partner. More...
 
uint8_t *(* vdm_get_disc_svid_resp )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *resp_len_p)
 Obtain the collective DISC_SVID response received by the CCG device from a port partner. More...
 
void(* app_update_bc_src_support )(uint8_t port, uint8_t enable)
 Function updates the BC 1.2 source support. More...
 
bool(* psnk_set_vbus_cfet_on_ctrl )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *ctrl_p)
 Function to handle Consumer FET control commands. More...
 
bool(* hpi_vconn_enable )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t channel)
 Function enables VCONN power. More...
 
void(* hpi_vconn_disable )(cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t channel)
 This function disables VCONN power. More...
 
cy_en_pdstack_status_t(* hpi_rw_pd_resp_data )(struct cy_stc_hpi_context *context, cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *data)
 This function handles the RW PD response data command. More...
 
uint16_t(* vbus_get_live_current )(cy_stc_pdstack_context_t *ptrPdStackContext)
 Function measures the live VBUS current. More...
 
void(* set_bootloader_run_type )(uint32_t runType)
 Function updates the current firmware run type status. More...
 
int8_t(* hpi_boot_validate_fw )(void *fw_addr)
 API validate the firmware and return the status. More...
 
int8_t(* hpi_boot_validate_fw_cmd )(uint8_t fw_mode)
 Function is used to validate the firmware image. More...
 
uint8_t(* hpi_sys_get_device_mode )(void)
 This function gets the current device mode. More...
 
int8_t(* hpi_flash_row_write )(uint16_t row_num, uint8_t *data, void *cbk)
 Writes the given data to the specified flash row. More...
 
int8_t(* hpi_flash_row_read )(uint16_t row_num, uint8_t *data)
 Read the contents of the specified flash row. More...
 
bool(* hpi_flash_access_get_status )(uint8_t modes)
 Check whether flashing mode has been entered. More...
 
void(* hpi_flash_enter_mode )(bool is_enable, uint8_t mode, bool data_in_place)
 Handle ENTER_FLASHING_MODE command. More...
 
void(* ucsi_notify )(struct cy_stc_hpi_context *context, uint8_t port, uint16_t notification)
 Function updates the UCSI notifications. More...
 
void(* ucsi_reg_space_write_handler )(struct cy_stc_hpi_context *context, uint8_t *hpi_buffer, uint16_t hpi_wr_count)
 Function handles the writes to the UCSI register space. More...
 
uint8_t(* ucsi_handle_hpi_commands )(struct cy_stc_hpi_context *context, uint8_t *cmd_param)
 Function handles the UCSI HPI commands. More...
 
void(* hpi_update_ucsi_reg_space )(struct cy_stc_hpi_context *context, uint16_t offset)
 This function updates the UCSI reg space. More...
 
bool(* hpi_dev_wr_handler_ext )(struct cy_stc_hpi_context *context, uint8_t cmdOpcode, uint8_t *cmdParam, uint8_t cmdLength, cy_en_hpi_status_t *stat, cy_en_hpi_response_t *code)
 Function handles the writes to the HPI Device register space. More...
 
bool(* hpi_port_wr_handler_ext )(struct cy_stc_hpi_context *context, uint8_t port, uint8_t cmdOpcode, uint8_t *cmdParam, uint8_t cmdLength, cy_en_hpi_status_t *stat, cy_en_hpi_response_t *code)
 Function handles the writes to the HPI Port register space. More...
 

Field Documentation

◆ ec_intr_write

void(* cy_stc_hpi_app_cbk_t::ec_intr_write) (bool value)

Handler to control the HPI EC interrupt pin.

◆ sys_get_custom_info_addr

uint32_t(* cy_stc_hpi_app_cbk_t::sys_get_custom_info_addr) (void)

Handler to get the alt mode status.

◆ hpi_is_event_enabled

bool(* cy_stc_hpi_app_cbk_t::hpi_is_event_enabled) (uint8_t port, uint8_t evCode, uint32_t evMask)

Function to check the HPI event enabled status.

◆ app_disable_pd_port

cy_en_pdstack_status_t(* cy_stc_hpi_app_cbk_t::app_disable_pd_port) (cy_stc_pdstack_context_t *ptrPdStackContext, cy_pdstack_dpm_typec_cmd_cbk_t cbk)

Wrapper function for PD port disable.

◆ alt_mode_get_status

uint8_t(* cy_stc_hpi_app_cbk_t::alt_mode_get_status) (cy_stc_pdstack_context_t *context)

Handler to get the alt mode status.

◆ app_update_sys_pwr_state

void(* cy_stc_hpi_app_cbk_t::app_update_sys_pwr_state) (uint8_t state)

Function updates the system power state.

◆ set_custom_svid

bool(* cy_stc_hpi_app_cbk_t::set_custom_svid) (cy_stc_pdstack_context_t *context, uint16_t svid)

Function sets the custom SVID value from HPI library.

◆ set_alt_mode_mask

void(* cy_stc_hpi_app_cbk_t::set_alt_mode_mask) (cy_stc_pdstack_context_t *context, uint16_t mask)

Function sets the alt mode mask from HPI library.

◆ app_vdm_layer_reset

bool(* cy_stc_hpi_app_cbk_t::app_vdm_layer_reset) (cy_stc_pdstack_context_t *ptrPdStackContext)

Restarts the alternate mode layer.

◆ eval_app_alt_mode_cmd

bool(* cy_stc_hpi_app_cbk_t::eval_app_alt_mode_cmd) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *cmd, uint8_t *data)

Function analyzes, parses, and run the alternate mode analysis function if the received command is a specific alt mode command.

◆ eval_app_alt_hw_cmd

bool(* cy_stc_hpi_app_cbk_t::eval_app_alt_hw_cmd) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *cmd_param)

Function evaluates received application HW command.

◆ set_custom_host_cap_control

bool(* cy_stc_hpi_app_cbk_t::set_custom_host_cap_control) (cy_stc_pdstack_context_t *context, uint8_t host_config)

Handler to update the custom host capability.

◆ app_set_custom_pid

bool(* cy_stc_hpi_app_cbk_t::app_set_custom_pid) (cy_stc_pdstack_context_t *context, uint16_t usb_pid)

Stores the custom PID value in application status.

◆ i2cm_gen_i2c_tunnel_cmd

bool(* cy_stc_hpi_app_cbk_t::i2cm_gen_i2c_tunnel_cmd) (uint8_t *write_req_data, uint8_t *read_req_data)

Handler for I2C read and write tunneling.

◆ switch_vddd_supply

bool(* cy_stc_hpi_app_cbk_t::switch_vddd_supply) (cy_stc_pdstack_context_t *context, bool useVsys)

Function switches the supply from VDDD to VSYS and vice versa.

◆ vdm_get_disc_id_resp

uint8_t*(* cy_stc_hpi_app_cbk_t::vdm_get_disc_id_resp) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *resp_len_p)

Obtain the last DISC_ID response received by the CCG device from a port partner.

◆ vdm_get_disc_svid_resp

uint8_t*(* cy_stc_hpi_app_cbk_t::vdm_get_disc_svid_resp) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *resp_len_p)

Obtain the collective DISC_SVID response received by the CCG device from a port partner.

◆ app_update_bc_src_support

void(* cy_stc_hpi_app_cbk_t::app_update_bc_src_support) (uint8_t port, uint8_t enable)

Function updates the BC 1.2 source support.

◆ psnk_set_vbus_cfet_on_ctrl

bool(* cy_stc_hpi_app_cbk_t::psnk_set_vbus_cfet_on_ctrl) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *ctrl_p)

Function to handle Consumer FET control commands.

◆ hpi_vconn_enable

bool(* cy_stc_hpi_app_cbk_t::hpi_vconn_enable) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t channel)

Function enables VCONN power.

◆ hpi_vconn_disable

void(* cy_stc_hpi_app_cbk_t::hpi_vconn_disable) (cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t channel)

This function disables VCONN power.

◆ hpi_rw_pd_resp_data

cy_en_pdstack_status_t(* cy_stc_hpi_app_cbk_t::hpi_rw_pd_resp_data) (struct cy_stc_hpi_context *context, cy_stc_pdstack_context_t *ptrPdStackContext, uint8_t *data)

This function handles the RW PD response data command.

◆ vbus_get_live_current

uint16_t(* cy_stc_hpi_app_cbk_t::vbus_get_live_current) (cy_stc_pdstack_context_t *ptrPdStackContext)

Function measures the live VBUS current.

◆ set_bootloader_run_type

void(* cy_stc_hpi_app_cbk_t::set_bootloader_run_type) (uint32_t runType)

Function updates the current firmware run type status.

◆ hpi_boot_validate_fw

int8_t(* cy_stc_hpi_app_cbk_t::hpi_boot_validate_fw) (void *fw_addr)

API validate the firmware and return the status.

◆ hpi_boot_validate_fw_cmd

int8_t(* cy_stc_hpi_app_cbk_t::hpi_boot_validate_fw_cmd) (uint8_t fw_mode)

Function is used to validate the firmware image.

◆ hpi_sys_get_device_mode

uint8_t(* cy_stc_hpi_app_cbk_t::hpi_sys_get_device_mode) (void)

This function gets the current device mode.

◆ hpi_flash_row_write

int8_t(* cy_stc_hpi_app_cbk_t::hpi_flash_row_write) (uint16_t row_num, uint8_t *data, void *cbk)

Writes the given data to the specified flash row.

◆ hpi_flash_row_read

int8_t(* cy_stc_hpi_app_cbk_t::hpi_flash_row_read) (uint16_t row_num, uint8_t *data)

Read the contents of the specified flash row.

◆ hpi_flash_access_get_status

bool(* cy_stc_hpi_app_cbk_t::hpi_flash_access_get_status) (uint8_t modes)

Check whether flashing mode has been entered.

◆ hpi_flash_enter_mode

void(* cy_stc_hpi_app_cbk_t::hpi_flash_enter_mode) (bool is_enable, uint8_t mode, bool data_in_place)

Handle ENTER_FLASHING_MODE command.

◆ ucsi_notify

void(* cy_stc_hpi_app_cbk_t::ucsi_notify) (struct cy_stc_hpi_context *context, uint8_t port, uint16_t notification)

Function updates the UCSI notifications.

◆ ucsi_reg_space_write_handler

void(* cy_stc_hpi_app_cbk_t::ucsi_reg_space_write_handler) (struct cy_stc_hpi_context *context, uint8_t *hpi_buffer, uint16_t hpi_wr_count)

Function handles the writes to the UCSI register space.

◆ ucsi_handle_hpi_commands

uint8_t(* cy_stc_hpi_app_cbk_t::ucsi_handle_hpi_commands) (struct cy_stc_hpi_context *context, uint8_t *cmd_param)

Function handles the UCSI HPI commands.

◆ hpi_update_ucsi_reg_space

void(* cy_stc_hpi_app_cbk_t::hpi_update_ucsi_reg_space) (struct cy_stc_hpi_context *context, uint16_t offset)

This function updates the UCSI reg space.

◆ hpi_dev_wr_handler_ext

bool(* cy_stc_hpi_app_cbk_t::hpi_dev_wr_handler_ext) (struct cy_stc_hpi_context *context, uint8_t cmdOpcode, uint8_t *cmdParam, uint8_t cmdLength, cy_en_hpi_status_t *stat, cy_en_hpi_response_t *code)

Function handles the writes to the HPI Device register space.

◆ hpi_port_wr_handler_ext

bool(* cy_stc_hpi_app_cbk_t::hpi_port_wr_handler_ext) (struct cy_stc_hpi_context *context, uint8_t port, uint8_t cmdOpcode, uint8_t *cmdParam, uint8_t cmdLength, cy_en_hpi_status_t *stat, cy_en_hpi_response_t *code)

Function handles the writes to the HPI Port register space.