mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 08:47:51 +00:00
support for battery if any + TPMS app to ext (#2129)
* batt initial * batt widgets * settings modify * batt info screen * ability to hide icon * battView * redo tmps * hide curr + charge if no data * fix flashing
This commit is contained in:
@@ -27,11 +27,10 @@
|
||||
#include <string>
|
||||
|
||||
#include "i2c_pp.hpp"
|
||||
|
||||
namespace battery {
|
||||
namespace ads1110 {
|
||||
|
||||
using address_t = uint8_t;
|
||||
using reg_t = uint16_t;
|
||||
|
||||
class ADS1110 {
|
||||
public:
|
||||
@@ -39,10 +38,11 @@ class ADS1110 {
|
||||
: bus(bus), bus_address(bus_address), detected_(false) {}
|
||||
|
||||
void init();
|
||||
bool detect();
|
||||
bool isDetected() const { return detected_; }
|
||||
|
||||
float readVoltage();
|
||||
void getBatteryInfo(float& batteryPercentage, float& voltage);
|
||||
uint16_t readVoltage();
|
||||
void getBatteryInfo(uint8_t& batteryPercentage, uint16_t& voltage);
|
||||
|
||||
private:
|
||||
I2C& bus;
|
||||
@@ -50,9 +50,8 @@ class ADS1110 {
|
||||
bool detected_;
|
||||
|
||||
bool write(const uint8_t value);
|
||||
bool detect();
|
||||
};
|
||||
|
||||
} /* namespace ads1110 */
|
||||
|
||||
} // namespace battery
|
||||
#endif /* __ADS1110_H__ */
|
Reference in New Issue
Block a user