forked from xiaozhi/xiaozhi-esp32
adjust board structure
This commit is contained in:
@@ -1,22 +1,15 @@
|
||||
#ifndef __AXP2101_H__
|
||||
#define __AXP2101_H__
|
||||
|
||||
#include <driver/i2c_master.h>
|
||||
#include "i2c_device.h"
|
||||
|
||||
class Axp2101 {
|
||||
class Axp2101 : public I2cDevice {
|
||||
public:
|
||||
Axp2101() = default;
|
||||
bool Initialize(i2c_master_bus_handle_t i2c_bus, int i2c_device_address);
|
||||
Axp2101(i2c_master_bus_handle_t i2c_bus, uint8_t addr);
|
||||
bool IsCharging();
|
||||
bool IsChargingDone();
|
||||
int GetBatteryLevel();
|
||||
void PowerOff();
|
||||
|
||||
private:
|
||||
i2c_master_dev_handle_t i2c_device_ = nullptr;
|
||||
|
||||
void WriteReg(uint8_t reg, uint8_t value);
|
||||
uint8_t ReadReg(uint8_t reg);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user