4 #ifndef __M5_AXP2101_CLASS_H__
5 #define __M5_AXP2101_CLASS_H__
49 inline void setALDO1(
int voltage) { _set_LDO(0, voltage); }
50 inline void setALDO2(
int voltage) { _set_LDO(1, voltage); }
51 inline void setALDO3(
int voltage) { _set_LDO(2, voltage); }
52 inline void setALDO4(
int voltage) { _set_LDO(3, voltage); }
53 inline void setBLDO1(
int voltage) { _set_LDO(4, voltage); }
54 inline void setBLDO2(
int voltage) { _set_LDO(5, voltage); }
55 inline void setDLDO1(
int voltage) { _set_DLDO(0, voltage); }
56 inline void setDLDO2(
int voltage) { _set_DLDO(1, voltage); }
93 std::size_t readRegister12(std::uint8_t addr);
94 std::size_t readRegister14(std::uint8_t addr);
95 std::size_t readRegister16(std::uint8_t addr);
97 void _set_LDO(std::uint8_t num,
int voltage);
98 void _set_DLDO(std::uint8_t num,
int voltage);
99 bool _get_LDOEn(std::uint8_t num);
void setALDO4(int voltage)
AXP2101_Class(std::uint8_t i2c_addr=DEFAULT_ADDRESS, std::uint32_t freq=400000, I2C_Class *i2c=&In_I2C)
void setBLDO1(int voltage)
float getACINVoltage(void)
void setALDO2(int voltage)
bool getALDO4Enabled(void)
static constexpr std::uint8_t DEFAULT_ADDRESS
float getInternalTemperature(void)
int getChargeStatus(void)
void setALDO3(int voltage)
static constexpr uint8_t AXP2101_TWI_ADDR_EXT
float getBatteryVoltage(void)
float getVBUSVoltage(void)
std::uint8_t getPekPress(void)
float getACINCurrent(void)
float getVBUSCurrent(void)
bool isCharging(void)
Get whether the battery is currently charging or not.
void setBatteryCharge(bool enable)
float getBatteryPower(void)
static constexpr uint8_t AXP2101_EFREQ_CTRL
std::int8_t getBatteryLevel(void)
void setChargeCurrent(std::uint16_t max_mA)
float getAPSVoltage(void)
bool getALDO1Enabled(void)
void setAdcRate(std::uint8_t rate)
void setDLDO1(int voltage)
bool getALDO2Enabled(void)
bool getALDO3Enabled(void)
void setALDO1(int voltage)
bool getBLDO2Enabled(void)
void setDLDO2(int voltage)
float getBatteryChargeCurrent(void)
void setChargeVoltage(std::uint16_t max_mV)
void setReg0x20Bit0(bool)
static constexpr uint8_t AXP2101_EFUS_OP_CFG
void setBACKUP(bool enable)
void setBLDO2(int voltage)
float getBatteryDischargeCurrent(void)
void setAdcState(bool enable)
bool getBLDO1Enabled(void)
I2C_Class In_I2C
for internal I2C device