Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
|
battery API More...
Macros | |
#define | BATTERY_OCV_TABLE_LEN 11 |
#define | BATTERY_CHEMISTRY_DT_GET(node_id) |
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 | ) |
#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 <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 <zephyr/drivers/sensor/battery.h>
enum battery_chemistry |
#include <zephyr/drivers/sensor/battery.h>
#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 |