Zephyr API 3.6.99
|
BC1.2 driver APIs . More...
Data Structures | |
struct | bc12_partner_state |
BC1.2 detected partner state. More... | |
Typedefs | |
typedef void(* | bc12_callback_t) (const struct device *dev, struct bc12_partner_state *state, void *user_data) |
BC1.2 callback for charger configuration. | |
Enumerations | |
enum | bc12_role { BC12_DISCONNECTED , BC12_PORTABLE_DEVICE , BC12_CHARGING_PORT } |
BC1.2 device role. More... | |
enum | bc12_type { BC12_TYPE_NONE , BC12_TYPE_SDP , BC12_TYPE_DCP , BC12_TYPE_CDP , BC12_TYPE_PROPRIETARY , BC12_TYPE_UNKNOWN , BC12_TYPE_COUNT } |
BC1.2 charging partner type. More... | |
Functions | |
int | bc12_set_role (const struct device *dev, enum bc12_role role) |
Set the BC1.2 role. | |
int | bc12_set_result_cb (const struct device *dev, bc12_callback_t cb, void *user_data) |
Register a callback for BC1.2 results. | |
BC1.2 constants | |
#define | BC12_CHARGER_VOLTAGE_UV 5000 * 1000 |
BC1.2 USB charger voltage. | |
#define | BC12_CHARGER_MIN_CURR_UA 2500 |
BC1.2 USB charger minimum current. | |
#define | BC12_CHARGER_MAX_CURR_UA 1500 * 1000 |
BC1.2 USB charger maximum current. | |
BC1.2 driver APIs .
#define BC12_CHARGER_MAX_CURR_UA 1500 * 1000 |
#include <zephyr/drivers/usb/usb_bc12.h>
BC1.2 USB charger maximum current.
#define BC12_CHARGER_MIN_CURR_UA 2500 |
#include <zephyr/drivers/usb/usb_bc12.h>
BC1.2 USB charger minimum current.
Set to match the Isusp of 2.5 mA parameter. This is returned by the driver when either BC1.2 detection fails, or the attached partner is a SDP (standard downstream port).
The application may increase the current draw after determining the USB device state of suspended/unconfigured/configured. Suspended: 2.5 mA Unconfigured: 100 mA Configured: 500 mA (USB 2.0)
#define BC12_CHARGER_VOLTAGE_UV 5000 * 1000 |
#include <zephyr/drivers/usb/usb_bc12.h>
BC1.2 USB charger voltage.
typedef void(* bc12_callback_t) (const struct device *dev, struct bc12_partner_state *state, void *user_data) |
#include <zephyr/drivers/usb/usb_bc12.h>
BC1.2 callback for charger configuration.
dev | BC1.2 device which is notifying of the new charger state. |
state | Current state of the BC1.2 client, including BC1.2 type detected, voltage, and current limits. If NULL, then the partner charger is disconnected or the BC1.2 device is operating in host mode. |
user_data | Requester supplied data which is passed along to the callback. |
enum bc12_role |
#include <zephyr/drivers/usb/usb_bc12.h>
BC1.2 device role.
Enumerator | |
---|---|
BC12_DISCONNECTED | |
BC12_PORTABLE_DEVICE | |
BC12_CHARGING_PORT |
enum bc12_type |
#include <zephyr/drivers/usb/usb_bc12.h>
BC1.2 charging partner type.
int bc12_set_result_cb | ( | const struct device * | dev, |
bc12_callback_t | cb, | ||
void * | user_data ) |
#include <zephyr/drivers/usb/usb_bc12.h>
Register a callback for BC1.2 results.
dev | Pointer to the device structure for the BC1.2 driver instance. |
cb | Function pointer for the result callback. |
user_data | Requester supplied data which is passed along to the callback. |
0 | If successful. |
-EIO | general input/output error. |
#include <zephyr/drivers/usb/usb_bc12.h>
Set the BC1.2 role.
dev | Pointer to the device structure for the BC1.2 driver instance. |
role | New role for the BC1.2 device. |
0 | If successful. |
-EIO | general input/output error. |