nRF5 SDK v15.3.0
Modules | Data Structures | Enumerations | Functions
POWER driver

POWER peripheral driver. More...

Modules

 POWER peripheral driver configuration
 

Data Structures

struct  nrfx_power_config_t
 General power configuration. More...
 
struct  nrfx_power_pofwarn_config_t
 The configuration for power failure comparator. More...
 
struct  nrfx_power_sleepevt_config_t
 The configuration of sleep event processing. More...
 
struct  nrfx_power_usbevt_config_t
 The configuration of USB related power events. More...
 

Enumerations

enum  nrfx_power_mode_t {
  NRFX_POWER_MODE_CONSTLAT,
  NRFX_POWER_MODE_LOWPWR
}
 Power mode possible configurations. More...
 
enum  nrfx_power_sleep_evt_t {
  NRFX_POWER_SLEEP_EVT_ENTER,
  NRFX_POWER_SLEEP_EVT_EXIT
}
 Events from power system. More...
 
enum  nrfx_power_usb_evt_t {
  NRFX_POWER_USB_EVT_DETECTED,
  NRFX_POWER_USB_EVT_REMOVED,
  NRFX_POWER_USB_EVT_READY
}
 Events from USB power system. More...
 
enum  nrfx_power_usb_state_t {
  NRFX_POWER_USB_STATE_DISCONNECTED,
  NRFX_POWER_USB_STATE_CONNECTED,
  NRFX_POWER_USB_STATE_READY
}
 USB power state. More...
 

Functions

nrfx_power_pofwarn_event_handler_t nrfx_power_pof_handler_get (void)
 Function for getting the handler of the power failure comparator. More...
 
nrfx_power_usb_event_handler_t nrfx_power_usb_handler_get (void)
 Function for getting the handler of the USB power. More...
 
nrfx_err_t nrfx_power_init (nrfx_power_config_t const *p_config)
 Initialize power module driver. More...
 
void nrfx_power_uninit (void)
 Unintialize power module driver. More...
 
void nrfx_power_pof_init (nrfx_power_pofwarn_config_t const *p_config)
 Initialize power failure comparator. More...
 
void nrfx_power_pof_enable (nrfx_power_pofwarn_config_t const *p_config)
 Enable power failure comparator Sets and enables interrupt of the power failure comparator. This functions cannot be using when Softdevice is enabled. If event handler set in init function is set to NULL, interrupt would be disabled. More...
 
void nrfx_power_pof_disable (void)
 Disable the power failure comparator. More...
 
void nrfx_power_pof_uninit (void)
 Clear the power failure comparator settings. More...
 
void nrfx_power_sleepevt_init (nrfx_power_sleepevt_config_t const *p_config)
 Initialize sleep entering and exiting events processing. More...
 
void nrfx_power_sleepevt_enable (nrfx_power_sleepevt_config_t const *p_config)
 Enable sleep entering and exiting events processing. More...
 
void nrfx_power_sleepevt_disable (void)
 Disable sleep entering and exiting events processing.
 
void nrfx_power_sleepevt_uninit (void)
 Uninitialize sleep entering and exiting events processing. More...
 
void nrfx_power_usbevt_init (nrfx_power_usbevt_config_t const *p_config)
 Initialize USB power event processing. More...
 
void nrfx_power_usbevt_enable (void)
 Enable USB power event processing.
 
void nrfx_power_usbevt_disable (void)
 Disable USB power event processing.
 
void nrfx_power_usbevt_uninit (void)
 Uninitalize USB power event processing. More...
 
__STATIC_INLINE
nrfx_power_usb_state_t 
nrfx_power_usbstatus_get (void)
 Get the status of USB power. More...
 
void nrfx_power_irq_handler (void)
 

Callback types

Defined types of callback functions

typedef void(* nrfx_power_pofwarn_event_handler_t )(void)
 Event handler for power failure warning.
 
typedef void(* nrfx_power_sleep_event_handler_t )(nrfx_power_sleep_evt_t event)
 Event handler for entering/exiting sleep. More...
 
typedef void(* nrfx_power_usb_event_handler_t )(nrfx_power_usb_evt_t event)
 Event handler for USB related power events. More...
 

Detailed Description

POWER peripheral driver.

Typedef Documentation

typedef void(* nrfx_power_sleep_event_handler_t)(nrfx_power_sleep_evt_t event)

Event handler for entering/exiting sleep.

Parameters
eventEvent type
typedef void(* nrfx_power_usb_event_handler_t)(nrfx_power_usb_evt_t event)

Event handler for USB related power events.

Parameters
eventEvent type

Enumeration Type Documentation

Power mode possible configurations.

Enumerator
NRFX_POWER_MODE_CONSTLAT 

Constant latency mode

NRFX_POWER_MODE_LOWPWR 

Low power mode

Events from power system.

Enumerator
NRFX_POWER_SLEEP_EVT_ENTER 

CPU entered WFI/WFE sleep

                   Keep in mind that if this interrupt is enabled,
                   it means that CPU was waken up just after WFI by this interrupt.
NRFX_POWER_SLEEP_EVT_EXIT 

CPU exited WFI/WFE sleep

Events from USB power system.

Enumerator
NRFX_POWER_USB_EVT_DETECTED 

USB power detected on the connector (plugged in).

NRFX_POWER_USB_EVT_REMOVED 

USB power removed from the connector.

NRFX_POWER_USB_EVT_READY 

USB power regulator ready.

USB power state.

The single enumerator that holds all data about current state of USB related POWER.

Organized this way that higher power state has higher numeric value

Enumerator
NRFX_POWER_USB_STATE_DISCONNECTED 

No power on USB lines detected

NRFX_POWER_USB_STATE_CONNECTED 

The USB power is detected, but USB power regulator is not ready

NRFX_POWER_USB_STATE_READY 

From the power point of view USB is ready for working

Function Documentation

nrfx_err_t nrfx_power_init ( nrfx_power_config_t const *  p_config)

Initialize power module driver.

Enabled power module driver would process all the interrupts from power system.

Parameters
[in]p_configPointer to the structure with initial configuration.
Return values
NRFX_SUCCESSSuccessfully initialized.
NRFX_ERROR_ALREADY_INITIALIZEDModule was already initialized.
void nrfx_power_pof_disable ( void  )

Disable the power failure comparator.

Disables the power failure comparator interrupt.

void nrfx_power_pof_enable ( nrfx_power_pofwarn_config_t const *  p_config)

Enable power failure comparator Sets and enables interrupt of the power failure comparator. This functions cannot be using when Softdevice is enabled. If event handler set in init function is set to NULL, interrupt would be disabled.

Parameters
[in]p_configConfiguration with values and event handler.
nrfx_power_pofwarn_event_handler_t nrfx_power_pof_handler_get ( void  )

Function for getting the handler of the power failure comparator.

Returns
Handler of the power failure comparator.
void nrfx_power_pof_init ( nrfx_power_pofwarn_config_t const *  p_config)

Initialize power failure comparator.

Configures the power failure comparator. This function does not setup and enable it. Those steps can be done with functions nrfx_power_pof_enable and nrfx_power_pof_disable or with Softdevice API (when Softdevice is using).

Parameters
[in]p_configConfiguration with values and event handler. If event handler is set to NULL, interrupt would be disabled.
void nrfx_power_pof_uninit ( void  )

Clear the power failure comparator settings.

Clears the settings of the power failure comparator.

void nrfx_power_sleepevt_enable ( nrfx_power_sleepevt_config_t const *  p_config)

Enable sleep entering and exiting events processing.

Parameters
[in]p_configConfiguration with values and event handler.
void nrfx_power_sleepevt_init ( nrfx_power_sleepevt_config_t const *  p_config)

Initialize sleep entering and exiting events processing.

Configures and setups the sleep event processing.

Parameters
[in]p_configConfiguration with values and event handler.
See Also
nrfx_power_sleepevt_uninit
void nrfx_power_sleepevt_uninit ( void  )

Uninitialize sleep entering and exiting events processing.

See Also
nrfx_power_sleepevt_init
void nrfx_power_uninit ( void  )

Unintialize power module driver.

Disables all the interrupt handling in the module.

See Also
nrfx_power_init
nrfx_power_usb_event_handler_t nrfx_power_usb_handler_get ( void  )

Function for getting the handler of the USB power.

Returns
Handler of the USB power.
void nrfx_power_usbevt_init ( nrfx_power_usbevt_config_t const *  p_config)

Initialize USB power event processing.

Configures and setups the USB power event processing.

Parameters
[in]p_configConfiguration with values and event handler.
See Also
nrfx_power_usbevt_uninit
void nrfx_power_usbevt_uninit ( void  )

Uninitalize USB power event processing.

See Also
nrfx_power_usbevt_init
__STATIC_INLINE nrfx_power_usb_state_t nrfx_power_usbstatus_get ( void  )

Get the status of USB power.

Returns
Current USB power status

Documentation feedback | Developer Zone | Subscribe | Updated