SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
GaugeBase.hpp
Go to the documentation of this file.
1
29#pragma once
30
31#include <stdint.h>
32
40{
41public:
42 virtual ~GaugeBase() = default;
43
44 GaugeBase(const GaugeBase &) = delete;
45 GaugeBase &operator=(const GaugeBase &) = delete;
46
51 virtual bool refresh() = 0;
52
57 virtual float getTemperature() = 0;
58
63 virtual uint16_t getVoltage() = 0;
64
69 virtual float getCurrent() = 0;
70
75 virtual uint16_t getStateOfCharge() = 0;
76
81 virtual uint16_t getTimeToEmpty() = 0;
82
87 virtual uint16_t getTimeToFull() = 0;
88
93 virtual uint16_t getChipID() = 0;
94
98 virtual void reset() = 0;
99
104 virtual bool isCharging() = 0;
105
110 virtual bool isDischarging() = 0;
111
112protected:
113 GaugeBase() = default;
114};
Base class for battery gauge implementations.
Definition GaugeBase.hpp:40
virtual uint16_t getVoltage()=0
Get battery voltage.
virtual ~GaugeBase()=default
virtual void reset()=0
Reset gauge to initial state.
GaugeBase(const GaugeBase &)=delete
virtual uint16_t getStateOfCharge()=0
Get state of charge.
virtual uint16_t getTimeToEmpty()=0
Get time to empty.
virtual float getCurrent()=0
Get battery current.
virtual bool isDischarging()=0
Check if battery is discharging.
virtual bool refresh()=0
Refresh cached gauge data.
virtual bool isCharging()=0
Check if battery is charging.
virtual uint16_t getChipID()=0
Get chip ID.
GaugeBase()=default
virtual uint16_t getTimeToFull()=0
Get time to full.
GaugeBase & operator=(const GaugeBase &)=delete
virtual float getTemperature()=0
Get battery temperature.