Arduino Power Management Library for nRF5x
-
PowerMode
nRF5x_lowPower.powerMode(POWER_MODE_OFF);
to completely shutdown the nRF5xnRF5x_lowPower.powerMode(POWER_MODE_LOW_POWER);
to switch to low power mode (default mode)nRF5x_lowPower.powerMode(POWER_MODE_CONSTANT_LATENCY);
to switch to constant latency mode
-
DCDC
nRF5x_lowPower.enableDCDC();
to enable the DC/DC converternRF5x_lowPower.disableDCDC();
to disable the DC/DC converter
-
Interrupt for WakeUp from PowerOff
nRF5x_lowPower.enableWakeupByInterrupt(uint32_t pin, uint32_t mode);
to enable the Sense Interrupt- pin is the nRF5x Pin
- mode can be any of the following (HIGH, RISING, LOW, FALLING)
nRF5x_lowPower.disableWakeupByInterrupt(uint32_t pin);
to disable the Sense Interrupt
In constant latency mode the CPU wakeup latency and the PPI task response will be constant and kept at a minimum. This is secured by forcing a set of base resources on while in sleep. The advantage of having a constant and predictable latency will be at the cost of having increased power consumption. The constant latency mode is selected by triggering the CONSTLAT task.
In low power mode the automatic power management system, described in System ON mode, ensures the most efficient supply option is chosen to save the most power. The advantage of having the lowest power possible will be at the cost of having varying CPU wakeup latency and PPI task response. The low power mode is selected by triggering the LOWPWR task.
When the device is in POWER_MODE_OFF, it can be woken up by following signals:
- The DETECT signal, optionally generated by the GPIO peripheral
- The ANADETECT signal, optionally generated by the LPCOMP module
- The SENSE signal, optionally generated by the NFC module to “wake-on-field”
- A reset
This library depends on the Arduino nRF5 package (https://github.com/sandeepmistry/arduino-nRF5)
This library should be compatible with all boards supported by the Arduino-nRF5