12#ifndef ZEPHYR_INCLUDE_DRIVERS_USB_EMUL_BC12_H_
13#define ZEPHYR_INCLUDE_DRIVERS_USB_EMUL_BC12_H_
35__subsystem
struct bc12_emul_driver_api {
36 int (*set_charging_partner)(
const struct emul *
emul,
enum bc12_type partner_type);
37 int (*set_pd_partner)(
const struct emul *
emul,
bool connected);
60 const struct bc12_emul_driver_api *backend_api =
61 (
const struct bc12_emul_driver_api *)target->
backend_api;
63 return backend_api->set_charging_partner(target, partner_type);
83 const struct bc12_emul_driver_api *backend_api =
84 (
const struct bc12_emul_driver_api *)target->
backend_api;
86 return backend_api->set_pd_partner(target, connected);
static int bc12_emul_set_pd_partner(const struct emul *target, bool connected)
Set the portable device partner state.
Definition emul_bc12.h:81
static int bc12_emul_set_charging_partner(const struct emul *target, enum bc12_type partner_type)
Set the charging partner type connected to the BC1.2 device.
Definition emul_bc12.h:57
bc12_type
BC1.2 charging partner type.
Definition usb_bc12.h:72
An emulator instance - represents the target emulated device/peripheral that is interacted with throu...
Definition emul.h:82
const void * backend_api
Address of the API structure exposed by the emulator instance.
Definition emul.h:103
Public APIs for the USB BC1.2 battery charging detect drivers.