Zephyr API 3.6.99
|
USB Type-C Power Path Controller device API. More...
Go to the source code of this file.
Data Structures | |
struct | usbc_ppc_driver_api |
Structure with pointers to the functions implemented by driver. More... | |
Typedefs | |
typedef void(* | usbc_ppc_event_cb_t) (const struct device *dev, void *data, enum usbc_ppc_event ev) |
Enumerations | |
enum | usbc_ppc_event { USBC_PPC_EVENT_DEAD_BATTERY_ERROR = 0 , USBC_PPC_EVENT_SRC_OVERVOLTAGE , USBC_PPC_EVENT_SRC_REVERSE_CURRENT , USBC_PPC_EVENT_SRC_OVERCURRENT , USBC_PPC_EVENT_SRC_SHORT , USBC_PPC_EVENT_OVER_TEMPERATURE , USBC_PPC_EVENT_BOTH_SNKSRC_ENABLED , USBC_PPC_EVENT_SNK_REVERSE_CURRENT , USBC_PPC_EVENT_SNK_SHORT , USBC_PPC_EVENT_SNK_OVERVOLTAGE } |
Type of event being notified by Power Path Controller. More... | |
Functions | |
static int | ppc_is_dead_battery_mode (const struct device *dev) |
Check if PPC is in the dead battery mode. | |
static int | ppc_exit_dead_battery_mode (const struct device *dev) |
Request the PPC to exit from the dead battery mode Return from this call doesn't mean that the PPC is not in the dead battery anymore. | |
static int | ppc_is_vbus_source (const struct device *dev) |
Check if the PPC is sourcing the VBUS. | |
static int | ppc_is_vbus_sink (const struct device *dev) |
Check if the PPC is sinking the VBUS. | |
static int | ppc_set_snk_ctrl (const struct device *dev, bool enable) |
Set the state of VBUS sinking. | |
static int | ppc_set_src_ctrl (const struct device *dev, bool enable) |
Set the state of VBUS sourcing. | |
static int | ppc_set_vbus_discharge (const struct device *dev, bool enable) |
Set the state of VBUS discharging. | |
static int | ppc_is_vbus_present (const struct device *dev) |
Check if VBUS is present. | |
static int | ppc_set_event_handler (const struct device *dev, usbc_ppc_event_cb_t handler, void *data) |
Set the callback used to notify about PPC events. | |
static int | ppc_dump_regs (const struct device *dev) |
Print the values or PPC registers. | |
USB Type-C Power Path Controller device API.
typedef void(* usbc_ppc_event_cb_t) (const struct device *dev, void *data, enum usbc_ppc_event ev) |
enum usbc_ppc_event |
Type of event being notified by Power Path Controller.
|
inlinestatic |
Print the values or PPC registers.
dev | PPC device structure |
0 | if success |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
|
inlinestatic |
Request the PPC to exit from the dead battery mode Return from this call doesn't mean that the PPC is not in the dead battery anymore.
In the case of error, the driver should execute the callback with USBC_PPC_EVENT_DEAD_BATTERY_ERROR enum. To check if the PPC disabled the dead battery mode, the call to ppc_is_dead_battery_mode should be done.
dev | PPC device structure |
0 | if request was successfully sent |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
|
inlinestatic |
Check if PPC is in the dead battery mode.
dev | PPC device structure |
1 | if PPC is in the dead battery mode |
0 | if PPC is not in the dead battery mode |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
|
inlinestatic |
Check if VBUS is present.
dev | PPC device structure |
1 | if VBUS voltage is present |
0 | if no VBUS voltage is detected |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
|
inlinestatic |
Check if the PPC is sinking the VBUS.
dev | PPC device structure |
1 | if the PPC is sinking the VBUS |
0 | if the PPC is not sinking the VBUS |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
|
inlinestatic |
Check if the PPC is sourcing the VBUS.
dev | PPC device structure |
1 | if the PPC is sourcing the VBUS |
0 | if the PPC is not sourcing the VBUS |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
|
inlinestatic |
Set the callback used to notify about PPC events.
dev | PPC device structure |
handler | Handler that will be called with events notifications |
data | Pointer used as an argument to the callback |
0 | if success |
-ENOSYS | if this function is not supported by the driver |
Set the state of VBUS sinking.
dev | PPC device structure |
enable | True if sinking VBUS should be enabled, false if should be disabled |
0 | if success |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
Set the state of VBUS sourcing.
dev | PPC device structure |
enable | True if sourcing VBUS should be enabled, false if should be disabled |
0 | if success |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |
Set the state of VBUS discharging.
dev | PPC device structure |
enable | True if VBUS discharging should be enabled, false if should be disabled |
0 | if success |
-EIO | if I2C communication failed |
-ENOSYS | if this function is not supported by the driver |