Driver for managing events and the state of POWER peripheral. More...
Modules | |
POWER peripheral driver configuration | |
Data Structures | |
struct | nrf_drv_power_config_t |
General power configuration. More... | |
struct | nrf_drv_power_pofwarn_config_t |
The configuration for power failure comparator. More... | |
Enumerations | |
enum | nrf_drv_power_mode_t { NRF_DRV_POWER_MODE_CONSTLAT, NRF_DRV_POWER_MODE_LOWPWR } |
Power mode possible configurations. More... | |
Functions | |
bool | nrf_drv_power_init_check (void) |
Function for checking if driver is already initialized. More... | |
ret_code_t | nrf_drv_power_init (nrf_drv_power_config_t const *p_config) |
Initialize power module driver. More... | |
void | nrf_drv_power_uninit (void) |
Unintialize power module driver. More... | |
void | nrf_drv_power_pof_init (nrf_drv_power_pofwarn_config_t const *p_config) |
Initialize power failure comparator. More... | |
void | nrf_drv_power_pof_uninit (void) |
Turn off the power failure comparator. More... | |
Callback types | |
typedef void(* | nrf_drv_power_pofwarn_event_handler_t )(void) |
Event handler for power failure warning. | |
Driver for managing events and the state of POWER peripheral.
enum nrf_drv_power_mode_t |
ret_code_t nrf_drv_power_init | ( | nrf_drv_power_config_t const * | p_config | ) |
Initialize power module driver.
Enabled power module driver would process all the interrupts from power system.
[in] | p_config | Driver configuration. Can be NULL - the default configuration from sdk_config.h file would be used then. |
NRF_ERROR_MODULE_ALREADY_INITIALIZED | Module is initialized already. |
NRF_SUCCESS | Successfully initialized. |
bool nrf_drv_power_init_check | ( | void | ) |
Function for checking if driver is already initialized.
This function is used to check whatever common POWER_CLOCK common interrupt should be disabled or not if Clock driver tries to disable the interrupt.
true | Driver is initialized |
false | Driver is uninitialized |
void nrf_drv_power_pof_init | ( | nrf_drv_power_pofwarn_config_t const * | p_config | ) |
Initialize power failure comparator.
Configures and setups the power failure comparator and enables it.
[in] | p_config | Configuration with values and event handler. If event handler is set to NULL, interrupt would be disabled. |
void nrf_drv_power_pof_uninit | ( | void | ) |
Turn off the power failure comparator.
Disables and clears the settings of the power failure comparator.
void nrf_drv_power_uninit | ( | void | ) |
Unintialize power module driver.
Disables all the interrupt handling in the module.