PDStack Middleware Library
Data structures

General Description

Describes the data structures defined by the PDStack.

Data Structures

union  cy_pdstack_extd_hdr_t
 Union to hold the PD extended header. More...
 
struct  cy_pdstack_extd_hdr_t::EXTD_HDR_T
 Extended header broken down into respective fields. More...
 
struct  cy_stc_pdstack_pd_power_status_t
 PD port status corresponding to the Status Data Block (SSDB) See Table 6-39 of USB PD R3 specification. More...
 
union  cy_stc_pdstack_pd_port_status_ec_t
 PD port status as reported to the embedded controller. More...
 
struct  cy_stc_pdstack_pd_port_status_ec_t::PD_PORT_STAT
 Structure containing status bits. More...
 
struct  app_resp_t
 Struct to hold response to policy manager. More...
 
struct  vdm_resp_t
 Struct to hold response to policy manager. More...
 
struct  cy_stc_pdstack_dpm_pd_cmd_buf_t
 Struct to hold PD command buffer. More...
 
struct  cy_stc_pdstack_contract_t
 Structure to hold PD contract information. More...
 
struct  cy_stc_pdstack_pd_contract_info_t
 Structure to hold PD contract information passed with APP_EVT_PD_CONTRACT_NEGOTIATION_COMPLETE event to the application. More...
 
struct  cy_stc_pdstack_pd_packet_t
 Struct to hold a PD packet. More...
 
struct  cy_stc_pdstack_pd_timer_params_t
 Structure that encapsulates different timing parameters, therefore, they can be updated by a single API. More...
 
struct  cy_stc_pdstack_app_cbk_t
 Struct to hold the application interface. More...
 
struct  cy_stc_pdstack_epr_t
 Extended Power Range structure. More...
 
struct  cy_stc_pdstack_dpm_status_t
 PD device policy status structure. More...
 
struct  cy_stc_pdstack_dpm_ext_status_t
 PD device latest policy status structure. More...
 
struct  cy_stc_pdstack_typec_status_t
 Type-C manager status structure. More...
 
struct  cy_stc_pdstack_prl_cntrs_t
 Structure to hold PD protocol message IDs and flags. More...
 
struct  cy_stc_pdstack_pd_status_t
 Structure to hold protocol layer status. More...
 
struct  cy_stc_pdstack_pe_status_t
 Structure to hold the policy engine status. More...
 
struct  cy_stc_pdstack_dpm_params_t
 Structure to hold device policy manager parameters. More...
 
struct  cy_stc_pdstack_rtos_context_t
 Structure to hold the RTOS interface. More...
 
struct  cy_stc_pdstack_context_t
 Structure to PDSTACK middleware context information. More...
 
struct  cy_pd_stack_conf_t
 Structure used to fetch the PD stack configuration supported by the library that is currently in use. More...
 
struct  cy_stc_pdstack_app_status_t
 Structure used by altmode and application layers for VDM related information. More...
 
struct  cy_stc_pdstack_port_cfg_t
 Structure to hold PDStack middleware configuration information. More...
 

Typedefs

typedef void(* cy_pdstack_pd_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, uint32_t event)
 PD callback prototype. More...
 
typedef void(* cy_pdstack_dpm_pd_cmd_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, cy_en_pdstack_resp_status_t resp, const cy_stc_pdstack_pd_packet_t *pkt_ptr)
 DPM PD command callback. More...
 
typedef void(* cy_pdstack_app_resp_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, app_resp_t *resp)
 Application response callback. More...
 
typedef void(* cy_pdstack_vdm_resp_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, vdm_resp_t *resp)
 VDM response callback. More...
 
typedef void(* cy_pdstack_pwr_ready_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext)
 Power ready callback. More...
 
typedef void(* cy_pdstack_sink_discharge_off_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext)
 Sink discharge off callback. More...
 
typedef void(* cy_pdstack_dpm_typec_cmd_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, cy_en_pdstack_dpm_typec_cmd_resp_t resp)
 Type C command response callback. More...
 

Enumerations

enum  cy_en_pdstack_pwr_led_t {
  CY_PDSTACK_LED_OFF = 0UL,
  CY_PDSTACK_LED_ON,
  CY_PDSTACK_LED_BLINKING,
  CY_PDSTACK_LED_BREATHING
}
 Enum of the power LED States.
 
enum  pe_fsm_evt_t {
  CY_PDSTACK_PE_FSM_EVT_HARD_RESET_RCVD = 0,
  CY_PDSTACK_PE_FSM_EVT_SOFT_RESET_RCVD,
  CY_PDSTACK_PE_FSM_EVT_ENTRY,
  CY_PDSTACK_PE_FSM_EVT_TX_SUCCESS,
  CY_PDSTACK_PE_FSM_EVT_TX_DISCARDED,
  CY_PDSTACK_PE_FSM_EVT_TX_FAIL,
  CY_PDSTACK_PE_FSM_EVT_PKT_RCVD,
  CY_PDSTACK_PE_FSM_EVT_PWR_RDY,
  CY_PDSTACK_PE_FSM_EVT_TIMEOUT,
  CY_PDSTACK_PE_FSM_EVT_DPM_CMD_RCVD,
  CY_PDSTACK_PE_FSM_EVT_APP_RESP_RCVD,
  CY_PDSTACK_PE_FSM_EVT_VDM_RESP_RCVD,
  CY_PDSTACK_PE_FSM_EVT_CABLE_TIMEOUT,
  CY_PDSTACK_PE_FSM_EVT_NO_RESP_TIMEOUT,
  CY_PDSTACK_PE_FSM_EVT_FR_SIGNAL_RCVD,
  CY_PDSTACK_PE_FSM_EVT_FR_SIGNAL_SENT,
  CY_PDSTACK_PE_FSM_EVT_PPS_TIMEOUT,
  CY_PDSTACK_PE_FSM_EVT_CRC_ERROR,
  CY_PDSTACK_PE_FSM_EVT_DRST_COMPLETE,
  CY_PDSTACK_PE_FSM_PE_MAX_EVTS
}
 Enum to hold Policy engine events id.
 
enum  typec_fsm_evt_t {
  CY_PDSTACK_TYPEC_FSM_EVT_ERR_RECOVERY = 0,
  CY_PDSTACK_TYPEC_FSM_EVT_ENTRY,
  CY_PDSTACK_TYPEC_FSM_EVT_DETACH,
  CY_PDSTACK_TYPEC_FSM_EVT_ATTACH,
  CY_PDSTACK_TYPEC_FSM_EVT_PWR_RDY,
  CY_PDSTACK_TYPEC_FSM_EVT_TIMEOUT1,
  CY_PDSTACK_TYPEC_FSM_EVT_TIMEOUT2,
  CY_PDSTACK_TYPEC_FSM_EVT_DPM_COMMAND,
  CY_PDSTACK_TYPEC_FSM_MAX_EVTS
}
 Enum to hold Type-C events ID.
 

Typedef Documentation

◆ cy_pdstack_pd_cbk_t

typedef void(* cy_pdstack_pd_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, uint32_t event)

PD callback prototype.

This is a stack internal callback function used by the USB PD protocol layer to send events to the policy engine. The events notified correspond to policy engine events such as hard reset or soft reset received.

Parameters
ptrPdStackContextPdStack library context pointer.
Typeof event being notified.

◆ cy_pdstack_dpm_pd_cmd_cbk_t

typedef void(* cy_pdstack_dpm_pd_cmd_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, cy_en_pdstack_resp_status_t resp, const cy_stc_pdstack_pd_packet_t *pkt_ptr)

DPM PD command callback.

This is the type of callback function used by the policy engine to report the results of a command to the application layer.

Parameters
portPD port index.
respResponse code.
pkt_ptrPointer to any PD packet associated with the response.

◆ cy_pdstack_app_resp_cbk_t

typedef void(* cy_pdstack_app_resp_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, app_resp_t *resp)

Application response callback.

This is the type of callback used by the stack to receive application-level responses associated with a PD message such as a SWAP request.

Parameters
portPD port index.
respPointer to the structure holding response information.

◆ cy_pdstack_vdm_resp_cbk_t

typedef void(* cy_pdstack_vdm_resp_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, vdm_resp_t *resp)

VDM response callback.

This is the type of callback used by the stack to receive application-level responses to a VDM received from the port partner or cable marker.

Parameters
portPD port index.
respPointer to the structure holding response information.

◆ cy_pdstack_pwr_ready_cbk_t

typedef void(* cy_pdstack_pwr_ready_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext)

Power ready callback.

Type of callback used by the stack to receive notification from the power source/sink hardware manager that the requested power transition has been completed.

Parameters
portPD port index.

◆ cy_pdstack_sink_discharge_off_cbk_t

typedef void(* cy_pdstack_sink_discharge_off_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext)

Sink discharge off callback.

Callback type used by the stack to receive notification that the sink discharge circuit has been turned OFF.

Parameters
portPD port index.

◆ cy_pdstack_dpm_typec_cmd_cbk_t

typedef void(* cy_pdstack_dpm_typec_cmd_cbk_t) (struct cy_stc_pdstack_context *ptrPdStackContext, cy_en_pdstack_dpm_typec_cmd_resp_t resp)

Type C command response callback.

Type of callback used by the stack to report results of a dpm_typec_command API call to the application layer.

Parameters
portPD port index.
respResponse code.