File tree 1 file changed +7
-0
lines changed
libraries/Nicla_System/src
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,13 @@ bool nicla::enableCharging(uint16_t mA)
150
150
// Also sets the input current limit to 350mA.
151
151
_pmic.writeByte (BQ25120A_ADDRESS, BQ25120A_ILIM_UVLO_CTRL, 0x3F );
152
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
+
153
160
return _pmic.getFastChargeControlRegister () == _fastChargeRegisterData;
154
161
}
155
162
You can’t perform that action at this time.
0 commit comments