xiao_sense_nrf52840_battery_lib icon indicating copy to clipboard operation
xiao_sense_nrf52840_battery_lib copied to clipboard

API upgrade: Request sample and period sampling support

Open Tjoms99 opened this issue 8 months ago • 0 comments

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

  1. 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.
  2. 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.

Tjoms99 avatar Jun 23 '24 21:06 Tjoms99