Set input current limits

This commit is contained in:
Jeremy Soller
2020-04-05 10:34:25 -06:00
parent d901907942
commit e8f8daae1b
3 changed files with 26 additions and 2 deletions

View File

@@ -34,6 +34,10 @@ int battery_charger_disable(void) {
res = smbus_write(0x09, 0x15, 0);
if (res < 0) return res;
// Disable input current
res = smbus_write(0x09, 0x3F, 0);
if (res < 0) return res;
return 0;
}
@@ -51,6 +55,10 @@ int battery_charger_enable(void) {
res = smbus_write(0x09, 0x15, 0x3300);
if (res < 0) return res;
// Set input current to ~1.92 A
res = smbus_write(0x09, 0x3F, 0x0780);
if (res < 0) return res;
// Set charge option 0 with watchdog disabled
res = smbus_write(
0x09,