Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
USB-C VBUS API. More...
Data Structures | |
struct | usbc_vbus_driver_api |
Functions | |
static bool | usbc_vbus_check_level (const struct device *dev, enum tc_vbus_level level) |
Checks if VBUS is at a particular level. | |
static int | usbc_vbus_measure (const struct device *dev, int *meas) |
Reads and returns VBUS measured in mV. | |
static int | usbc_vbus_discharge (const struct device *dev, bool enable) |
Controls a pin that discharges VBUS. | |
static int | usbc_vbus_enable (const struct device *dev, bool enable) |
Controls a pin that enables VBUS measurements. | |
USB-C VBUS API.
|
inlinestatic |
#include <zephyr/drivers/usb_c/usbc_vbus.h>
Checks if VBUS is at a particular level.
dev | Runtime device structure |
level | The level voltage to check against |
true | if VBUS is at the level voltage |
false | if VBUS is not at that level voltage |
#include <zephyr/drivers/usb_c/usbc_vbus.h>
Controls a pin that discharges VBUS.
dev | Runtime device structure |
enable | Discharge VBUS when true |
0 | on success |
-EIO | on failure |
-ENOENT | if discharge pin isn't defined |
#include <zephyr/drivers/usb_c/usbc_vbus.h>
Controls a pin that enables VBUS measurements.
dev | Runtime device structure |
enable | enable VBUS measurements when true |
0 | on success |
-EIO | on failure |
-ENOENT | if enable pin isn't defined |
|
inlinestatic |
#include <zephyr/drivers/usb_c/usbc_vbus.h>
Reads and returns VBUS measured in mV.
dev | Runtime device structure |
meas | pointer where the measured VBUS voltage is stored |
0 | on success |
-EIO | on failure |