mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-08 22:52:27 -04:00
Max17055 improvements (#2197)
* fixes * more fixes * more fixes * fix * more fixes * fix icon updates * fix init unk error * simplify * improve icon init * code format * Update ui_battinfo.cpp
This commit is contained in:
parent
19eb6b44d5
commit
2bedb5f09f
13 changed files with 112 additions and 63 deletions
|
@ -47,7 +47,7 @@
|
|||
|
||||
// Define Battery Capacity
|
||||
#ifndef __MAX17055_Design_Capacity__
|
||||
#define __MAX17055_Design_Capacity__ 1500 // Battery Capacity
|
||||
#define __MAX17055_Design_Capacity__ 2500 // Battery Capacity
|
||||
#endif
|
||||
|
||||
// Define Gauge Resistor
|
||||
|
@ -62,7 +62,7 @@
|
|||
|
||||
// Define Maximum Voltage
|
||||
#ifndef __MAX17055_Max_Voltage__
|
||||
#define __MAX17055_Max_Voltage__ 4.2 // Maximum Voltage
|
||||
#define __MAX17055_Max_Voltage__ 4.175 // Maximum Voltage
|
||||
#endif
|
||||
|
||||
// Define Empty Voltage
|
||||
|
@ -263,7 +263,7 @@ class MAX17055 {
|
|||
|
||||
uint16_t readVoltage();
|
||||
uint8_t readPercentage();
|
||||
void getBatteryInfo(uint8_t& batteryPercentage, uint16_t& voltage, int32_t& current);
|
||||
void getBatteryInfo(uint8_t& valid_mask, uint8_t& batteryPercentage, uint16_t& voltage, int32_t& current);
|
||||
|
||||
uint16_t instantVoltage(void);
|
||||
uint16_t averageVoltage(void);
|
||||
|
@ -290,7 +290,7 @@ class MAX17055 {
|
|||
private:
|
||||
I2C& bus;
|
||||
const I2C::address_t bus_address;
|
||||
bool detected_;
|
||||
bool detected_ = false;
|
||||
|
||||
bool readRegister(uint8_t reg, uint16_t& value);
|
||||
bool readMultipleRegister(uint8_t reg, uint8_t* data, uint8_t length, bool endTransmission);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue