Zephyr Project API  3.3.0
A Scalable Open Source RTOS
usbc.h File Reference

USB-C Device APIs. More...

Go to the source code of this file.

Macros

#define FIXED_5V_100MA_RDO   0x1100280a
 This Request Data Object (RDO) value can be returned from the policy_cb_get_rdo if 5V@100mA with the following options are sufficient for the Sink to operate. More...
 

Enumerations

enum  usbc_policy_request_t {
  REQUEST_NOP , REQUEST_TC_DISABLED , REQUEST_TC_ERROR_RECOVERY , REQUEST_TC_END ,
  REQUEST_PE_DR_SWAP , REQUEST_PE_HARD_RESET_SEND , REQUEST_PE_SOFT_RESET_SEND , REQUEST_PE_GET_SRC_CAPS
}
 Device Policy Manager requests. More...
 
enum  usbc_policy_notify_t {
  MSG_ACCEPT_RECEIVED , MSG_REJECTED_RECEIVED , MSG_DISCARDED , MSG_NOT_SUPPORTED_RECEIVED ,
  DATA_ROLE_IS_UFP , DATA_ROLE_IS_DFP , PD_CONNECTED , NOT_PD_CONNECTED ,
  TRANSITION_PS , PORT_PARTNER_NOT_RESPONSIVE , PROTOCOL_ERROR , SNK_TRANSITION_TO_DEFAULT ,
  HARD_RESET_RECEIVED , POWER_CHANGE_0A0 , POWER_CHANGE_DEF , POWER_CHANGE_1A5 ,
  POWER_CHANGE_3A0 , SENDER_RESPONSE_TIMEOUT , SOURCE_CAPABILITIES_RECEIVED
}
 Device Policy Manager notifications. More...
 
enum  usbc_policy_check_t {
  CHECK_POWER_ROLE_SWAP , CHECK_DATA_ROLE_SWAP_TO_DFP , CHECK_DATA_ROLE_SWAP_TO_UFP , CHECK_SNK_AT_DEFAULT_LEVEL ,
  CHECK_VCONN_CONTROL
}
 Device Policy Manager checks. More...
 
enum  usbc_policy_wait_t { WAIT_SINK_REQUEST , WAIT_POWER_ROLE_SWAP , WAIT_DATA_ROLE_SWAP , WAIT_VCONN_SWAP }
 Device Policy Manager Wait message notifications. More...
 

Functions

int usbc_start (const struct device *dev)
 Start the USB-C Subsystem. More...
 
int usbc_suspend (const struct device *dev)
 Suspend the USB-C Subsystem. More...
 
int usbc_request (const struct device *dev, const enum usbc_policy_request_t req)
 Make a request of the USB-C Subsystem. More...
 
void usbc_set_dpm_data (const struct device *dev, void *dpm_data)
 Set pointer to Device Policy Manager (DPM) data. More...
 
void * usbc_get_dpm_data (const struct device *dev)
 Get pointer to Device Policy Manager (DPM) data. More...
 
void usbc_set_vconn_control_cb (const struct device *dev, const tcpc_vconn_control_cb_t cb)
 Set the callback used to set VCONN control. More...
 
void usbc_set_vconn_discharge_cb (const struct device *dev, const tcpc_vconn_discharge_cb_t cb)
 Set the callback used to discharge VCONN. More...
 
void usbc_set_policy_cb_check (const struct device *dev, const policy_cb_check_t cb)
 Set the callback used to check a policy. More...
 
void usbc_set_policy_cb_notify (const struct device *dev, const policy_cb_notify_t cb)
 Set the callback used to notify Device Policy Manager of a policy change. More...
 
void usbc_set_policy_cb_wait_notify (const struct device *dev, const policy_cb_wait_notify_t cb)
 Set the callback used to notify Device Policy Manager of WAIT message reception. More...
 
void usbc_set_policy_cb_get_snk_cap (const struct device *dev, const policy_cb_get_snk_cap_t cb)
 Set the callback used to get the Sink Capabilities. More...
 
void usbc_set_policy_cb_set_src_cap (const struct device *dev, const policy_cb_set_src_cap_t cb)
 Set the callback used to store the received Port Partner's Source Capabilities. More...
 
void usbc_set_policy_cb_get_rdo (const struct device *dev, const policy_cb_get_rdo_t cb)
 Set the callback used to get the Request Data Object (RDO) More...
 
void usbc_set_policy_cb_is_snk_at_default (const struct device *dev, const policy_cb_is_snk_at_default_t cb)
 Set the callback used to check if the sink power supply is at the default level. More...
 

Detailed Description

USB-C Device APIs.

This file contains the USB-C Device APIs.