Files
xiaozhi-esp32/main/boards/kevin-box-2/axp2101.h

20 lines
356 B
C
Raw Normal View History

2024-11-14 23:15:43 +08:00
#ifndef __AXP2101_H__
#define __AXP2101_H__
2024-11-16 03:25:55 +08:00
#include "i2c_device.h"
2024-11-14 23:15:43 +08:00
2024-11-16 03:25:55 +08:00
class Axp2101 : public I2cDevice {
2024-11-14 23:15:43 +08:00
public:
2024-11-16 03:25:55 +08:00
Axp2101(i2c_master_bus_handle_t i2c_bus, uint8_t addr);
2024-11-14 23:15:43 +08:00
bool IsCharging();
2024-11-19 08:50:47 +08:00
bool IsDischarging();
2024-11-14 23:15:43 +08:00
bool IsChargingDone();
int GetBatteryLevel();
void PowerOff();
2024-11-19 08:50:47 +08:00
private:
int GetBatteryCurrentDirection();
2024-11-14 23:15:43 +08:00
};
#endif