The power management library is used for handling idle mode and entering System OFF or DFU modes.
Key features include:
Enable NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED to trace the CPU usage using pin NRF_PWR_MGMT_SLEEP_DEBUG_PIN. The pin is set when CPU enters sleep state.
Enable NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED and NRF_PWR_MGMT_CONFIG_LOG_LEVEL to use the logger module for tracing CPU usage (0% - 100%). CPU usage is computed and logged every second.
NRF_PWR_MGMT:DEBUG:CPU Usage: 25% NRF_PWR_MGMT:DEBUG:CPU Usage: 40% NRF_PWR_MGMT:DEBUG:CPU Usage: 36% NRF_PWR_MGMT:DEBUG:CPU Usage: 30%
Using NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED from enabled module will generate a NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF event after NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S seconds of inactivity (nrf_pwr_mgmt_feed resets the inactivity timer).
Shutdown or Enter DFU modes can be blocked by one or more modules. To restore this process, call nrf_pwr_mgmt_shutdown with NRF_PWR_MGMT_SHUTDOWN_CONTINUE. Alternatively, you can enable NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY. In this configuration, the module will try to retry this process every second.
To enable Schedule handling library support in this module, set NRF_PWR_MGMT_CONFIG_USE_SCHEDULER.
With NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED set, this module will clear FPU events before entering sleep mode.