feat: Add ability to fetch battery voltage.

* To be able to use the Zephyr `voltage-divider` driver,
  add a mode for fetching raw voltage from the sensor
 and do state of charge calculation outside of the driver.
This commit is contained in:
Peter Johanson
2024-03-15 21:00:37 +00:00
committed by Pete Johanson
parent 931a36ff4a
commit 44358798d3
2 changed files with 55 additions and 1 deletions

View File

@@ -383,6 +383,20 @@ config ZMK_BATTERY_REPORTING
select ZMK_LOW_PRIORITY_WORK_QUEUE
imply BT_BAS if ZMK_BLE
if ZMK_BATTERY_REPORTING
choice ZMK_BATTERY_REPORTING_FETCH_MODE
prompt "Battery Reporting Fetch Mode"
config ZMK_BATTERY_REPORTING_FETCH_MODE_STATE_OF_CHARGE
bool "State of charge"
config ZMK_BATTERY_REPORTING_FETCH_MODE_LITHIUM_VOLTAGE
bool "Lithium Voltage"
endchoice
endif
config ZMK_IDLE_TIMEOUT
int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)"
default 30000