This section introduces the battery management interface APIs including terms and acronyms, supported features, software architecture, details on how to use this module, battery management interface function groups, enums, structures and functions.
More...
This section introduces the battery management interface APIs including terms and acronyms, supported features, software architecture, details on how to use this module, battery management interface function groups, enums, structures and functions.
The battery management interface APIs can be used to provide battery information such as voltage, temperature, charger type and more.
Terms and acronyms
| Terms | Details |
| BMT | Battery Management Task. |
| GM | Gauge Master, software fuel gauge algorithms. |
Software Architecture of the battery management
Battery management creates a BMT task and provides software fuel gauge through the GM library.
How to use the battery management interface
This function gets the current information about the battery.
- Parameters
-
- Returns
- Returns the value of the battery property. BATTERY_INVALID_VALUE, if the value is invalid.
| Enum | Return description |
| BATTERY_PROPERTY_CAPACITY | Remaining battery capacity. The unit is percentage. |
| BATTERY_PROPERTY_CHARGING_CURRENT | Average charging current. The unit is mA. |
| BATTERY_PROPERTY_CHARGER_EXIST | Charger existence status 0:charger is not connected; 1:charger is connected. |
| BATTERY_PROPERTY_CHARGER_TYPE | Charger type 0: unknown; 1: standard host; 2: non-standard AC charger; 3: standard AC charger; 4: charging host. |
| BATTERY_PROPERTY_TEMPERATURE | Battery temperature. The unit is Celsius degrees. |
| BATTERY_PROPERTY_VOLTAGE | Battery's average voltage. The unit is mV. |
| BATTERY_PROPERTY_CAPACITY_LEVEL | Remaining battery capacity in level format. Level range is from 0 to 5,-1 means uninitialized. |
This function initializes the battery management.
The battery management should be initialized after the hardware initialization and before creating any tasks.
- Returns
- BATTERY_MANAGEMENT_STATUS_OK, if the battery management initialization was successful.
BATTERY_MANAGEMENT_STATUS_ERROR, if the battery management initialization failed.