ttwrplus: add battery voltage readout
Add battery voltage readout through the XPowersLib library. TG-553
This commit is contained in:
parent
82218aabce
commit
15f5477ae0
|
|
@ -82,7 +82,7 @@ void platform_terminate()
|
||||||
|
|
||||||
uint16_t platform_getVbat()
|
uint16_t platform_getVbat()
|
||||||
{
|
{
|
||||||
return 0;
|
return pmu_getVbat();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t platform_getMicLevel()
|
uint8_t platform_getMicLevel()
|
||||||
|
|
|
||||||
|
|
@ -292,3 +292,8 @@ void pmu_init()
|
||||||
val = PMU.getChargeTargetVoltage();
|
val = PMU.getChargeTargetVoltage();
|
||||||
printk("Setting Charge Target Voltage : %d\n", tableVoltage[val]);
|
printk("Setting Charge Target Voltage : %d\n", tableVoltage[val]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t pmu_getVbat()
|
||||||
|
{
|
||||||
|
return PMU.isBatteryConnect() ? PMU.getBattVoltage() : 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void pmu_init();
|
void pmu_init();
|
||||||
|
uint16_t pmu_getVbat();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue