Add module for monitoring battery level and detecting charging and
external power. Module contains also shell commands for debugging.
Discharge curve probably needs to be tuned in future.
battery.c contains two approaches to controlling ADC: zephyr adc api, nrfx driver api. zephyr api is used but it is synchronous so requires that all battery reads are performed from thread context. If it become issue in future we can use nrfx driver directly and get asynchronous callback. Because of that i would keep both implementations for now (nrfx part is not compiled in).
I'm using shell RTT in the example. Will provide short guide how to use shell over RTT in separate PR.
Add module for monitoring battery level and detecting charging and external power. Module contains also shell commands for debugging.
Discharge curve probably needs to be tuned in future.
battery.c
contains two approaches to controlling ADC: zephyr adc api, nrfx driver api. zephyr api is used but it is synchronous so requires that all battery reads are performed from thread context. If it become issue in future we can use nrfx driver directly and get asynchronous callback. Because of that i would keep both implementations for now (nrfx part is not compiled in).I'm using shell RTT in the example. Will provide short guide how to use shell over RTT in separate PR.
Fixes #9.