Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
USB-C Device APIs . More...
Topics | |
Sink_callbacks | |
Source_callbacks | |
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. | |
Functions | |
int | usbc_start (const struct device *dev) |
Start the USB-C Subsystem. | |
int | usbc_suspend (const struct device *dev) |
Suspend the USB-C Subsystem. | |
int | usbc_request (const struct device *dev, const enum usbc_policy_request_t req) |
Make a request of the USB-C Subsystem. | |
void | usbc_bypass_next_sleep (const struct device *dev) |
void | usbc_set_dpm_data (const struct device *dev, void *dpm_data) |
Set pointer to Device Policy Manager (DPM) data. | |
void * | usbc_get_dpm_data (const struct device *dev) |
Get pointer to Device Policy Manager (DPM) data. | |
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_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_check (const struct device *dev, const policy_cb_check_t cb) |
Set the callback used to check a policy. | |
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_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_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_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. | |
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_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. | |
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_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_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_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_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_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. | |
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_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. | |
USB-C Device APIs .
#define FIXED_5V_100MA_RDO 0x1100280a |
#include <zephyr/usb_c/usbc.h>
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.
The RDO is configured as follows: Maximum operating current 100mA Operating current 100mA Unchunked Extended Messages Not Supported No USB Suspend Not USB Communications Capable No capability mismatch Don't giveback Object position 1 (5V PDO)
enum usbc_policy_check_t |
#include <zephyr/usb_c/usbc.h>
Device Policy Manager checks.
enum usbc_policy_notify_t |
#include <zephyr/usb_c/usbc.h>
Device Policy Manager notifications.
#include <zephyr/usb_c/usbc.h>
Device Policy Manager requests.
enum usbc_policy_wait_t |
#include <zephyr/usb_c/usbc.h>
Device Policy Manager Wait message notifications.
enum usbc_snk_req_reply_t |
#include <zephyr/usb_c/usbc.h>
Device Policy Manager's response to a Sink Request.
void usbc_bypass_next_sleep | ( | const struct device * | dev | ) |
#include <zephyr/usb_c/usbc.h>
void * usbc_get_dpm_data | ( | const struct device * | dev | ) |
#include <zephyr/usb_c/usbc.h>
Get pointer to Device Policy Manager (DPM) data.
dev | Runtime device structure |
pointer | to dpm data that was set with usbc_set_dpm_data |
NULL | if dpm data was not set |
int usbc_request | ( | const struct device * | dev, |
const enum usbc_policy_request_t | req ) |
#include <zephyr/usb_c/usbc.h>
Make a request of the USB-C Subsystem.
dev | Runtime device structure |
req | request |
0 | on success |
void usbc_set_dpm_data | ( | const struct device * | dev, |
void * | dpm_data ) |
#include <zephyr/usb_c/usbc.h>
Set pointer to Device Policy Manager (DPM) data.
dev | Runtime device structure |
dpm_data | pointer to dpm data |
void usbc_set_policy_cb_change_src_caps | ( | const struct device * | dev, |
const policy_cb_change_src_caps_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to request that a different set of Source Caps be sent to the Sink.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_check | ( | const struct device * | dev, |
const policy_cb_check_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to check a policy.
dev | Runtime device structure |
cb | callback |
void usbc_set_policy_cb_check_sink_request | ( | const struct device * | dev, |
const policy_cb_check_sink_request_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to check if Sink request is valid.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_get_rdo | ( | const struct device * | dev, |
const policy_cb_get_rdo_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to get the Request Data Object (RDO)
dev | Runtime device structure |
cb | callback |
void usbc_set_policy_cb_get_snk_cap | ( | const struct device * | dev, |
const policy_cb_get_snk_cap_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to get the Sink Capabilities.
dev | Runtime device structure |
cb | callback |
void usbc_set_policy_cb_get_src_caps | ( | const struct device * | dev, |
const policy_cb_get_src_caps_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to get the Source Capabilities from the Device Policy Manager.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_get_src_rp | ( | const struct device * | dev, |
const policy_cb_get_src_rp_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to get the Rp value that should be placed on the CC lines.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_is_ps_ready | ( | const struct device * | dev, |
const policy_cb_is_ps_ready_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to check if Source Power Supply is ready.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_is_snk_at_default | ( | const struct device * | dev, |
const policy_cb_is_snk_at_default_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to check if the sink power supply is at the default level.
dev | Runtime device structure |
cb | callback |
void usbc_set_policy_cb_notify | ( | const struct device * | dev, |
const policy_cb_notify_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to notify Device Policy Manager of a policy change.
dev | Runtime device structure |
cb | callback |
void usbc_set_policy_cb_present_contract_is_valid | ( | const struct device * | dev, |
const policy_cb_present_contract_is_valid_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback to check if present Contract is still valid.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_set_port_partner_snk_cap | ( | const struct device * | dev, |
const policy_cb_set_port_partner_snk_cap_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to store the Capabilities received from a Sink Port Partner.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_set_src_cap | ( | const struct device * | dev, |
const policy_cb_set_src_cap_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to store the received Port Partner's Source Capabilities.
dev | Runtime device structure |
cb | callback |
void usbc_set_policy_cb_src_en | ( | const struct device * | dev, |
const policy_cb_src_en_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to enable VBUS.
dev | USB-C Connector Instance |
cb | callback |
void usbc_set_policy_cb_wait_notify | ( | const struct device * | dev, |
const policy_cb_wait_notify_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to notify Device Policy Manager of WAIT message reception.
dev | Runtime device structure |
cb | callback |
void usbc_set_vconn_control_cb | ( | const struct device * | dev, |
const tcpc_vconn_control_cb_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to set VCONN control.
dev | Runtime device structure |
cb | VCONN control callback |
void usbc_set_vconn_discharge_cb | ( | const struct device * | dev, |
const tcpc_vconn_discharge_cb_t | cb ) |
#include <zephyr/usb_c/usbc.h>
Set the callback used to discharge VCONN.
dev | Runtime device structure |
cb | VCONN discharge callback |
int usbc_start | ( | const struct device * | dev | ) |
#include <zephyr/usb_c/usbc.h>
Start the USB-C Subsystem.
dev | Runtime device structure |
0 | on success |
int usbc_suspend | ( | const struct device * | dev | ) |
#include <zephyr/usb_c/usbc.h>
Suspend the USB-C Subsystem.
dev | Runtime device structure |
0 | on success |