13#ifndef ZEPHYR_INCLUDE_USBC_H_ 
   14#define ZEPHYR_INCLUDE_USBC_H_ 
   46#define FIXED_5V_100MA_RDO 0x1100280a 
int usbc_start(const struct device *dev)
Start the USB-C Subsystem.
 
usbc_policy_request_t
Device Policy Manager requests.
Definition: usbc.h:51
 
int usbc_request(const struct device *dev, const enum usbc_policy_request_t req)
Make a request of the USB-C Subsystem.
 
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.
 
usbc_snk_req_reply_t
Device Policy Manager's response to a Sink Request.
Definition: usbc.h:163
 
void usbc_set_policy_cb_present_contract_is_valid(const struct device *dev, const policy_cb_present_contract_is_valid_t cb)
Set the callback to check if present Contract is still valid.
 
usbc_policy_notify_t
Device Policy Manager notifications.
Definition: usbc.h:87
 
void usbc_set_policy_cb_check(const struct device *dev, const policy_cb_check_t cb)
Set the callback used to check a policy.
 
int usbc_suspend(const struct device *dev)
Suspend the USB-C Subsystem.
 
void usbc_set_policy_cb_get_src_caps(const struct device *dev, const policy_cb_get_src_caps_t cb)
Set the callback used to get the Source Capabilities from the Device Policy Manager.
 
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)
 
void usbc_set_policy_cb_check_sink_request(const struct device *dev, const policy_cb_check_sink_request_t cb)
Set the callback used to check if Sink request is valid.
 
void usbc_set_vconn_discharge_cb(const struct device *dev, const tcpc_vconn_discharge_cb_t cb)
Set the callback used to discharge VCONN.
 
void usbc_set_policy_cb_get_src_rp(const struct device *dev, const policy_cb_get_src_rp_t cb)
Set the callback used to get the Rp value that should be placed on the CC lines.
 
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.
 
void usbc_set_dpm_data(const struct device *dev, void *dpm_data)
Set pointer to Device Policy Manager (DPM) data.
 
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.
 
void usbc_set_policy_cb_change_src_caps(const struct device *dev, const policy_cb_change_src_caps_t cb)
Set the callback used to request that a different set of Source Caps be sent to the Sink.
 
void * usbc_get_dpm_data(const struct device *dev)
Get pointer to Device Policy Manager (DPM) data.
 
usbc_policy_wait_t
Device Policy Manager Wait message notifications.
Definition: usbc.h:149
 
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.
 
void usbc_set_policy_cb_is_ps_ready(const struct device *dev, const policy_cb_is_ps_ready_t cb)
Set the callback used to check if Source Power Supply is ready.
 
void usbc_set_policy_cb_src_en(const struct device *dev, const policy_cb_src_en_t cb)
Set the callback used to enable VBUS.
 
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.
 
void usbc_set_policy_cb_set_port_partner_snk_cap(const struct device *dev, const policy_cb_set_port_partner_snk_cap_t cb)
Set the callback used to store the Capabilities received from a Sink Port Partner.
 
usbc_policy_check_t
Device Policy Manager checks.
Definition: usbc.h:131
 
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.
 
@ REQUEST_TC_END
Definition: usbc.h:59
 
@ REQUEST_PE_DR_SWAP
Definition: usbc.h:62
 
@ REQUEST_NOP
Definition: usbc.h:53
 
@ REQUEST_PE_HARD_RESET_SEND
Definition: usbc.h:64
 
@ REQUEST_TC_DISABLED
Definition: usbc.h:55
 
@ REQUEST_TC_ERROR_RECOVERY
Definition: usbc.h:57
 
@ REQUEST_PE_GET_SRC_CAPS
Definition: usbc.h:71
 
@ REQUEST_PE_SOFT_RESET_SEND
Definition: usbc.h:66
 
@ REQUEST_GET_SNK_CAPS
Definition: usbc.h:76
 
@ REQUEST_PE_GOTO_MIN
Definition: usbc.h:81
 
@ SNK_REQUEST_REJECT
Definition: usbc.h:167
 
@ SNK_REQUEST_VALID
Definition: usbc.h:165
 
@ SNK_REQUEST_WAIT
Definition: usbc.h:169
 
@ SOURCE_CAPABILITIES_RECEIVED
Definition: usbc.h:125
 
@ POWER_CHANGE_0A0
Definition: usbc.h:115
 
@ POWER_CHANGE_1A5
Definition: usbc.h:119
 
@ POWER_CHANGE_3A0
Definition: usbc.h:121
 
@ TRANSITION_PS
Definition: usbc.h:105
 
@ POWER_CHANGE_DEF
Definition: usbc.h:117
 
@ DATA_ROLE_IS_UFP
Definition: usbc.h:97
 
@ MSG_ACCEPT_RECEIVED
Definition: usbc.h:89
 
@ MSG_REJECTED_RECEIVED
Definition: usbc.h:91
 
@ DATA_ROLE_IS_DFP
Definition: usbc.h:99
 
@ PROTOCOL_ERROR
Definition: usbc.h:109
 
@ SNK_TRANSITION_TO_DEFAULT
Definition: usbc.h:111
 
@ MSG_DISCARDED
Definition: usbc.h:93
 
@ MSG_NOT_SUPPORTED_RECEIVED
Definition: usbc.h:95
 
@ HARD_RESET_RECEIVED
Definition: usbc.h:113
 
@ SENDER_RESPONSE_TIMEOUT
Definition: usbc.h:123
 
@ PORT_PARTNER_NOT_RESPONSIVE
Definition: usbc.h:107
 
@ PD_CONNECTED
Definition: usbc.h:101
 
@ NOT_PD_CONNECTED
Definition: usbc.h:103
 
@ WAIT_SINK_REQUEST
Definition: usbc.h:151
 
@ WAIT_POWER_ROLE_SWAP
Definition: usbc.h:153
 
@ WAIT_VCONN_SWAP
Definition: usbc.h:157
 
@ WAIT_DATA_ROLE_SWAP
Definition: usbc.h:155
 
@ CHECK_POWER_ROLE_SWAP
Definition: usbc.h:133
 
@ CHECK_SNK_AT_DEFAULT_LEVEL
Definition: usbc.h:139
 
@ CHECK_SRC_PS_AT_DEFAULT_LEVEL
Definition: usbc.h:143
 
@ CHECK_VCONN_CONTROL
Definition: usbc.h:141
 
@ CHECK_DATA_ROLE_SWAP_TO_UFP
Definition: usbc.h:137
 
@ CHECK_DATA_ROLE_SWAP_TO_DFP
Definition: usbc.h:135
 
static __pinned_data struct init_record * rp
Definition: main.c:146
 
bool(* policy_cb_is_snk_at_default_t)(const struct device *dev)
Callback type used to check if the sink power supply is at the default level.
Definition: usbc.h:241
 
bool(* policy_cb_check_t)(const struct device *dev, const enum usbc_policy_check_t policy_check)
Callback type used to check a policy.
Definition: usbc.h:202
 
void(* policy_cb_notify_t)(const struct device *dev, const enum usbc_policy_notify_t policy_notify)
Callback type used to notify Device Policy Manager of a policy change.
Definition: usbc.h:223
 
void(* policy_cb_set_src_cap_t)(const struct device *dev, const uint32_t *pdos, const int num_pdos)
Callback type used to report the received Port Partner's Source Capabilities.
Definition: usbc.h:192
 
int(* policy_cb_get_snk_cap_t)(const struct device *dev, uint32_t **pdos, int *num_pdos)
Callback type used to get the Sink Capabilities.
Definition: usbc.h:183
 
uint32_t(* policy_cb_get_rdo_t)(const struct device *dev)
Callback type used to get the Request Data Object (RDO)
Definition: usbc.h:232
 
bool(* policy_cb_wait_notify_t)(const struct device *dev, const enum usbc_policy_wait_t wait_notify)
Callback type used to notify Device Policy Manager of WAIT message reception.
Definition: usbc.h:213
 
bool(* policy_cb_present_contract_is_valid_t)(const struct device *dev, const uint32_t present_contract)
Callback type used to check if present Contract is still valid.
Definition: usbc.h:284
 
int(* policy_cb_get_src_caps_t)(const struct device *dev, const uint32_t **pdos, uint32_t *num_pdos)
Callback type used to get the Source Capabilities from the Device Policy Manager.
Definition: usbc.h:256
 
bool(* policy_cb_change_src_caps_t)(const struct device *dev)
Callback type used to request that a different set of Source Caps be sent to the Sink.
Definition: usbc.h:294
 
int(* policy_cb_get_src_rp_t)(const struct device *dev, enum tc_rp_value *rp)
Callback type used to get the Rp value that should be placed on the CC lines.
Definition: usbc.h:314
 
int(* policy_cb_src_en_t)(const struct device *dev, bool en)
Callback type used to enable VBUS.
Definition: usbc.h:322
 
bool(* policy_cb_is_ps_ready_t)(const struct device *dev)
Callback type used to check if Source Power Supply is ready.
Definition: usbc.h:275
 
void(* policy_cb_set_port_partner_snk_cap_t)(const struct device *dev, const uint32_t *pdos, const int num_pdos)
Callback type used to report the Capabilities received from a Sink Port Partner.
Definition: usbc.h:304
 
enum usbc_snk_req_reply_t(* policy_cb_check_sink_request_t)(const struct device *dev, const uint32_t request_msg)
Callback type used to check if Sink request is valid.
Definition: usbc.h:266
 
int(* tcpc_vconn_discharge_cb_t)(const struct device *dev, enum tc_cc_polarity pol, bool enable)
Definition: usbc_tcpc.h:121
 
int(* tcpc_vconn_control_cb_t)(const struct device *dev, enum tc_cc_polarity pol, bool enable)
Definition: usbc_tcpc.h:119
 
tc_rp_value
Pull-Up resistor values.
Definition: usbc_tc.h:338
 
#define bool
Definition: stdbool.h:13
 
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
 
Runtime device structure (in ROM) per driver instance.
Definition: device.h:380
 
USBC Type-C Port Controller device APIs.