Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB Type-C Port Controller Driver Backend API

Data Structures

struct  tcpc_driver_api
  Driver Operations USB Type-C Port Controller driver operations More...

Typedefs

typedef int(* tcpc_api_init_t) (const struct device *dev)
 Callback API to initialize the TCPC.
typedef int(* tcpc_api_get_cc_t) (const struct device *dev, enum tc_cc_voltage_state *cc1, enum tc_cc_voltage_state *cc2)
 Callback API to read CC line status.
typedef int(* tcpc_api_select_rp_value_t) (const struct device *dev, enum tc_rp_value rp)
 Callback API to set source Rp value.
typedef int(* tcpc_api_get_rp_value_t) (const struct device *dev, enum tc_rp_value *rp)
 Callback API to get source Rp value.
typedef int(* tcpc_api_set_cc_t) (const struct device *dev, enum tc_cc_pull pull)
 Callback API to set CC pull and role.
typedef void(* tcpc_api_set_vconn_discharge_cb_t) (const struct device *dev, tcpc_vconn_discharge_cb_t cb, const struct device *usbc_dev)
 Callback API to register the VCONN discharge application callback.
typedef void(* tcpc_api_set_vconn_cb_t) (const struct device *dev, tcpc_vconn_control_cb_t vconn_cb, const struct device *usbc_dev)
 Callback API to register the VCONN control application callback.
typedef int(* tcpc_api_vconn_discharge_t) (const struct device *dev, bool enable)
 Callback API to enable or disable VCONN discharge.
typedef int(* tcpc_api_set_vconn_t) (const struct device *dev, bool enable)
 Callback API to enable or disable VCONN.
typedef int(* tcpc_api_set_roles_t) (const struct device *dev, enum tc_power_role power_role, enum tc_data_role data_role)
 Callback API to set power and data roles for PD message header.
typedef int(* tcpc_api_get_rx_pending_msg_t) (const struct device *dev, struct pd_msg *msg)
 Callback API to get a pending RX message or query RX status.
typedef int(* tcpc_api_set_rx_enable_t) (const struct device *dev, bool enable)
 Callback API to enable or disable SOP* RX.
typedef int(* tcpc_api_set_cc_polarity_t) (const struct device *dev, enum tc_cc_polarity polarity)
 Callback API to set CC polarity.
typedef int(* tcpc_api_transmit_data_t) (const struct device *dev, struct pd_msg *msg)
 Callback API to transmit a PD message.
typedef int(* tcpc_api_dump_std_reg_t) (const struct device *dev)
 Callback API to dump standard TCPC registers.
typedef int(* tcpc_api_mask_status_register_t) (const struct device *dev, enum tcpc_status_reg reg, uint32_t mask)
 Callback API to mask or unmask status register bits.
typedef int(* tcpc_api_set_debug_accessory_t) (const struct device *dev, bool enable)
 Callback API to enable or disable debug accessory control.
typedef int(* tcpc_api_set_debug_detach_t) (const struct device *dev)
 Callback API to detach from a debug connection.
typedef int(* tcpc_api_set_drp_toggle_t) (const struct device *dev, bool enable)
 Callback API to enable or disable DRP toggle.
typedef int(* tcpc_api_get_snk_ctrl_t) (const struct device *dev)
 Callback API to query VBUS sink control state.
typedef int(* tcpc_api_set_snk_ctrl_t) (const struct device *dev, bool enable)
 Callback API to enable or disable VBUS sinking.
typedef int(* tcpc_api_get_src_ctrl_t) (const struct device *dev)
 Callback API to query VBUS source control state.
typedef int(* tcpc_api_set_src_ctrl_t) (const struct device *dev, bool enable)
 Callback API to enable or disable VBUS sourcing.
typedef int(* tcpc_api_get_chip_info_t) (const struct device *dev, struct tcpc_chip_info *chip_info)
 Callback API to read TCPC chip information.
typedef int(* tcpc_api_set_low_power_mode_t) (const struct device *dev, bool enable)
 Callback API to enter or exit low power mode.
typedef int(* tcpc_api_sop_prime_enable_t) (const struct device *dev, bool enable)
 Callback API to enable or disable SOP' / SOP'' reception.
typedef int(* tcpc_api_set_bist_test_mode_t) (const struct device *dev, bool enable)
 Callback API to enable or disable BIST test mode.
typedef int(* tcpc_api_set_alert_handler_cb_t) (const struct device *dev, tcpc_alert_handler_cb_t handler, void *data)
 Callback API to register the alert application callback.

Detailed Description

This group contains the API type definitions, callback signatures, and other helpers required to implement a USB Type-C Port Controller driver.

Typedef Documentation

◆ tcpc_api_dump_std_reg_t

typedef int(* tcpc_api_dump_std_reg_t) (const struct device *dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to dump standard TCPC registers.

See tcpc_dump_std_reg() for argument description.

◆ tcpc_api_get_cc_t

typedef int(* tcpc_api_get_cc_t) (const struct device *dev, enum tc_cc_voltage_state *cc1, enum tc_cc_voltage_state *cc2)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to read CC line status.

See tcpc_get_cc() for argument description.

◆ tcpc_api_get_chip_info_t

typedef int(* tcpc_api_get_chip_info_t) (const struct device *dev, struct tcpc_chip_info *chip_info)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to read TCPC chip information.

See tcpc_get_chip_info() for argument description.

◆ tcpc_api_get_rp_value_t

typedef int(* tcpc_api_get_rp_value_t) (const struct device *dev, enum tc_rp_value *rp)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to get source Rp value.

See tcpc_get_rp_value() for argument description.

◆ tcpc_api_get_rx_pending_msg_t

typedef int(* tcpc_api_get_rx_pending_msg_t) (const struct device *dev, struct pd_msg *msg)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to get a pending RX message or query RX status.

See tcpc_get_rx_pending_msg() for argument description.

◆ tcpc_api_get_snk_ctrl_t

typedef int(* tcpc_api_get_snk_ctrl_t) (const struct device *dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to query VBUS sink control state.

See tcpc_get_snk_ctrl() for argument description.

◆ tcpc_api_get_src_ctrl_t

typedef int(* tcpc_api_get_src_ctrl_t) (const struct device *dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to query VBUS source control state.

See tcpc_get_src_ctrl() for argument description.

◆ tcpc_api_init_t

typedef int(* tcpc_api_init_t) (const struct device *dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to initialize the TCPC.

See tcpc_init() for argument description.

◆ tcpc_api_mask_status_register_t

typedef int(* tcpc_api_mask_status_register_t) (const struct device *dev, enum tcpc_status_reg reg, uint32_t mask)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to mask or unmask status register bits.

See tcpc_mask_status_register() for argument description.

◆ tcpc_api_select_rp_value_t

typedef int(* tcpc_api_select_rp_value_t) (const struct device *dev, enum tc_rp_value rp)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to set source Rp value.

See tcpc_select_rp_value() for argument description.

◆ tcpc_api_set_alert_handler_cb_t

typedef int(* tcpc_api_set_alert_handler_cb_t) (const struct device *dev, tcpc_alert_handler_cb_t handler, void *data)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to register the alert application callback.

See tcpc_set_alert_handler_cb() for argument description.

◆ tcpc_api_set_bist_test_mode_t

typedef int(* tcpc_api_set_bist_test_mode_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable BIST test mode.

See tcpc_set_bist_test_mode() for argument description.

◆ tcpc_api_set_cc_polarity_t

typedef int(* tcpc_api_set_cc_polarity_t) (const struct device *dev, enum tc_cc_polarity polarity)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to set CC polarity.

See tcpc_set_cc_polarity() for argument description.

◆ tcpc_api_set_cc_t

typedef int(* tcpc_api_set_cc_t) (const struct device *dev, enum tc_cc_pull pull)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to set CC pull and role.

See tcpc_set_cc() for argument description.

◆ tcpc_api_set_debug_accessory_t

typedef int(* tcpc_api_set_debug_accessory_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable debug accessory control.

See tcpc_set_debug_accessory() for argument description.

◆ tcpc_api_set_debug_detach_t

typedef int(* tcpc_api_set_debug_detach_t) (const struct device *dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to detach from a debug connection.

See tcpc_set_debug_detach() for argument description.

◆ tcpc_api_set_drp_toggle_t

typedef int(* tcpc_api_set_drp_toggle_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable DRP toggle.

See tcpc_set_drp_toggle() for argument description.

◆ tcpc_api_set_low_power_mode_t

typedef int(* tcpc_api_set_low_power_mode_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enter or exit low power mode.

See tcpc_set_low_power_mode() for argument description.

◆ tcpc_api_set_roles_t

typedef int(* tcpc_api_set_roles_t) (const struct device *dev, enum tc_power_role power_role, enum tc_data_role data_role)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to set power and data roles for PD message header.

See tcpc_set_roles() for argument description.

◆ tcpc_api_set_rx_enable_t

typedef int(* tcpc_api_set_rx_enable_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable SOP* RX.

See tcpc_set_rx_enable() for argument description.

◆ tcpc_api_set_snk_ctrl_t

typedef int(* tcpc_api_set_snk_ctrl_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable VBUS sinking.

See tcpc_set_snk_ctrl() for argument description.

◆ tcpc_api_set_src_ctrl_t

typedef int(* tcpc_api_set_src_ctrl_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable VBUS sourcing.

See tcpc_set_src_ctrl() for argument description.

◆ tcpc_api_set_vconn_cb_t

typedef void(* tcpc_api_set_vconn_cb_t) (const struct device *dev, tcpc_vconn_control_cb_t vconn_cb, const struct device *usbc_dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to register the VCONN control application callback.

See tcpc_set_vconn_cb() for argument description.

◆ tcpc_api_set_vconn_discharge_cb_t

typedef void(* tcpc_api_set_vconn_discharge_cb_t) (const struct device *dev, tcpc_vconn_discharge_cb_t cb, const struct device *usbc_dev)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to register the VCONN discharge application callback.

See tcpc_set_vconn_discharge_cb() for argument description.

◆ tcpc_api_set_vconn_t

typedef int(* tcpc_api_set_vconn_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable VCONN.

See tcpc_set_vconn() for argument description.

◆ tcpc_api_sop_prime_enable_t

typedef int(* tcpc_api_sop_prime_enable_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable SOP' / SOP'' reception.

See tcpc_sop_prime_enable() for argument description.

◆ tcpc_api_transmit_data_t

typedef int(* tcpc_api_transmit_data_t) (const struct device *dev, struct pd_msg *msg)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to transmit a PD message.

See tcpc_transmit_data() for argument description.

◆ tcpc_api_vconn_discharge_t

typedef int(* tcpc_api_vconn_discharge_t) (const struct device *dev, bool enable)

#include <zephyr/drivers/usb_c/usbc_tcpc.h>

Callback API to enable or disable VCONN discharge.

See tcpc_vconn_discharge() for argument description.