This module handles power management features. More...
Modules | |
Power management module configuration | |
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... | |
This module handles power management features.
#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".
[in] | _handler | Event handler (nrf_pwr_mgmt_shutdown_handler_t). |
[in] | _priority | Priority of the given handler. |
typedef bool(* nrf_pwr_mgmt_shutdown_handler_t)(nrf_pwr_mgmt_evt_t event) |
Shutdown callback.
[in] | event | Type of shutdown process. |
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. |
enum nrf_pwr_mgmt_evt_t |
Shutdown event types.
Power management shutdown types.
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.
NRF_SUCCESS |
void nrf_pwr_mgmt_shutdown | ( | nrf_pwr_mgmt_shutdown_t | shutdown_type | ) |
Function for shutting down the system.
[in] | shutdown_type | Type of operation. |
All callbacks will be executed prior to shutdown.