File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,22 @@ SERCOM sercom5(SERCOM5);
185
185
#define PMIC_REG01 0x01
186
186
#define PMIC_REG07 0x07
187
187
188
+ #define PMIC_REG00 0x00
189
+
190
+ static inline void set_voltage_current_thresholds () {
191
+ PERIPH_WIRE.initMasterWIRE (100000 );
192
+ PERIPH_WIRE.enableWIRE ();
193
+ pinPeripheral (PIN_WIRE_SDA, g_APinDescription[PIN_WIRE_SDA].ulPinType );
194
+ pinPeripheral (PIN_WIRE_SCL, g_APinDescription[PIN_WIRE_SCL].ulPinType );
195
+
196
+ PERIPH_WIRE.startTransmissionWIRE ( PMIC_ADDRESS, WIRE_WRITE_FLAG );
197
+ PERIPH_WIRE.sendDataMasterWIRE (PMIC_REG00);
198
+ PERIPH_WIRE.sendDataMasterWIRE (0x06 ); // input voltage limit = 3.88V, input current limit = 2A
199
+ PERIPH_WIRE.prepareCommandBitsWire (WIRE_MASTER_ACT_STOP);
200
+
201
+ PERIPH_WIRE.disableWIRE ();
202
+ }
203
+
188
204
static inline void enable_battery_charging () {
189
205
PERIPH_WIRE.initMasterWIRE (100000 );
190
206
PERIPH_WIRE.enableWIRE ();
@@ -230,6 +246,7 @@ void initVariant() {
230
246
enable_battery_charging ();
231
247
}
232
248
disable_battery_fet (!batteryPresent);
249
+ set_voltage_current_thresholds ();
233
250
#endif
234
251
235
252
// put GSM modem in reset on start to conserve power if it's not used
You can’t perform that action at this time.
0 commit comments