ttwrplus: add battery voltage readout

Add battery voltage readout through the XPowersLib library.

TG-553
This commit is contained in:
Niccolò Izzo 2023-08-21 19:59:50 +02:00 committed by Silvano Seva
parent 82218aabce
commit 15f5477ae0
3 changed files with 7 additions and 2 deletions

View File

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

View File

@ -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;
}

View File

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