This module handles power management features. More...
Macros |
|
| #define | NRF_PWR_MGMT_HANDLER_REGISTER (_handler, _priority) |
|
Macro for registering a shutdown handler. Modules that want to get events from this module must register the handler using this macro.
More...
|
|
Typedefs |
|
| typedef bool(* | nrf_pwr_mgmt_shutdown_handler_t )( nrf_pwr_mgmt_evt_t event) |
|
Shutdown callback.
More...
|
|
Enumerations |
|
| enum |
nrf_pwr_mgmt_shutdown_t
{
NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF , NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF , NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU , NRF_PWR_MGMT_SHUTDOWN_RESET , NRF_PWR_MGMT_SHUTDOWN_CONTINUE } |
|
Power management shutdown types.
More...
|
|
| enum |
nrf_pwr_mgmt_evt_t
{
NRF_PWR_MGMT_EVT_PREPARE_WAKEUP = NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF, NRF_PWR_MGMT_EVT_PREPARE_SYSOFF = NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF, NRF_PWR_MGMT_EVT_PREPARE_DFU = NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU, NRF_PWR_MGMT_EVT_PREPARE_RESET = NRF_PWR_MGMT_SHUTDOWN_RESET } |
|
Shutdown event types.
More...
|
|
Functions |
|
| ret_code_t | nrf_pwr_mgmt_init (void) |
|
Function for initializing power management.
More...
|
|
| void | nrf_pwr_mgmt_run (void) |
|
Function for running power management. Should run in the main loop.
|
|
| void | nrf_pwr_mgmt_feed (void) |
|
Function for indicating activity.
More...
|
|
| void | nrf_pwr_mgmt_shutdown ( nrf_pwr_mgmt_shutdown_t shutdown_type) |
|
Function for shutting down the system.
More...
|
|
Detailed Description
This module handles power management features.
Macro Definition Documentation
| #define NRF_PWR_MGMT_HANDLER_REGISTER | ( | _handler, | |
| _priority | |||
| ) |
Macro for registering a shutdown handler. Modules that want to get events from this module must register the handler using this macro.
This macro places the handler in a section named "pwr_mgmt_data".
- Parameters
-
[in] _handler Event handler ( nrf_pwr_mgmt_shutdown_handler_t ). [in] _priority Priority of the given handler.
Typedef Documentation
| typedef bool(* nrf_pwr_mgmt_shutdown_handler_t)( nrf_pwr_mgmt_evt_t event) |
Shutdown callback.
- Parameters
-
[in] event Type of shutdown process.
- Return values
-
true System OFF / Enter DFU preparation successful. Process will be continued. false System OFF / Enter DFU preparation failed. NRF_PWR_MGMT_SHUTDOWN_CONTINUE should be used to continue the shutdown process.
Enumeration Type Documentation
| enum nrf_pwr_mgmt_evt_t |
Shutdown event types.
Power management shutdown types.
Function Documentation
| void nrf_pwr_mgmt_feed | ( | void | ) |
Function for indicating activity.
Call this function whenever doing something that constitutes "activity". For example, whenever sending data, call this function to indicate that the application is active and should not disconnect any ongoing communication links.
| ret_code_t nrf_pwr_mgmt_init | ( | void | ) |
Function for initializing power management.
- Warning
- Depending on configuration, this function sets SEVONPEND in System Control Block (SCB). This operation is unsafe with the SoftDevice from interrupt priority higher than SVC.
- Return values
-
NRF_SUCCESS
| void nrf_pwr_mgmt_shutdown | ( | nrf_pwr_mgmt_shutdown_t | shutdown_type | ) |
Function for shutting down the system.
- Parameters
-
[in] shutdown_type Type of operation.
All callbacks will be executed prior to shutdown.