A Zephyr module to read the battery voltage and calculate the remaining percentage. Helper functions to log the values and stream to Golioth are provided. This library depends on the Golioth Firmware SDK.
The library will use the MAX17262 fuel gauge IC when one is detected in
the devicetree. Otherwise, it will use a voltage divider based on the
vbatt path found in devicetree.
Add this block to west.yml and run west update:
- name: Golioth Battery Monitor
path: deps/modules/lib/battery-monitor
revision: v1.0.0
url: https://github.com/golioth/battery-monitor
-
Ensure your board has either a MAX17262 compatible node or a
vbattpath to a voltage divider in the devicetree. -
Enable the library by setting the Kconfig symbol:
CONFIG_ALUDEL_BATTERY_MONITOR=y