Zephyr Project API 4.0.99
A Scalable Open Source RTOS
|
battery API More...
Macros | |
#define | BATTERY_OCV_TABLE_LEN 11 |
#define | BATTERY_CHEMISTRY_DT_GET(node_id) UTIL_CAT(BATTERY_CHEMISTRY_, DT_STRING_UPPER_TOKEN_OR(node_id, device_chemistry, UNKNOWN)) |
Get the battery chemistry enum value. | |
#define | BATTERY_OCV_TABLE_DT_GET(node_id, table) |
Get the OCV curve for a given table. | |
Functions | |
static int32_t | battery_soc_lookup (const int32_t ocv_table[11], uint32_t voltage_uv) |
Convert an OCV table and battery voltage to a charge percentage. | |
battery API
#define BATTERY_CHEMISTRY_DT_GET | ( | node_id | ) | UTIL_CAT(BATTERY_CHEMISTRY_, DT_STRING_UPPER_TOKEN_OR(node_id, device_chemistry, UNKNOWN)) |
#include <include/zephyr/drivers/sensor/battery.h>
Get the battery chemistry enum value.
node_id | node identifier |
#define BATTERY_OCV_TABLE_DT_GET | ( | node_id, | |
table | |||
) |
#include <include/zephyr/drivers/sensor/battery.h>
Get the OCV curve for a given table.
node_id | node identifier |
table | table to retrieve |
#define BATTERY_OCV_TABLE_LEN 11 |
#include <include/zephyr/drivers/sensor/battery.h>
enum battery_chemistry |
#include <include/zephyr/drivers/sensor/battery.h>
#include <include/zephyr/drivers/sensor/battery.h>
Convert an OCV table and battery voltage to a charge percentage.
ocv_table | Open circuit voltage curve |
voltage_uv | Battery voltage in microVolts |