ttwrplus: add battery voltage readout

Add battery voltage readout through the XPowersLib library.

TG-553
pull/193/head
Niccolò Izzo 2023-08-21 19:59:50 +02:00 zatwierdzone przez Silvano Seva
rodzic 82218aabce
commit 15f5477ae0
3 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -82,7 +82,7 @@ void platform_terminate()
uint16_t platform_getVbat()
{
return 0;
return pmu_getVbat();
}
uint8_t platform_getMicLevel()

Wyświetl plik

@ -292,3 +292,8 @@ void pmu_init()
val = PMU.getChargeTargetVoltage();
printk("Setting Charge Target Voltage : %d\n", tableVoltage[val]);
}
uint16_t pmu_getVbat()
{
return PMU.isBatteryConnect() ? PMU.getBattVoltage() : 0;
}

Wyświetl plik

@ -25,7 +25,7 @@ extern "C" {
#endif
void pmu_init();
uint16_t pmu_getVbat();
#ifdef __cplusplus
}