diff options
| author | ailurux <ailuruxx@gmail.com> | 2023-08-28 14:59:52 +1000 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2023-08-28 14:59:52 +1000 |
| commit | db601935c6145445467692c0a4ff2b81e27cf6ce (patch) | |
| tree | e2eed4a38abd03f14dba504ce5e8dedee0da6a12 /src/drivers/include | |
| parent | 6f4ace1dd4b9b34f95af1ba365b68624e209d147 (diff) | |
| parent | 3a0c42f9240eedfbc6a1e94ad3a59c52664fb5b5 (diff) | |
| download | tangara-fw-db601935c6145445467692c0a4ff2b81e27cf6ce.tar.gz | |
Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw
Diffstat (limited to 'src/drivers/include')
| -rw-r--r-- | src/drivers/include/adc.hpp (renamed from src/drivers/include/battery.hpp) | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/drivers/include/battery.hpp b/src/drivers/include/adc.hpp index 64a00135..3e94a9ee 100644 --- a/src/drivers/include/battery.hpp +++ b/src/drivers/include/adc.hpp @@ -15,25 +15,23 @@ namespace drivers { -class Battery { +/* + * Handles measuring the battery's current voltage. + */ +class AdcBattery { public: - static auto Create() -> Battery* { return new Battery(); } - Battery(); - ~Battery(); + static auto Create() -> AdcBattery* { return new AdcBattery(); } + AdcBattery(); + ~AdcBattery(); /** * Returns the current battery level in millivolts. */ auto Millivolts() -> uint32_t; - auto UpdatePercent() -> bool; - auto Percent() -> uint_fast8_t { return percent_; } - private: adc_oneshot_unit_handle_t adc_handle_; adc_cali_handle_t adc_calibration_handle_; - - uint_fast8_t percent_; }; } // namespace drivers |
