mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-02-05 23:35:11 +01:00
43 lines
745 B
C++
43 lines
745 B
C++
|
|
|
||
|
|
#include "power_management.h"
|
||
|
|
|
||
|
|
bool PowerManagement::begin(TwoWire port)
|
||
|
|
{
|
||
|
|
bool result = axp.begin(port, AXP192_SLAVE_ADDRESS);
|
||
|
|
if(!result)
|
||
|
|
{
|
||
|
|
axp.setDCDC1Voltage(3300);
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
void PowerManagement::activateLoRa()
|
||
|
|
{
|
||
|
|
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);
|
||
|
|
}
|
||
|
|
|
||
|
|
void PowerManagement::deactivateLoRa()
|
||
|
|
{
|
||
|
|
axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF);
|
||
|
|
}
|
||
|
|
|
||
|
|
void PowerManagement::activateGPS()
|
||
|
|
{
|
||
|
|
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);
|
||
|
|
}
|
||
|
|
|
||
|
|
void PowerManagement::deactivateGPS()
|
||
|
|
{
|
||
|
|
axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF);
|
||
|
|
}
|
||
|
|
|
||
|
|
void PowerManagement::activateOLED()
|
||
|
|
{
|
||
|
|
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
|
||
|
|
}
|
||
|
|
|
||
|
|
void PowerManagement::decativateOLED()
|
||
|
|
{
|
||
|
|
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF);
|
||
|
|
}
|