Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB-C VBUS API

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.
 

Detailed Description

USB-C VBUS API.

Since
3.3
Version
0.1.0

Function Documentation

◆ usbc_vbus_check_level()

static bool usbc_vbus_check_level ( const struct device dev,
enum tc_vbus_level  level 
)
inlinestatic

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

Checks if VBUS is at a particular level.

Parameters
devRuntime device structure
levelThe level voltage to check against
Return values
trueif VBUS is at the level voltage
falseif VBUS is not at that level voltage

◆ usbc_vbus_discharge()

static int usbc_vbus_discharge ( const struct device dev,
bool  enable 
)
inlinestatic

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

Controls a pin that discharges VBUS.

Parameters
devRuntime device structure
enableDischarge VBUS when true
Return values
0on success
-EIOon failure
-ENOENTif discharge pin isn't defined

◆ usbc_vbus_enable()

static int usbc_vbus_enable ( const struct device dev,
bool  enable 
)
inlinestatic

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

Controls a pin that enables VBUS measurements.

Parameters
devRuntime device structure
enableenable VBUS measurements when true
Return values
0on success
-EIOon failure
-ENOENTif enable pin isn't defined

◆ usbc_vbus_measure()

static int usbc_vbus_measure ( const struct device dev,
int *  meas 
)
inlinestatic

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

Reads and returns VBUS measured in mV.

Parameters
devRuntime device structure
measpointer where the measured VBUS voltage is stored
Return values
0on success
-EIOon failure