| 
    Zephyr Project API
    3.3.0
    
   A Scalable Open Source RTOS 
   | 
 
USBC Type-C Port Controller device APIs. More...
#include <zephyr/types.h>#include <zephyr/device.h>#include <errno.h>#include "usbc_tc.h"#include "usbc_pd.h"Go to the source code of this file.
Data Structures | |
| struct | tcpc_chip_info | 
| TCPC Chip Information.  More... | |
| struct | tcpc_driver_api | 
Typedefs | |
| typedef int(* | tcpc_vconn_control_cb_t) (const struct device *dev, enum tc_cc_polarity pol, bool enable) | 
| typedef int(* | tcpc_vconn_discharge_cb_t) (const struct device *dev, enum tc_cc_polarity pol, bool enable) | 
| typedef void(* | tcpc_alert_handler_cb_t) (const struct device *dev, void *data, enum tcpc_alert alert) | 
Functions | |
| static int | tcpc_is_cc_rp (enum tc_cc_voltage_state cc) | 
| Returns whether the sink has detected a Rp resistor on the other side.  More... | |
| static int | tcpc_is_cc_open (enum tc_cc_voltage_state cc1, enum tc_cc_voltage_state cc2) | 
| Returns true if both CC lines are completely open.  More... | |
| static int | tcpc_is_cc_snk_dbg_acc (enum tc_cc_voltage_state cc1, enum tc_cc_voltage_state cc2) | 
| Returns true if we detect the port partner is a snk debug accessory.  More... | |
| static int | tcpc_is_cc_src_dbg_acc (enum tc_cc_voltage_state cc1, enum tc_cc_voltage_state cc2) | 
| Returns true if we detect the port partner is a src debug accessory.  More... | |
| static int | tcpc_is_cc_audio_acc (enum tc_cc_voltage_state cc1, enum tc_cc_voltage_state cc2) | 
| Returns true if the port partner is an audio accessory.  More... | |
| static int | tcpc_is_cc_at_least_one_rd (enum tc_cc_voltage_state cc1, enum tc_cc_voltage_state cc2) | 
| Returns true if the port partner is presenting at least one Rd.  More... | |
| static int | tcpc_is_cc_only_one_rd (enum tc_cc_voltage_state cc1, enum tc_cc_voltage_state cc2) | 
| Returns true if the port partner is presenting Rd on only one CC line.  More... | |
| static int | tcpc_init (const struct device *dev) | 
| Initializes the TCPC.  More... | |
| static int | tcpc_get_cc (const struct device *dev, enum tc_cc_voltage_state *cc1, enum tc_cc_voltage_state *cc2) | 
| Reads the status of the CC lines.  More... | |
| static int | tcpc_select_rp_value (const struct device *dev, enum tc_rp_value rp) | 
| Sets the value of CC pull up resistor used when operating as a Source.  More... | |
| static int | tcpc_get_rp_value (const struct device *dev, enum tc_rp_value *rp) | 
| Gets the value of the CC pull up resistor used when operating as a Source.  More... | |
| static int | tcpc_set_cc (const struct device *dev, enum tc_cc_pull pull) | 
| Sets the CC pull resistor and sets the role as either Source or Sink.  More... | |
| static void | tcpc_set_vconn_cb (const struct device *dev, tcpc_vconn_control_cb_t vconn_cb) | 
| Sets a callback that can enable or disable VCONN if the TCPC is unable to or the system is configured in a way that does not use the VCONN control capabilities of the TCPC.  More... | |
| static void | tcpc_set_vconn_discharge_cb (const struct device *dev, tcpc_vconn_discharge_cb_t cb) | 
| Sets a callback that can enable or discharge VCONN if the TCPC is unable to or the system is configured in a way that does not use the VCONN control capabilities of the TCPC.  More... | |
| static int | tcpc_vconn_discharge (const struct device *dev, bool enable) | 
| Discharges VCONN.  More... | |
| static int | tcpc_set_vconn (const struct device *dev, bool enable) | 
| Enables or disables VCONN.  More... | |
| static int | tcpc_set_roles (const struct device *dev, enum tc_power_role power_role, enum tc_data_role data_role) | 
| Sets the Power and Data Role of the PD message header.  More... | |
| static bool | tcpc_is_rx_pending_msg (const struct device *dev, enum pd_packet_type *type) | 
| Tests if a received Power Delivery message is pending.  More... | |
| static int | tcpc_receive_data (const struct device *dev, struct pd_msg *buf) | 
| Retrieves the Power Delivery message from the TCPC.  More... | |
| static int | tcpc_set_rx_enable (const struct device *dev, bool enable) | 
| Enables the reception of SOP* message types.  More... | |
| static int | tcpc_set_cc_polarity (const struct device *dev, enum tc_cc_polarity polarity) | 
| Sets the polarity of the CC lines.  More... | |
| static int | tcpc_transmit_data (const struct device *dev, struct pd_msg *msg) | 
| Transmits a Power Delivery message.  More... | |
| static int | tcpc_dump_std_reg (const struct device *dev) | 
| Dump a set of TCPC registers.  More... | |
| static int | tcpc_set_alert_handler_cb (const struct device *dev, tcpc_alert_handler_cb_t handler, void *data) | 
| Sets the alert function that's called when an interrupt is triggered due to an alert bit.  More... | |
| static int | tcpc_get_status_register (const struct device *dev, enum tcpc_status_reg reg, int32_t *status) | 
| Gets a status register.  More... | |
| static int | tcpc_clear_status_register (const struct device *dev, enum tcpc_status_reg reg, uint32_t mask) | 
| Clears a TCPC status register.  More... | |
| static int | tcpc_mask_status_register (const struct device *dev, enum tcpc_status_reg reg, uint32_t mask) | 
| Sets the mask of a TCPC status register.  More... | |
| static int | tcpc_set_debug_accessory (const struct device *dev, bool enable) | 
| Manual control of TCPC DebugAccessory control.  More... | |
| static int | tcpc_set_debug_detach (const struct device *dev) | 
| Detach from a debug connection.  More... | |
| static int | tcpc_set_drp_toggle (const struct device *dev, bool enable) | 
| Enable TCPC auto dual role toggle.  More... | |
| static bool | tcpc_get_snk_ctrl (const struct device *dev) | 
| Queries the current sinking state of the TCPC.  More... | |
| static bool | tcpc_get_src_ctrl (const struct device *dev) | 
| Queries the current sourcing state of the TCPC.  More... | |
| static int | tcpc_set_bist_test_mode (const struct device *dev, bool enable) | 
| Controls the BIST Mode of the TCPC. It disables RX alerts while the mode is active.  More... | |
| static int | tcpc_get_chip_info (const struct device *dev, struct tcpc_chip_info *chip_info) | 
| Gets the TCPC firmware version.  More... | |
| static int | tcpc_set_low_power_mode (const struct device *dev, bool enable) | 
| Instructs the TCPC to enter or exit low power mode.  More... | |
| static int | tcpc_sop_prime_enable (const struct device *dev, bool enable) | 
| Enables the reception of SOP Prime messages.  More... | |
USBC Type-C Port Controller device APIs.
This file contains the USB Type-C Port Controller device APIs. All Type-C Port Controller device drivers should implement the APIs described in this file.