We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14117b6 commit d399ee3Copy full SHA for d399ee3
libraries/Nicla_System/src/Nicla_System.cpp
@@ -150,6 +150,13 @@ bool nicla::enableCharging(uint16_t mA)
150
// Also sets the input current limit to 350mA.
151
_pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_ILIM_UVLO_CTRL, 0x3F);
152
153
+ // Set safety timer to 9 hours (Bit 1+2 0b10) to give the battery enough of time to charge.
154
+ // Set it to 0b11 to disable safety timers. See: Table 24 in the datasheet.
155
+ uint8_t dpmTimerRegisterData = _pmic.readByte(BQ25120A_ADDRESS, BQ25120A_VIN_DPM);
156
+ dpmTimerRegisterData |= 0b00000100; // Set Bit 2 to 1
157
+ dpmTimerRegisterData &= 0b11111101; // Set Bit 1 to 0
158
+ _pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_VIN_DPM, dpmTimerRegisterData);
159
+
160
return _pmic.getFastChargeControlRegister() == _fastChargeRegisterData;
161
}
162
0 commit comments