2020-11-08 13:14:56 +00:00
|
|
|
#ifndef POWER_MANAGEMENT_H_
|
|
|
|
#define POWER_MANAGEMENT_H_
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
#include <axp20x.h>
|
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
class PowerManagement {
|
2020-11-08 13:14:56 +00:00
|
|
|
public:
|
2021-10-14 21:31:56 +00:00
|
|
|
PowerManagement();
|
|
|
|
bool begin(TwoWire &port);
|
2020-11-08 13:14:56 +00:00
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
void activateLoRa();
|
|
|
|
void deactivateLoRa();
|
2020-11-08 13:14:56 +00:00
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
void activateGPS();
|
|
|
|
void deactivateGPS();
|
2020-11-08 13:14:56 +00:00
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
void activateOLED();
|
|
|
|
void decativateOLED();
|
2020-11-08 13:14:56 +00:00
|
|
|
|
2022-05-13 18:32:38 +00:00
|
|
|
void enableChgLed();
|
|
|
|
void disableChgLed();
|
2020-11-08 13:14:56 +00:00
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
void activateMeasurement();
|
|
|
|
void deactivateMeasurement();
|
2020-11-09 22:09:41 +00:00
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
double getBatteryVoltage();
|
|
|
|
double getBatteryChargeDischargeCurrent();
|
2020-11-08 13:14:56 +00:00
|
|
|
|
2021-10-14 21:31:56 +00:00
|
|
|
bool isBatteryConnect();
|
2022-05-13 18:32:38 +00:00
|
|
|
bool isChargeing();
|
2021-04-19 20:34:04 +00:00
|
|
|
|
2020-11-08 13:14:56 +00:00
|
|
|
private:
|
2021-10-14 21:31:56 +00:00
|
|
|
AXP20X_Class axp;
|
2020-11-08 13:14:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|