Skip to content

SBS Spec Coverage

Matteo Tullo edited this page Feb 4, 2025 · 5 revisions

Charger

For detailed descriptions on how to use each function, please refer to the Smart Battery System spec.

Functions Code Access Data Implemented
ChargingCurrent 0x14 w mA (u16)
ChargingVoltage 0x15 w mV (u16)

Fuel Gauge

For detailed descriptions on how to use each function, please refer to the Smart Battery System spec.

Functions Code Access Data Implemented
ManufacturerAccess* 0x00 r/w word -
RemainingCapacityAlarm 0x01 r/w mAh or 10mWh
RemainingTimeAlarm 0x02 r/w minutes
BatteryMode 0x03 r bit flags
AtRate 0x04 r/w mA or 10mW
AtRateTimeToFull 0x05 r minutes
AtRateTimeToEmpty 0x06 r minutes
AtRateOK 0x07 r Boolean
Temperature 0x08 r 0.1°K
Voltage 0x09 r mV
Current 0x0a r mA
AverageCurrent 0x0b r mA
MaxError 0x0c r percent
RelativeStateOfCharge 0x0d r percent
AbsoluteStateOfCharge 0x0e r percent
RemainingCapacity 0x0f r mAh or 10mWh
FullChargeCapacity 0x10 r mAh or 10mWh
RunTimeToEmpty 0x11 r minutes
AverageTimeToEmpty 0x12 r minutes
AverageTimeToFull 0x13 r minutes
ChargingCurrent 0x14 r mA
ChargingVoltage 0x15 r mV
BatteryStatus 0x16 r bit flags
CycleCount 0x17 r count
DesignCapacity 0x18 r mAh or 10mWh
DesignVoltage 0x19 r mV
SpecificationInfo 0x1a r unsigned int
ManufactureDate 0x1b r unsigned int
SerialNumber 0x1c r number
reserved 0x1d - 0x1f
ManufacturerName 0x20 r string
DeviceName 0x21 r string
DeviceChemistry 0x22 r string
ManufacturerData* 0x23 r data -
reserved 0x25 - 0x2e -
OptionalMfgFunction5* 0x2f r/w data -
reserved 0x30 - 0x3b -
OptionalMfgFunction4* 0x3c r/w word -
OptionalMfgFunction3-1* 0x3d - 0x3f r/w word -

* refers to optional fn's that will not be implemented

Assumptions + Deviations from spec

As there is such a wide range of battery chargers and smart batteries, as well as different ways to electrically connect your smart battery system, a guiding principle of embedded-batteries is to make as little assumptions as possible. The SBS spec, which is the basis of the traits, is used as a guide rather than a strict constraint. Some common deviations and their solutions are listed below:

Chargers and Fuel Gauges partially/not implementing the SBS spec

Charger and smart battery driver authors are given the flexibility on how their driver implements each SBS function. For example, if the smart battery does not have thermistors onboard, a Result with an "not implemented" error can be returned. Application level code must be able to handle the error accordingly.

Smart Battery acting as a master

The SBS spec defines that the smart battery should be able to take control of the communication bus and broadcast alert messages. This functionality requires implementation of bus arbitration and as such, is not planned to be supported.

Clone this wiki locally