update xpowerslib api
This commit is contained in:
parent
07b6c73ead
commit
ed92647936
@ -67,13 +67,13 @@ void AXP192_powerevent_IRQ(void) {
|
|||||||
void AXP192_power(pmu_power_t powerlevel) {
|
void AXP192_power(pmu_power_t powerlevel) {
|
||||||
switch (powerlevel) {
|
switch (powerlevel) {
|
||||||
case pmu_power_off:
|
case pmu_power_off:
|
||||||
pmu.setChargerLedFunction(XPOWER_CHGLED_CTRL_MANUAL);
|
pmu.setChargerLedFunction(XPOWER_AXP192_CHGLED_CTRL_MANUAL);
|
||||||
pmu.setChargingLedFreq(XPOWERS_CHG_LED_DISABLE);
|
pmu.setChargingLedFreq(XPOWERS_AXP192_CHG_LED_DISABLE);
|
||||||
pmu.shutdown();
|
pmu.shutdown();
|
||||||
break;
|
break;
|
||||||
case pmu_power_sleep:
|
case pmu_power_sleep:
|
||||||
pmu.setChargerLedFunction(XPOWER_CHGLED_CTRL_MANUAL);
|
pmu.setChargerLedFunction(XPOWER_AXP192_CHGLED_CTRL_MANUAL);
|
||||||
pmu.setChargingLedFreq(XPOWERS_CHG_LED_FRE_1HZ);
|
pmu.setChargingLedFreq(XPOWERS_AXP192_CHG_LED_FRE_1HZ);
|
||||||
// we don't cut off DCDC1, because OLED display will then block i2c bus
|
// we don't cut off DCDC1, because OLED display will then block i2c bus
|
||||||
// pmu.disableDC1(); // OLED off
|
// pmu.disableDC1(); // OLED off
|
||||||
pmu.disableLDO3(); // gps off
|
pmu.disableLDO3(); // gps off
|
||||||
@ -85,8 +85,8 @@ void AXP192_power(pmu_power_t powerlevel) {
|
|||||||
pmu.enableLDO2(); // Lora on T-Beam V1.0/1.1
|
pmu.enableLDO2(); // Lora on T-Beam V1.0/1.1
|
||||||
pmu.enableLDO3(); // Gps on T-Beam V1.0/1.1
|
pmu.enableLDO3(); // Gps on T-Beam V1.0/1.1
|
||||||
pmu.enableDC1(); // OLED on T-Beam v1.0/1.1
|
pmu.enableDC1(); // OLED on T-Beam v1.0/1.1
|
||||||
pmu.setChargerLedFunction(XPOWER_CHGLED_CTRL_MANUAL);
|
pmu.setChargerLedFunction(XPOWER_AXP192_CHGLED_CTRL_MANUAL);
|
||||||
pmu.setChargingLedFreq(XPOWERS_CHG_LED_LEVEL_LOW);
|
pmu.setChargingLedFreq(XPOWERS_AXP192_CHG_LED_LEVEL_LOW);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,8 +125,8 @@ void AXP192_init(void) {
|
|||||||
pmu.setLDO3Voltage(3300); // GPS VDD 3v3
|
pmu.setLDO3Voltage(3300); // GPS VDD 3v3
|
||||||
|
|
||||||
// configure PEK button settings
|
// configure PEK button settings
|
||||||
pmu.setPowerKeyPressOffTime(XPOWERS_POWEROFF_4S);
|
pmu.setPowerKeyPressOffTime(XPOWERS_AXP192_POWEROFF_4S);
|
||||||
pmu.setPowerKeyPressOnTime(XPOWERS_POWERON_128MS);
|
pmu.setPowerKeyPressOnTime(XPOWERS_AXP192_POWERON_128MS);
|
||||||
|
|
||||||
// set battery temperature sensing pin off to save power
|
// set battery temperature sensing pin off to save power
|
||||||
pmu.disableTSPinMeasure();
|
pmu.disableTSPinMeasure();
|
||||||
|
Loading…
Reference in New Issue
Block a user