13#ifndef ZEPHYR_INCLUDE_DRIVERS_USB_C_USBC_PPC_H_
14#define ZEPHYR_INCLUDE_DRIVERS_USB_C_USBC_PPC_H_
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1449
#define ENOSYS
Function not implemented.
Definition errno.h:83
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.
Definition usbc_ppc.h:279
usbc_ppc_event
Type of event being notified by Power Path Controller.
Definition usbc_ppc.h:32
static int ppc_is_dead_battery_mode(const struct device *dev)
Check if PPC is in the dead battery mode.
Definition usbc_ppc.h:116
void(* usbc_ppc_event_cb_t)(const struct device *dev, void *data, enum usbc_ppc_event ev)
Callback used to notify about PPC events.
Definition usbc_ppc.h:67
static int ppc_is_vbus_source(const struct device *dev)
Check if the PPC is sourcing the VBUS.
Definition usbc_ppc.h:159
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...
Definition usbc_ppc.h:139
static int ppc_is_vbus_present(const struct device *dev)
Check if VBUS is present.
Definition usbc_ppc.h:259
static int ppc_set_src_ctrl(const struct device *dev, bool enable)
Set the state of VBUS sourcing.
Definition usbc_ppc.h:219
static int ppc_set_snk_ctrl(const struct device *dev, bool enable)
Set the state of VBUS sinking.
Definition usbc_ppc.h:199
static int ppc_set_vbus_discharge(const struct device *dev, bool enable)
Set the state of VBUS discharging.
Definition usbc_ppc.h:239
static int ppc_dump_regs(const struct device *dev)
Print the values or PPC registers.
Definition usbc_ppc.h:299
static int ppc_is_vbus_sink(const struct device *dev)
Check if the PPC is sinking the VBUS.
Definition usbc_ppc.h:179
@ USBC_PPC_EVENT_SRC_REVERSE_CURRENT
Reverse current detected while being in a source role.
Definition usbc_ppc.h:39
@ USBC_PPC_EVENT_SRC_OVERCURRENT
Overcurrent detected while being in a source role.
Definition usbc_ppc.h:41
@ USBC_PPC_EVENT_SRC_OVERVOLTAGE
Overvoltage detected while being in a source role.
Definition usbc_ppc.h:37
@ USBC_PPC_EVENT_SNK_REVERSE_CURRENT
Reverse current detected while being in a sink role.
Definition usbc_ppc.h:51
@ USBC_PPC_EVENT_SNK_OVERVOLTAGE
Overvoltage detected while being in a sink role.
Definition usbc_ppc.h:55
@ USBC_PPC_EVENT_DEAD_BATTERY_ERROR
Exit from dead-battery mode failed.
Definition usbc_ppc.h:34
@ USBC_PPC_EVENT_SNK_SHORT
VBUS short detected while being in a sink role.
Definition usbc_ppc.h:53
@ USBC_PPC_EVENT_BOTH_SNKSRC_ENABLED
Sink and source paths enabled simultaneously.
Definition usbc_ppc.h:48
@ USBC_PPC_EVENT_OVER_TEMPERATURE
Chip over temperature detected.
Definition usbc_ppc.h:46
@ USBC_PPC_EVENT_SRC_SHORT
VBUS short detected while being in a source role.
Definition usbc_ppc.h:43
#define NULL
Definition iar_missing_defs.h:20
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
void * data
Address of the device instance private data.
Definition device.h:523
@def_driverbackendgroup{USB Type-C Power Path Controller,usb_type_c_power_path_controller}
Definition usbc_ppc.h:78
int(* set_vbus_discharge)(const struct device *dev, bool enable)
@driver_ops_optional Set the state of VBUS discharging.
Definition usbc_ppc.h:92
int(* set_src_ctrl)(const struct device *dev, bool enable)
@driver_ops_optional Set the state of VBUS sourcing.
Definition usbc_ppc.h:90
int(* exit_dead_battery_mode)(const struct device *dev)
@driver_ops_optional Request the PPC to exit from the dead battery mode Return from this call doesn...
Definition usbc_ppc.h:82
int(* is_dead_battery_mode)(const struct device *dev)
@driver_ops_optional Check if PPC is in the dead battery mode.
Definition usbc_ppc.h:80
int(* is_vbus_present)(const struct device *dev)
@driver_ops_optional Check if VBUS is present.
Definition usbc_ppc.h:94
int(* set_event_handler)(const struct device *dev, usbc_ppc_event_cb_t handler, void *data)
@driver_ops_optional Set the callback used to notify about PPC events.
Definition usbc_ppc.h:96
int(* is_vbus_sink)(const struct device *dev)
@driver_ops_optional Check if the PPC is sinking the VBUS.
Definition usbc_ppc.h:86
int(* is_vbus_source)(const struct device *dev)
@driver_ops_optional Check if the PPC is sourcing the VBUS.
Definition usbc_ppc.h:84
int(* dump_regs)(const struct device *dev)
@driver_ops_optional Print the values or PPC registers.
Definition usbc_ppc.h:98
int(* set_snk_ctrl)(const struct device *dev, bool enable)
@driver_ops_optional Set the state of VBUS sinking.
Definition usbc_ppc.h:88