axp2101.h 384 B

1234567891011121314151617181920
  1. #ifndef __AXP2101_H__
  2. #define __AXP2101_H__
  3. #include "i2c_device.h"
  4. class Axp2101 : public I2cDevice {
  5. public:
  6. Axp2101(i2c_master_bus_handle_t i2c_bus, uint8_t addr);
  7. bool IsCharging();
  8. bool IsDischarging();
  9. bool IsChargingDone();
  10. int GetBatteryLevel();
  11. float GetTemperature();
  12. void PowerOff();
  13. private:
  14. int GetBatteryCurrentDirection();
  15. };
  16. #endif