LoRa_APRS_iGate/src/PowerManagement/power_management.cpp

41 wiersze
896 B
C++
Czysty Zwykły widok Historia

2021-01-01 22:23:27 +00:00
#include "power_management.h"
2023-06-08 10:52:03 +00:00
PowerManagement::PowerManagement() : axp() {
2021-01-01 22:23:27 +00:00
}
bool PowerManagement::begin(TwoWire &port) {
bool result = axp.begin(port, AXP192_SLAVE_ADDRESS);
if (!result) {
axp.setDCDC1Voltage(3300);
}
return result;
2021-01-01 22:23:27 +00:00
}
void PowerManagement::activateLoRa() {
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);
2021-01-01 22:23:27 +00:00
}
// cppcheck-suppress unusedFunction
void PowerManagement::deactivateLoRa() {
axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF);
2021-01-01 22:23:27 +00:00
}
// cppcheck-suppress unusedFunction
void PowerManagement::activateGPS() {
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);
2021-01-01 22:23:27 +00:00
}
void PowerManagement::deactivateGPS() {
axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF);
2021-01-01 22:23:27 +00:00
}
void PowerManagement::activateOLED() {
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
2021-01-01 22:23:27 +00:00
}
// cppcheck-suppress unusedFunction
2023-02-18 10:47:24 +00:00
void PowerManagement::deactivateOLED() {
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF);
2021-01-01 22:23:27 +00:00
}