xiao_sense_nrf52840_battery_lib
xiao_sense_nrf52840_battery_lib copied to clipboard
API upgrade: Request sample and period sampling support
Summary
Enhance the API to support periodic sampling of battery voltage. This feature will enable users to start and stop periodic sampling, set time intervals, and register callbacks for sample readiness. Additionally, provide a one-shot function to request a sample on demand.
Features to Implement
-
Periodic Sampling
- Start/Stop Periodic Sampling: Allow users to initiate and terminate periodic sampling of the battery voltage.
- Set Sampling Interval: Enable users to configure the time interval between each sample.
- Register Callbacks: Users can register callback functions to be invoked when samples are ready.
-
One-Shot Sampling
- Request Sample: Provide a function to request a single sample of the battery voltage.
- Callback Integration: Both periodic and one-shot sampling should utilize the same registered callback functions.