12#ifndef ZEPHYR_INCLUDE_DRIVERS_USB_EMUL_BC12_H_
13#define ZEPHYR_INCLUDE_DRIVERS_USB_EMUL_BC12_H_
34__subsystem
struct bc12_emul_driver_api {
35 int (*set_charging_partner)(
const struct emul *
emul,
enum bc12_type partner_type);
36 int (*set_pd_partner)(
const struct emul *
emul,
bool connected);
59 const struct bc12_emul_driver_api *backend_api =
60 (
const struct bc12_emul_driver_api *)target->
backend_api;
62 return backend_api->set_charging_partner(target, partner_type);
82 const struct bc12_emul_driver_api *backend_api =
83 (
const struct bc12_emul_driver_api *)target->
backend_api;
85 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:80
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:56
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:80
const void * backend_api
Address of the API structure exposed by the emulator instance.
Definition: emul.h:100
Public APIs for the USB BC1.2 battery charging detect drivers.