Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
BC1.2 backed emulator APIs

BC1.2 backend emulator APIs. More...

Functions

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.
 
static int bc12_emul_set_pd_partner (const struct emul *target, bool connected)
 Set the portable device partner state.
 

Detailed Description

BC1.2 backend emulator APIs.

Function Documentation

◆ bc12_emul_set_charging_partner()

static int bc12_emul_set_charging_partner ( const struct emul target,
enum bc12_type  partner_type 
)
inlinestatic

#include <zephyr/drivers/usb/emul_bc12.h>

Set the charging partner type connected to the BC1.2 device.

The corresponding BC1.2 emulator updates the vendor specific registers to simulate connection of the specified charging partner type. The emulator also generates an interrupt for processing by the real driver, if supported.

Parameters
targetPointer to the emulator structure for the BC1.2 emulator instance.
partner_typeThe simulated partner type. Set to BC12_TYPE_NONE to disconnect the charging partner.
Return values
0If successful.
-EINVALif the partner type is not supported.

◆ bc12_emul_set_pd_partner()

static int bc12_emul_set_pd_partner ( const struct emul target,
bool  connected 
)
inlinestatic

#include <zephyr/drivers/usb/emul_bc12.h>

Set the portable device partner state.

The corresponding BC1.2 emulator updates the vendor specific registers to simulate connection or disconnection of a portable device partner. The emulator also generates an interrupt for processing by the real driver, if supported.

Parameters
targetPointer to the emulator structure for the BC1.2 emulator instance.
connectedIf true, emulate a connection of a portable device partner. If false, emulate a disconnect event.
Return values
0If successful.
-EINVALif the connection/disconnection of PD partner is not supported.