12#ifndef ZEPHYR_INCLUDE_DRIVERS_USBC_USBC_PPC_H_
13#define ZEPHYR_INCLUDE_DRIVERS_USBC_USBC_PPC_H_
#define ENOSYS
Function not implemented.
Definition errno.h:82
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
void * data
Address of the device instance private data.
Definition device.h:422
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:418
Structure with pointers to the functions implemented by driver.
Definition usbc_ppc.h:53
int(* set_vbus_discharge)(const struct device *dev, bool enable)
Definition usbc_ppc.h:60
int(* set_src_ctrl)(const struct device *dev, bool enable)
Definition usbc_ppc.h:59
int(* exit_dead_battery_mode)(const struct device *dev)
Definition usbc_ppc.h:55
int(* is_dead_battery_mode)(const struct device *dev)
Definition usbc_ppc.h:54
int(* is_vbus_present)(const struct device *dev)
Definition usbc_ppc.h:61
int(* set_event_handler)(const struct device *dev, usbc_ppc_event_cb_t handler, void *data)
Definition usbc_ppc.h:62
int(* is_vbus_sink)(const struct device *dev)
Definition usbc_ppc.h:57
int(* is_vbus_source)(const struct device *dev)
Definition usbc_ppc.h:56
int(* dump_regs)(const struct device *dev)
Definition usbc_ppc.h:63
int(* set_snk_ctrl)(const struct device *dev, bool enable)
Definition usbc_ppc.h:58
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:242
usbc_ppc_event
Type of event being notified by Power Path Controller.
Definition usbc_ppc.h:24
@ USBC_PPC_EVENT_SRC_REVERSE_CURRENT
Reverse current detected while being in a source role.
Definition usbc_ppc.h:31
@ USBC_PPC_EVENT_SRC_OVERCURRENT
Overcurrent detected while being in a source role.
Definition usbc_ppc.h:33
@ USBC_PPC_EVENT_SRC_OVERVOLTAGE
Overvoltage detected while being in a source role.
Definition usbc_ppc.h:29
@ USBC_PPC_EVENT_SNK_REVERSE_CURRENT
Reverse current detected while being in a sink role.
Definition usbc_ppc.h:43
@ USBC_PPC_EVENT_SNK_OVERVOLTAGE
Overvoltage detected while being in a sink role.
Definition usbc_ppc.h:47
@ USBC_PPC_EVENT_DEAD_BATTERY_ERROR
Exit from dead-battery mode failed.
Definition usbc_ppc.h:26
@ USBC_PPC_EVENT_SNK_SHORT
VBUS short detected while being in a sink role.
Definition usbc_ppc.h:45
@ USBC_PPC_EVENT_BOTH_SNKSRC_ENABLED
Sink and source paths enabled simultaneously.
Definition usbc_ppc.h:40
@ USBC_PPC_EVENT_OVER_TEMPERATURE
Chip over temperature detected
Definition usbc_ppc.h:38
@ USBC_PPC_EVENT_SRC_SHORT
VBUS short detected while being in a source role.
Definition usbc_ppc.h:35
static int ppc_is_dead_battery_mode(const struct device *dev)
Check if PPC is in the dead battery mode.
Definition usbc_ppc.h:79
void(* usbc_ppc_event_cb_t)(const struct device *dev, void *data, enum usbc_ppc_event ev)
Definition usbc_ppc.h:50
static int ppc_is_vbus_source(const struct device *dev)
Check if the PPC is sourcing the VBUS.
Definition usbc_ppc.h:122
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:102
static int ppc_is_vbus_present(const struct device *dev)
Check if VBUS is present.
Definition usbc_ppc.h:222
static int ppc_set_src_ctrl(const struct device *dev, bool enable)
Set the state of VBUS sourcing.
Definition usbc_ppc.h:182
static int ppc_set_snk_ctrl(const struct device *dev, bool enable)
Set the state of VBUS sinking.
Definition usbc_ppc.h:162
static int ppc_set_vbus_discharge(const struct device *dev, bool enable)
Set the state of VBUS discharging.
Definition usbc_ppc.h:202
static int ppc_dump_regs(const struct device *dev)
Print the values or PPC registers.
Definition usbc_ppc.h:262
static int ppc_is_vbus_sink(const struct device *dev)
Check if the PPC is sinking the VBUS.
Definition usbc_ppc.h:142