BC1.2 Devices (Experimental)

The Battery Charging specification, currently at revision 1.2, is commonly referred to as just BC1.2. BC1.2 defines limits and detection mechanisms for USB devices to draw current exceeding the USB 2.0 specification limit of 0.5A, 2.5W.

The BC1.2 specification uses the term Charging Port for the device that supplies VBUS on the USB connection and the term Portable Device for the device that sinks current from the USB connection.

Note that the BC1.2 Specification uses the acronym PD for Portable Device. This should not be confused with the USB-C Power Delivery, which also uses the acronym PD.

On many devices, BC1.2 is the fallback mechanism to determine the connected charger capability on USB type C ports when the attached type-C partner does not support Power Delivery.

Key parameters from the BC1.2 Specification include:




Allowed PD (portable device) Current Draw from Charging Port


1.5 A

Charging Downstream Port Rated Current


1.5 - 5.0 A

Maximum Configured Current when connected to a SDP


500 mA

Dedicated Charging Port Rated Current


1.5 - 5.0 A

Suspend current


2.5 mA

Unit load current


100 mA

While the ICDP and IDCP rated currents go up to 5.0 A, the BC1.2 current is limited by the IDEV_CHG parameter. So the BC1.2 support is capped at 1.5 A in the Zephyr implementation when using portable-device mode.

Basic Operation

The BC1.2 device driver provides only two APIs, bc12_set_role() and bc12_set_result_cb().

The application calls bc12_set_role() to transition the BC1.2 device to either a disconnected, portable-device, or charging port mode.

For the disconnected state, the BC1.2 driver powers down the detection chip. The power down operation is vendor specific.

The application calls bc12_set_role() with the type set to BC12_PORTABLE_DEVICE when both the following conditions are true:

  • The application configured the port as an upstream facing port, i.e. a USB device port.

  • The application detects VBUS on the USB connection.

For portable-device mode, the BC1.2 driver powers up the detection chip and starts charger detection. At completion of the charger detection, the BC1.2 driver notifies the callback registered with bc12_set_result_cb(). By default, the BC1.2 driver clamps the current to 1.5A to comply with the BC1.2 specification.

To comply with the USB 2.0 specification, when the driver detects a SDP (Standard Downstream Port) charging partner or if BC1.2 detection fails, the driver reports the available current as ISUSP (2.5 mA). The application may increase the current draw to IUNIT (100 mA) when the connected USB host resumes the USB bus and may increase the current draw to ICFG_MAX (500 mA) when the USB host configures the USB device.

Charging port mode is used by the application when the USB port is configured as a downstream facing port, i.e. a USB host port. For charging port mode, the BC1.2 driver powers up the detection chip and configures the charger type specified by a devicetree property. There is no callback notification when setting charging port mode.

Configuration Options

Related configuration options:

API Reference

group b12_interface

BC1.2 driver APIs.

BC1.2 constants


BC1.2 USB charger voltage.


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 determing the USB device state of suspended/unconfigured/configured. Suspended: 2.5 mA Unconfigured: 100 mA Configured: 500 mA (USB 2.0)


BC1.2 USB charger maximum current.


typedef void (*bc12_callback_t)(const struct device *dev, struct bc12_partner_state *state, void *user_data)

BC1.2 callback for charger configuration.

Param dev:

BC1.2 device which is notifying of the new charger state.

Param 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.

Param user_data:

Requester supplied data which is passed along to the callback.


enum bc12_role

BC1.2 device role.


enumerator BC12_DISCONNECTED
enum bc12_type

BC1.2 charging partner type.


enumerator BC12_TYPE_NONE

No partner connected.

enumerator BC12_TYPE_SDP

Standard Downstream Port

enumerator BC12_TYPE_DCP

Dedicated Charging Port

enumerator BC12_TYPE_CDP

Charging Downstream Port


Proprietary charging port

enumerator BC12_TYPE_UNKNOWN

Unknown charging port, BC1.2 detection failed.


int bc12_set_role(const struct device *dev, enum bc12_role role)

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.

Return values:
  • 0 – If successful.

  • -EIO – general input/output error.

int bc12_set_result_cb(const struct device *dev, bc12_callback_t cb, void *user_data)

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.

Return values:
  • 0 – If successful.

  • -EIO – general input/output error.

struct bc12_partner_state
#include <usb_bc12.h>

BC1.2 detected partner state.

Param type:

Charging partner type.

Param current_ma:

Current, in uA, that the charging partner provides.

Param voltage_mv:

Voltage, in uV, that the charging partner provides.

group b12_emulator_backend

BC1.2 backend emulator APIs.


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

Set the tye 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.

  • target – Pointer to the emulator structure for the BC1.2 emulator instance.

  • partner_type – The simulated partner type. Set to BC12_TYPE_NONE to disconnect the charging partner.

Return values:
  • 0 – If successful.

  • -EINVAL – if the partner type is not supported.