-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBasicUsage.ino
34 lines (26 loc) · 1.26 KB
/
BasicUsage.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Arduino_PMIC.h"
void setup() {
PMIC.begin();
PMIC.configLDO1(Ldo1Voltage::V_1_00, true, true, false);
PMIC.configLDO2(Ldo2Voltage::V_1_80, true, true, false);
PMIC.configLDO3(Ldo3Voltage::V_1_20, true, true, false);
PMIC.configSw2(Sw2Voltage::V_3_30, /* V_SW2 Normal Mode */
Sw2Voltage::V_3_30, /* V_SW2 Standby Mode */
Sw2Voltage::V_3_30, /* V_SW2 Sleep Mode */
Sw2CurrentLimit::I_1_5_A, /* Current Limit */
true, /* Enable Normal Mode */
true, /* Enable Standby Mode */
true); /* Enable Sleep Mode */
PMIC.configCharger(IFastCharge::I_500_mA,
VFastCharge::V_3_80,
IEndOfCharge::I_5_mA,
IInputCurrentLimit::I_100_mA);
/* TODO: Clarify if a interrupt event is generated by a rising or falling edge,
* according to schematic/datasheet it's a open-drain output with a pull-up resistor.
* Probably we need to do the registering with a ISR handler internally in the future
* since the PMIC_INT pin PK0 will not be exposed externally.
*/
attachInterrupt(digitalPinToInterrupt(0), PF1550::ISR_onPMICEvent, RISING);
}
void loop() {
}