max17055
This commit is contained in:
jLynx 2024-07-16 08:17:55 +12:00 committed by GitHub
parent 9ef58b7763
commit ae75540d35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1122 additions and 18 deletions

View file

@ -32,13 +32,17 @@ class BatteryManagement {
enum BatteryModules {
BATT_NONE = 0,
BATT_ADS1110 = 1,
BATT_MAX17055 = 2,
BATT_EMULATOR = 254
};
static void init();
static bool isDetected() { return detected_ != BATT_NONE; }
static bool getBatteryInfo(uint8_t& batteryPercentage, uint16_t& voltage, int32_t& current, bool& isCharging);
static BatteryModules detectedModule() { return detected_; }
static bool getBatteryInfo(uint8_t& batteryPercentage, uint16_t& voltage, int32_t& current);
static uint16_t getVoltage();
static uint8_t getPercent();
static uint16_t read_register(const uint8_t reg);
static bool write_register(const uint8_t reg, const uint16_t value);
private:
static void create_thread();