nRF5 SDK v17.1.0
Macros | Enumerations | Functions
POWER HAL

Hardware access layer for managing the POWER peripheral. More...

Macros

#define NRF_POWER_HAS_SLEEPEVT   1
 Symbol indicating whether sleep events are present.
 
#define NRF_POWER_HAS_USBREG   1
 Symbol indicating whether the POWER peripheral controls the USB regulator.
 
#define NRF_POWER_HAS_VDDH   1
 Symbol indicating whether VDDH is present.
 
#define NRF_POWER_HAS_DCDCEN_VDDH   1
 Symbol indicating whether DCDCEN for REG0 is present.
 
#define NRF_POWER_HAS_DCDCEN   1
 Symbol indicating whether DCDCEN for REG1 is present.
 
#define NRF_POWER_HAS_POFCON   1
 Symbol indicating whether POFCON is present.
 

Enumerations

enum  nrf_power_task_t {
  NRF_POWER_TASK_CONSTLAT = offsetof(NRF_POWER_Type, TASKS_CONSTLAT),
  NRF_POWER_TASK_LOWPWR = offsetof(NRF_POWER_Type, TASKS_LOWPWR )
}
 POWER tasks. More...
 
enum  nrf_power_event_t {
  NRF_POWER_EVENT_POFWARN = offsetof(NRF_POWER_Type, EVENTS_POFWARN ),
  NRF_POWER_EVENT_SLEEPENTER = offsetof(NRF_POWER_Type, EVENTS_SLEEPENTER ),
  NRF_POWER_EVENT_SLEEPEXIT = offsetof(NRF_POWER_Type, EVENTS_SLEEPEXIT ),
  NRF_POWER_EVENT_USBDETECTED = offsetof(NRF_POWER_Type, EVENTS_USBDETECTED),
  NRF_POWER_EVENT_USBREMOVED = offsetof(NRF_POWER_Type, EVENTS_USBREMOVED ),
  NRF_POWER_EVENT_USBPWRRDY = offsetof(NRF_POWER_Type, EVENTS_USBPWRRDY )
}
 POWER events. More...
 
enum  nrf_power_int_mask_t {
  NRF_POWER_INT_POFWARN_MASK = POWER_INTENSET_POFWARN_Msk,
  NRF_POWER_INT_SLEEPENTER_MASK = POWER_INTENSET_SLEEPENTER_Msk,
  NRF_POWER_INT_SLEEPEXIT_MASK = POWER_INTENSET_SLEEPEXIT_Msk,
  NRF_POWER_INT_USBDETECTED_MASK = POWER_INTENSET_USBDETECTED_Msk,
  NRF_POWER_INT_USBREMOVED_MASK = POWER_INTENSET_USBREMOVED_Msk,
  NRF_POWER_INT_USBPWRRDY_MASK = POWER_INTENSET_USBPWRRDY_Msk
}
 POWER interrupts. More...
 
enum  nrf_power_resetreas_mask_t {
  NRF_POWER_RESETREAS_RESETPIN_MASK = POWER_RESETREAS_RESETPIN_Msk,
  NRF_POWER_RESETREAS_DOG_MASK = POWER_RESETREAS_DOG_Msk,
  NRF_POWER_RESETREAS_SREQ_MASK = POWER_RESETREAS_SREQ_Msk,
  NRF_POWER_RESETREAS_LOCKUP_MASK = POWER_RESETREAS_LOCKUP_Msk,
  NRF_POWER_RESETREAS_OFF_MASK = POWER_RESETREAS_OFF_Msk,
  NRF_POWER_RESETREAS_LPCOMP_MASK = POWER_RESETREAS_LPCOMP_Msk,
  NRF_POWER_RESETREAS_DIF_MASK = POWER_RESETREAS_DIF_Msk,
  NRF_POWER_RESETREAS_NFC_MASK = POWER_RESETREAS_NFC_Msk,
  NRF_POWER_RESETREAS_VBUS_MASK = POWER_RESETREAS_VBUS_Msk
}
 Reset reason. More...
 
enum  nrf_power_usbregstatus_mask_t {
  NRF_POWER_USBREGSTATUS_VBUSDETECT_MASK = POWER_USBREGSTATUS_VBUSDETECT_Msk,
  NRF_POWER_USBREGSTATUS_OUTPUTRDY_MASK = POWER_USBREGSTATUS_OUTPUTRDY_Msk
}
 USBREGSTATUS register bit masks. More...
 
enum  nrf_power_ramblock_t {
  NRF_POWER_RAMBLOCK0 = POWER_RAMSTATUS_RAMBLOCK0_Pos,
  NRF_POWER_RAMBLOCK1 = POWER_RAMSTATUS_RAMBLOCK1_Pos,
  NRF_POWER_RAMBLOCK2 = POWER_RAMSTATUS_RAMBLOCK2_Pos,
  NRF_POWER_RAMBLOCK3 = POWER_RAMSTATUS_RAMBLOCK3_Pos
}
 Numbers of RAM blocks. More...
 
enum  nrf_power_ramblock_mask_t {
  NRF_POWER_RAMBLOCK0_MASK = POWER_RAMSTATUS_RAMBLOCK0_Msk,
  NRF_POWER_RAMBLOCK1_MASK = POWER_RAMSTATUS_RAMBLOCK1_Msk,
  NRF_POWER_RAMBLOCK2_MASK = POWER_RAMSTATUS_RAMBLOCK2_Msk,
  NRF_POWER_RAMBLOCK3_MASK = POWER_RAMSTATUS_RAMBLOCK3_Msk
}
 Masks of RAM blocks. More...
 
enum  nrf_power_onoffram_t {
  NRF_POWER_ONRAM0,
  NRF_POWER_OFFRAM0,
  NRF_POWER_ONRAM1,
  NRF_POWER_OFFRAM1,
  NRF_POWER_ONRAM2,
  NRF_POWER_OFFRAM2,
  NRF_POWER_ONRAM3,
  NRF_POWER_OFFRAM3
}
 RAM power state position of the bits. More...
 
enum  nrf_power_onoffram_mask_t {
  NRF_POWER_ONRAM0_MASK = 1U << NRF_POWER_ONRAM0,
  NRF_POWER_OFFRAM0_MASK = 1U << NRF_POWER_OFFRAM0,
  NRF_POWER_ONRAM1_MASK = 1U << NRF_POWER_ONRAM1,
  NRF_POWER_OFFRAM1_MASK = 1U << NRF_POWER_OFFRAM1,
  NRF_POWER_ONRAM2_MASK = 1U << NRF_POWER_ONRAM2,
  NRF_POWER_OFFRAM2_MASK = 1U << NRF_POWER_OFFRAM2,
  NRF_POWER_ONRAM3_MASK = 1U << NRF_POWER_ONRAM3,
  NRF_POWER_OFFRAM3_MASK = 1U << NRF_POWER_OFFRAM3
}
 RAM power state bit masks. More...
 
enum  nrf_power_pof_thr_t {
  NRF_POWER_POFTHR_V21 = POWER_POFCON_THRESHOLD_V21,
  NRF_POWER_POFTHR_V23 = POWER_POFCON_THRESHOLD_V23,
  NRF_POWER_POFTHR_V25 = POWER_POFCON_THRESHOLD_V25,
  NRF_POWER_POFTHR_V27 = POWER_POFCON_THRESHOLD_V27,
  NRF_POWER_POFTHR_V17 = POWER_POFCON_THRESHOLD_V17,
  NRF_POWER_POFTHR_V18 = POWER_POFCON_THRESHOLD_V18,
  NRF_POWER_POFTHR_V19 = POWER_POFCON_THRESHOLD_V19,
  NRF_POWER_POFTHR_V20 = POWER_POFCON_THRESHOLD_V20,
  NRF_POWER_POFTHR_V22 = POWER_POFCON_THRESHOLD_V22,
  NRF_POWER_POFTHR_V24 = POWER_POFCON_THRESHOLD_V24,
  NRF_POWER_POFTHR_V26 = POWER_POFCON_THRESHOLD_V26,
  NRF_POWER_POFTHR_V28 = POWER_POFCON_THRESHOLD_V28
}
 Power failure comparator thresholds. More...
 
enum  nrf_power_pof_thrvddh_t {
  NRF_POWER_POFTHRVDDH_V27 = POWER_POFCON_THRESHOLDVDDH_V27,
  NRF_POWER_POFTHRVDDH_V28 = POWER_POFCON_THRESHOLDVDDH_V28,
  NRF_POWER_POFTHRVDDH_V29 = POWER_POFCON_THRESHOLDVDDH_V29,
  NRF_POWER_POFTHRVDDH_V30 = POWER_POFCON_THRESHOLDVDDH_V30,
  NRF_POWER_POFTHRVDDH_V31 = POWER_POFCON_THRESHOLDVDDH_V31,
  NRF_POWER_POFTHRVDDH_V32 = POWER_POFCON_THRESHOLDVDDH_V32,
  NRF_POWER_POFTHRVDDH_V33 = POWER_POFCON_THRESHOLDVDDH_V33,
  NRF_POWER_POFTHRVDDH_V34 = POWER_POFCON_THRESHOLDVDDH_V34,
  NRF_POWER_POFTHRVDDH_V35 = POWER_POFCON_THRESHOLDVDDH_V35,
  NRF_POWER_POFTHRVDDH_V36 = POWER_POFCON_THRESHOLDVDDH_V36,
  NRF_POWER_POFTHRVDDH_V37 = POWER_POFCON_THRESHOLDVDDH_V37,
  NRF_POWER_POFTHRVDDH_V38 = POWER_POFCON_THRESHOLDVDDH_V38,
  NRF_POWER_POFTHRVDDH_V39 = POWER_POFCON_THRESHOLDVDDH_V39,
  NRF_POWER_POFTHRVDDH_V40 = POWER_POFCON_THRESHOLDVDDH_V40,
  NRF_POWER_POFTHRVDDH_V41 = POWER_POFCON_THRESHOLDVDDH_V41,
  NRF_POWER_POFTHRVDDH_V42 = POWER_POFCON_THRESHOLDVDDH_V42
}
 Power failure comparator thresholds for VDDH. More...
 
enum  nrf_power_mainregstatus_t {
  NRF_POWER_MAINREGSTATUS_NORMAL = POWER_MAINREGSTATUS_MAINREGSTATUS_Normal,
  NRF_POWER_MAINREGSTATUS_HIGH = POWER_MAINREGSTATUS_MAINREGSTATUS_High
}
 Main regulator status. More...
 
enum  nrf_power_rampower_t {
  NRF_POWER_RAMPOWER_S0POWER = POWER_RAM_POWER_S0POWER_Pos,
  NRF_POWER_RAMPOWER_S1POWER,
  NRF_POWER_RAMPOWER_S2POWER,
  NRF_POWER_RAMPOWER_S3POWER,
  NRF_POWER_RAMPOWER_S4POWER,
  NRF_POWER_RAMPOWER_S5POWER,
  NRF_POWER_RAMPOWER_S6POWER,
  NRF_POWER_RAMPOWER_S7POWER,
  NRF_POWER_RAMPOWER_S8POWER,
  NRF_POWER_RAMPOWER_S9POWER,
  NRF_POWER_RAMPOWER_S10POWER,
  NRF_POWER_RAMPOWER_S11POWER,
  NRF_POWER_RAMPOWER_S12POWER,
  NRF_POWER_RAMPOWER_S13POWER,
  NRF_POWER_RAMPOWER_S14POWER,
  NRF_POWER_RAMPOWER_S15POWER,
  NRF_POWER_RAMPOWER_S0RETENTION = POWER_RAM_POWER_S0RETENTION_Pos,
  NRF_POWER_RAMPOWER_S1RETENTION,
  NRF_POWER_RAMPOWER_S2RETENTION,
  NRF_POWER_RAMPOWER_S3RETENTION,
  NRF_POWER_RAMPOWER_S4RETENTION,
  NRF_POWER_RAMPOWER_S5RETENTION,
  NRF_POWER_RAMPOWER_S6RETENTION,
  NRF_POWER_RAMPOWER_S7RETENTION,
  NRF_POWER_RAMPOWER_S8RETENTION,
  NRF_POWER_RAMPOWER_S9RETENTION,
  NRF_POWER_RAMPOWER_S10RETENTION,
  NRF_POWER_RAMPOWER_S11RETENTION,
  NRF_POWER_RAMPOWER_S12RETENTION,
  NRF_POWER_RAMPOWER_S13RETENTION,
  NRF_POWER_RAMPOWER_S14RETENTION,
  NRF_POWER_RAMPOWER_S15RETENTION
}
 Bit positions for RAMPOWER register. More...
 
enum  nrf_power_rampower_mask_t {
  NRF_POWER_RAMPOWER_S0POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S0POWER,
  NRF_POWER_RAMPOWER_S1POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S1POWER,
  NRF_POWER_RAMPOWER_S2POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S2POWER,
  NRF_POWER_RAMPOWER_S3POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S3POWER,
  NRF_POWER_RAMPOWER_S4POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S4POWER,
  NRF_POWER_RAMPOWER_S5POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S5POWER,
  NRF_POWER_RAMPOWER_S7POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S7POWER,
  NRF_POWER_RAMPOWER_S8POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S8POWER,
  NRF_POWER_RAMPOWER_S9POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S9POWER,
  NRF_POWER_RAMPOWER_S10POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S10POWER,
  NRF_POWER_RAMPOWER_S11POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S11POWER,
  NRF_POWER_RAMPOWER_S12POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S12POWER,
  NRF_POWER_RAMPOWER_S13POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S13POWER,
  NRF_POWER_RAMPOWER_S14POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S14POWER,
  NRF_POWER_RAMPOWER_S15POWER_MASK = 1UL << NRF_POWER_RAMPOWER_S15POWER,
  NRF_POWER_RAMPOWER_S0RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S0RETENTION,
  NRF_POWER_RAMPOWER_S1RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S1RETENTION,
  NRF_POWER_RAMPOWER_S2RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S2RETENTION,
  NRF_POWER_RAMPOWER_S3RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S3RETENTION,
  NRF_POWER_RAMPOWER_S4RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S4RETENTION,
  NRF_POWER_RAMPOWER_S5RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S5RETENTION,
  NRF_POWER_RAMPOWER_S7RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S7RETENTION,
  NRF_POWER_RAMPOWER_S8RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S8RETENTION,
  NRF_POWER_RAMPOWER_S9RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S9RETENTION,
  NRF_POWER_RAMPOWER_S10RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S10RETENTION,
  NRF_POWER_RAMPOWER_S11RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S11RETENTION,
  NRF_POWER_RAMPOWER_S12RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S12RETENTION,
  NRF_POWER_RAMPOWER_S13RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S13RETENTION,
  NRF_POWER_RAMPOWER_S14RETENTION_MASK = 1UL << NRF_POWER_RAMPOWER_S14RETENTION,
  NRF_POWER_RAMPOWER_S15RETENTION_MASK = (int)(1UL << NRF_POWER_RAMPOWER_S15RETENTION)
}
 Bit masks for RAMPOWER register. More...
 

Functions

__STATIC_INLINE void nrf_power_task_trigger (nrf_power_task_t task)
 Function for activating a specific POWER task. More...
 
__STATIC_INLINE uint32_t nrf_power_task_address_get (nrf_power_task_t task)
 Function for returning the address of a specific POWER task register. More...
 
__STATIC_INLINE void nrf_power_event_clear (nrf_power_event_t event)
 Function for clearing a specific event. More...
 
__STATIC_INLINE bool nrf_power_event_check (nrf_power_event_t event)
 Function for retrieving the state of the POWER event. More...
 
__STATIC_INLINE bool nrf_power_event_get_and_clear (nrf_power_event_t event)
 Function for getting and clearing the state of specific event. More...
 
__STATIC_INLINE uint32_t nrf_power_event_address_get (nrf_power_event_t event)
 Function for returning the address of a specific POWER event register. More...
 
__STATIC_INLINE void nrf_power_int_enable (uint32_t int_mask)
 Function for enabling selected interrupts. More...
 
__STATIC_INLINE bool nrf_power_int_enable_check (uint32_t int_mask)
 Function for retrieving the state of selected interrupts. More...
 
__STATIC_INLINE uint32_t nrf_power_int_enable_get (void)
 Function for retrieving the information about enabled interrupts. More...
 
__STATIC_INLINE void nrf_power_int_disable (uint32_t int_mask)
 Function for disabling selected interrupts. More...
 
__STATIC_INLINE void nrf_power_subscribe_set (nrf_power_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given POWER task. More...
 
__STATIC_INLINE void nrf_power_subscribe_clear (nrf_power_task_t task)
 Function for clearing the subscribe configuration for a given POWER task. More...
 
__STATIC_INLINE void nrf_power_publish_set (nrf_power_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given POWER event. More...
 
__STATIC_INLINE void nrf_power_publish_clear (nrf_power_event_t event)
 Function for clearing the publish configuration for a given POWER event. More...
 
__STATIC_INLINE uint32_t nrf_power_resetreas_get (void)
 Function for getting the reset reason bitmask. More...
 
__STATIC_INLINE void nrf_power_resetreas_clear (uint32_t mask)
 Function for clearing the selected reset reason field. More...
 
__STATIC_INLINE bool nrf_power_powerstatus_get (void)
 Function for getting power status of the LTE Modem domain. More...
 
__STATIC_INLINE uint32_t nrf_power_ramstatus_get (void)
 Function for getting the RAMSTATUS register. More...
 
__STATIC_INLINE void nrf_power_pofcon_set (bool enabled, nrf_power_pof_thr_t thr)
 Function for setting the power failure comparator configuration. More...
 
__STATIC_INLINE nrf_power_pof_thr_t nrf_power_pofcon_get (bool *p_enabled)
 Function for getting the power failure comparator configuration. More...
 
__STATIC_INLINE void nrf_power_pofcon_vddh_set (nrf_power_pof_thrvddh_t thr)
 Function for setting the VDDH power failure comparator threshold. More...
 
__STATIC_INLINE
nrf_power_pof_thrvddh_t 
nrf_power_pofcon_vddh_get (void)
 Function for getting the VDDH power failure comparator threshold. More...
 
__STATIC_INLINE void nrf_power_gpregret_set (uint8_t val)
 Function for setting the general purpose retention register. More...
 
__STATIC_INLINE uint8_t nrf_power_gpregret_get (void)
 Function for getting general purpose retention register. More...
 
__STATIC_INLINE void nrf_power_gpregret2_set (uint8_t val)
 Function for setting the general purpose retention register 2. More...
 
__STATIC_INLINE uint8_t nrf_power_gpregret2_get (void)
 Function for getting the general purpose retention register 2. More...
 
__STATIC_INLINE uint8_t nrf_power_gpregret_ext_get (uint8_t reg_num)
 Function for getting value of the particular general purpose retention register. More...
 
__STATIC_INLINE void nrf_power_gpregret_ext_set (uint8_t reg_num, uint8_t val)
 Function for setting particular general purpose retention register. More...
 
__STATIC_INLINE void nrf_power_dcdcen_set (bool enable)
 Enable or disable DCDC converter. More...
 
__STATIC_INLINE bool nrf_power_dcdcen_get (void)
 Function for getting the state of the DCDC converter. More...
 
__STATIC_INLINE void nrf_power_rampower_mask_on (uint8_t block, uint32_t section_mask)
 Turn ON sections in the selected RAM block. More...
 
__STATIC_INLINE void nrf_power_rampower_mask_off (uint8_t block, uint32_t section_mask)
 Turn ON sections in the selected RAM block. More...
 
__STATIC_INLINE uint32_t nrf_power_rampower_mask_get (uint8_t block)
 Function for getting the ON mask and retention sections in the selected RAM block. More...
 
__STATIC_INLINE void nrf_power_dcdcen_vddh_set (bool enable)
 Function for enabling or disabling the DCDC converter on VDDH. More...
 
__STATIC_INLINE bool nrf_power_dcdcen_vddh_get (void)
 Function for getting the state of DCDC converter on VDDH. More...
 
__STATIC_INLINE
nrf_power_mainregstatus_t 
nrf_power_mainregstatus_get (void)
 Function for getting the main supply status. More...
 
__STATIC_INLINE uint32_t nrf_power_usbregstatus_get (void)
 Function for getting the whole USBREGSTATUS register. More...
 
__STATIC_INLINE bool nrf_power_usbregstatus_vbusdet_get (void)
 Function for getting the VBUS input detection status. More...
 
__STATIC_INLINE bool nrf_power_usbregstatus_outrdy_get (void)
 Function for getting the state of the elapsed time for the USB supply output settling. More...
 

Detailed Description

Hardware access layer for managing the POWER peripheral.

Enumeration Type Documentation

POWER events.

Enumerator
NRF_POWER_EVENT_POFWARN 

Power failure warning.

NRF_POWER_EVENT_SLEEPENTER 

CPU entered WFI/WFE sleep.

NRF_POWER_EVENT_SLEEPEXIT 

CPU exited WFI/WFE sleep.

NRF_POWER_EVENT_USBDETECTED 

Voltage supply detected on VBUS.

NRF_POWER_EVENT_USBREMOVED 

Voltage supply removed from VBUS.

NRF_POWER_EVENT_USBPWRRDY 

USB 3.3 V supply ready.

POWER interrupts.

Enumerator
NRF_POWER_INT_POFWARN_MASK 

Write '1' to Enable interrupt for POFWARN event.

NRF_POWER_INT_SLEEPENTER_MASK 

Write '1' to Enable interrupt for SLEEPENTER event.

NRF_POWER_INT_SLEEPEXIT_MASK 

Write '1' to Enable interrupt for SLEEPEXIT event.

NRF_POWER_INT_USBDETECTED_MASK 

Write '1' to Enable interrupt for USBDETECTED event.

NRF_POWER_INT_USBREMOVED_MASK 

Write '1' to Enable interrupt for USBREMOVED event.

NRF_POWER_INT_USBPWRRDY_MASK 

Write '1' to Enable interrupt for USBPWRRDY event.

Main regulator status.

Enumerator
NRF_POWER_MAINREGSTATUS_NORMAL 

Normal voltage mode. Voltage supplied on VDD.

NRF_POWER_MAINREGSTATUS_HIGH 

High voltage mode. Voltage supplied on VDDH.

RAM power state bit masks.

See Also
nrf_power_onoffram_t
Enumerator
NRF_POWER_ONRAM0_MASK 

Keep RAM block 0 ON or OFF in System ON mode.

NRF_POWER_OFFRAM0_MASK 

Keep retention on RAM block 0 when RAM block is switched OFF.

NRF_POWER_ONRAM1_MASK 

Keep RAM block 1 ON or OFF in System ON mode.

NRF_POWER_OFFRAM1_MASK 

Keep retention on RAM block 1 when RAM block is switched OFF.

NRF_POWER_ONRAM2_MASK 

Keep RAM block 2 ON or OFF in System ON mode.

NRF_POWER_OFFRAM2_MASK 

Keep retention on RAM block 2 when RAM block is switched OFF.

NRF_POWER_ONRAM3_MASK 

Keep RAM block 3 ON or OFF in System ON mode.

NRF_POWER_OFFRAM3_MASK 

Keep retention on RAM block 3 when RAM block is switched OFF.

RAM power state position of the bits.

See Also
nrf_power_onoffram_mask_t
Enumerator
NRF_POWER_ONRAM0 

Keep RAM block 0 ON or OFF in System ON mode.

NRF_POWER_OFFRAM0 

Keep retention on RAM block 0 when RAM block is switched OFF.

NRF_POWER_ONRAM1 

Keep RAM block 1 ON or OFF in System ON mode.

NRF_POWER_OFFRAM1 

Keep retention on RAM block 1 when RAM block is switched OFF.

NRF_POWER_ONRAM2 

Keep RAM block 2 ON or OFF in System ON mode.

NRF_POWER_OFFRAM2 

Keep retention on RAM block 2 when RAM block is switched OFF.

NRF_POWER_ONRAM3 

Keep RAM block 3 ON or OFF in System ON mode.

NRF_POWER_OFFRAM3 

Keep retention on RAM block 3 when RAM block is switched OFF.

Power failure comparator thresholds.

Enumerator
NRF_POWER_POFTHR_V21 

Set threshold to 2.1 V.

NRF_POWER_POFTHR_V23 

Set threshold to 2.3 V.

NRF_POWER_POFTHR_V25 

Set threshold to 2.5 V.

NRF_POWER_POFTHR_V27 

Set threshold to 2.7 V.

NRF_POWER_POFTHR_V17 

Set threshold to 1.7 V.

NRF_POWER_POFTHR_V18 

Set threshold to 1.8 V.

NRF_POWER_POFTHR_V19 

Set threshold to 1.9 V.

NRF_POWER_POFTHR_V20 

Set threshold to 2.0 V.

NRF_POWER_POFTHR_V22 

Set threshold to 2.2 V.

NRF_POWER_POFTHR_V24 

Set threshold to 2.4 V.

NRF_POWER_POFTHR_V26 

Set threshold to 2.6 V.

NRF_POWER_POFTHR_V28 

Set threshold to 2.8 V.

Power failure comparator thresholds for VDDH.

Enumerator
NRF_POWER_POFTHRVDDH_V27 

Set threshold to 2.7 V.

NRF_POWER_POFTHRVDDH_V28 

Set threshold to 2.8 V.

NRF_POWER_POFTHRVDDH_V29 

Set threshold to 2.9 V.

NRF_POWER_POFTHRVDDH_V30 

Set threshold to 3.0 V.

NRF_POWER_POFTHRVDDH_V31 

Set threshold to 3.1 V.

NRF_POWER_POFTHRVDDH_V32 

Set threshold to 3.2 V.

NRF_POWER_POFTHRVDDH_V33 

Set threshold to 3.3 V.

NRF_POWER_POFTHRVDDH_V34 

Set threshold to 3.4 V.

NRF_POWER_POFTHRVDDH_V35 

Set threshold to 3.5 V.

NRF_POWER_POFTHRVDDH_V36 

Set threshold to 3.6 V.

NRF_POWER_POFTHRVDDH_V37 

Set threshold to 3.7 V.

NRF_POWER_POFTHRVDDH_V38 

Set threshold to 3.8 V.

NRF_POWER_POFTHRVDDH_V39 

Set threshold to 3.9 V.

NRF_POWER_POFTHRVDDH_V40 

Set threshold to 4.0 V.

NRF_POWER_POFTHRVDDH_V41 

Set threshold to 4.1 V.

NRF_POWER_POFTHRVDDH_V42 

Set threshold to 4.2 V.

Masks of RAM blocks.

See Also
nrf_power_ramblock_t

Numbers of RAM blocks.

See Also
nrf_power_ramblock_mask_t
Note
RAM blocks must be used in nRF51. In newer SoCs, RAM is divided into segments and this functionality is not supported. See the PS for mapping between the internal RAM and RAM blocks, because this mapping is not 1:1, and functions related to old style blocks must not be used.

Bit masks for RAMPOWER register.

All possible bits described, even if they are not used in selected MCU.

Bit positions for RAMPOWER register.

All possible bits described, even if they are not used in selected MCU.

Enumerator
NRF_POWER_RAMPOWER_S0POWER 

Keep RAM section S0 ON in System ON mode

NRF_POWER_RAMPOWER_S1POWER 

Keep RAM section S1 ON in System ON mode.

NRF_POWER_RAMPOWER_S2POWER 

Keep RAM section S2 ON in System ON mode.

NRF_POWER_RAMPOWER_S3POWER 

Keep RAM section S3 ON in System ON mode.

NRF_POWER_RAMPOWER_S4POWER 

Keep RAM section S4 ON in System ON mode.

NRF_POWER_RAMPOWER_S5POWER 

Keep RAM section S5 ON in System ON mode.

NRF_POWER_RAMPOWER_S6POWER 

Keep RAM section S6 ON in System ON mode.

NRF_POWER_RAMPOWER_S7POWER 

Keep RAM section S7 ON in System ON mode.

NRF_POWER_RAMPOWER_S8POWER 

Keep RAM section S8 ON in System ON mode.

NRF_POWER_RAMPOWER_S9POWER 

Keep RAM section S9 ON in System ON mode.

NRF_POWER_RAMPOWER_S10POWER 

Keep RAM section S10 ON in System ON mode.

NRF_POWER_RAMPOWER_S11POWER 

Keep RAM section S11 ON in System ON mode.

NRF_POWER_RAMPOWER_S12POWER 

Keep RAM section S12 ON in System ON mode.

NRF_POWER_RAMPOWER_S13POWER 

Keep RAM section S13 ON in System ON mode.

NRF_POWER_RAMPOWER_S14POWER 

Keep RAM section S14 ON in System ON mode.

NRF_POWER_RAMPOWER_S15POWER 

Keep RAM section S15 ON in System ON mode.

NRF_POWER_RAMPOWER_S0RETENTION 

Keep section retention in OFF mode when section is OFF

NRF_POWER_RAMPOWER_S1RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S2RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S3RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S4RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S5RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S6RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S7RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S8RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S9RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S10RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S11RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S12RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S13RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S14RETENTION 

Keep section retention in OFF mode when section is OFF.

NRF_POWER_RAMPOWER_S15RETENTION 

Keep section retention in OFF mode when section is OFF.

Reset reason.

Enumerator
NRF_POWER_RESETREAS_RESETPIN_MASK 

NRF_POWER_RESETREAS_RESETPIN_MASK.

Bit mask of RESETPIN field.

NRF_POWER_RESETREAS_DOG_MASK 

NRF_POWER_RESETREAS_DOG_MASK.

Bit mask of DOG field.

NRF_POWER_RESETREAS_SREQ_MASK 

NRF_POWER_RESETREAS_SREQ_MASK.

Bit mask of SREQ field.

NRF_POWER_RESETREAS_LOCKUP_MASK 

NRF_POWER_RESETREAS_LOCKUP_MASK.

Bit mask of LOCKUP field.

NRF_POWER_RESETREAS_OFF_MASK 

NRF_POWER_RESETREAS_OFF_MASK.

Bit mask of OFF field.

NRF_POWER_RESETREAS_LPCOMP_MASK 

NRF_POWER_RESETREAS_LPCOMP_MASK.

Bit mask of LPCOMP field.

NRF_POWER_RESETREAS_DIF_MASK 

NRF_POWER_RESETREAS_DIF_MASK.

Bit mask of DIF field.

NRF_POWER_RESETREAS_NFC_MASK 

Bit mask of NFC field.

NRF_POWER_RESETREAS_VBUS_MASK 

Bit mask of VBUS field.

POWER tasks.

Enumerator
NRF_POWER_TASK_CONSTLAT 

Enable constant latency mode.

NRF_POWER_TASK_LOWPWR 

Enable low-power mode (variable latency).

USBREGSTATUS register bit masks.

See Also
nrf_power_usbregstatus_get
Enumerator
NRF_POWER_USBREGSTATUS_VBUSDETECT_MASK 

USB detected or removed.

NRF_POWER_USBREGSTATUS_OUTPUTRDY_MASK 

USB 3.3 V supply ready.

Function Documentation

__STATIC_INLINE bool nrf_power_dcdcen_get ( void  )

Function for getting the state of the DCDC converter.

Note
If the device consist of high voltage power input (VDDH), this setting will relate to the converter on low voltage side (1.3 V output).
Return values
trueConverter is enabled.
falseConverter is disabled.
__STATIC_INLINE void nrf_power_dcdcen_set ( bool  enable)

Enable or disable DCDC converter.

Note
If the device consist of high voltage power input (VDDH), this setting will relate to the converter on low voltage side (1.3 V output).
Parameters
[in]enableSet true to enable the DCDC converter or false to disable the DCDC converter.
__STATIC_INLINE bool nrf_power_dcdcen_vddh_get ( void  )

Function for getting the state of DCDC converter on VDDH.

Return values
trueConverter is enabled.
falseConverter is disabled.
__STATIC_INLINE void nrf_power_dcdcen_vddh_set ( bool  enable)

Function for enabling or disabling the DCDC converter on VDDH.

Parameters
enableSet true to enable the DCDC converter or false to disable the DCDC converter.
__STATIC_INLINE uint32_t nrf_power_event_address_get ( nrf_power_event_t  event)

Function for returning the address of a specific POWER event register.

Parameters
[in]eventEvent.
Returns
Address.
__STATIC_INLINE bool nrf_power_event_check ( nrf_power_event_t  event)

Function for retrieving the state of the POWER event.

Parameters
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.
__STATIC_INLINE void nrf_power_event_clear ( nrf_power_event_t  event)

Function for clearing a specific event.

Parameters
[in]eventEvent.
__STATIC_INLINE bool nrf_power_event_get_and_clear ( nrf_power_event_t  event)

Function for getting and clearing the state of specific event.

This function checks the state of the event and clears it.

Parameters
[in]eventEvent.
Return values
trueThe event was set.
falseThe event was not set.
__STATIC_INLINE uint8_t nrf_power_gpregret2_get ( void  )

Function for getting the general purpose retention register 2.

Note
This register is not available in all MCUs.
Returns
The value from the register.
__STATIC_INLINE void nrf_power_gpregret2_set ( uint8_t  val)

Function for setting the general purpose retention register 2.

Note
This register is not available in the nRF51 MCU family.
Parameters
[in]valValue to be set in the register.
__STATIC_INLINE uint8_t nrf_power_gpregret_ext_get ( uint8_t  reg_num)

Function for getting value of the particular general purpose retention register.

Parameters
[in]reg_numGeneral purpose retention register number.
Returns
The value from the register
__STATIC_INLINE void nrf_power_gpregret_ext_set ( uint8_t  reg_num,
uint8_t  val 
)

Function for setting particular general purpose retention register.

Parameters
[in]reg_numGeneral purpose retention register number.
[in]valValue to be set in the register
__STATIC_INLINE uint8_t nrf_power_gpregret_get ( void  )

Function for getting general purpose retention register.

Returns
The value from the register.
__STATIC_INLINE void nrf_power_gpregret_set ( uint8_t  val)

Function for setting the general purpose retention register.

Parameters
[in]valValue to be set in the register.
__STATIC_INLINE void nrf_power_int_disable ( uint32_t  int_mask)

Function for disabling selected interrupts.

Parameters
[in]int_maskInterrupts mask.
__STATIC_INLINE void nrf_power_int_enable ( uint32_t  int_mask)

Function for enabling selected interrupts.

Parameters
[in]int_maskInterrupts mask.
__STATIC_INLINE bool nrf_power_int_enable_check ( uint32_t  int_mask)

Function for retrieving the state of selected interrupts.

Parameters
[in]int_maskInterrupts mask.
Return values
trueAny of selected interrupts is enabled.
falseNone of selected interrupts is enabled.
__STATIC_INLINE uint32_t nrf_power_int_enable_get ( void  )

Function for retrieving the information about enabled interrupts.

Returns
The flags of enabled interrupts.
__STATIC_INLINE nrf_power_mainregstatus_t nrf_power_mainregstatus_get ( void  )

Function for getting the main supply status.

Returns
The current main supply status.
__STATIC_INLINE nrf_power_pof_thr_t nrf_power_pofcon_get ( bool *  p_enabled)

Function for getting the power failure comparator configuration.

Parameters
[out]p_enabledFunction sets this boolean variable to true if power failure comparator is enabled. The pointer can be NULL if we do not need this information.
Returns
Threshold setting for power failure comparator.
__STATIC_INLINE void nrf_power_pofcon_set ( bool  enabled,
nrf_power_pof_thr_t  thr 
)

Function for setting the power failure comparator configuration.

This function sets the power failure comparator threshold and enables or disables flag.

Note
If VDDH settings are present in the device, this function will clear its settings (set to the lowest voltage). Use nrf_power_pofcon_vddh_set function to set new value.
Parameters
enabledSets to true if power failure comparator is to be enabled.
thrSets the voltage threshold value.
__STATIC_INLINE nrf_power_pof_thrvddh_t nrf_power_pofcon_vddh_get ( void  )

Function for getting the VDDH power failure comparator threshold.

Returns
VDDH threshold currently configured.
__STATIC_INLINE void nrf_power_pofcon_vddh_set ( nrf_power_pof_thrvddh_t  thr)

Function for setting the VDDH power failure comparator threshold.

Parameters
thrThreshold to be set.
__STATIC_INLINE bool nrf_power_powerstatus_get ( void  )

Function for getting power status of the LTE Modem domain.

Return values
trueThe LTE Modem domain is powered on.
falseThe LTE Modem domain is powered off.
__STATIC_INLINE void nrf_power_publish_clear ( nrf_power_event_t  event)

Function for clearing the publish configuration for a given POWER event.

Parameters
[in]eventEvent for which to clear the configuration.
__STATIC_INLINE void nrf_power_publish_set ( nrf_power_event_t  event,
uint8_t  channel 
)

Function for setting the publish configuration for a given POWER event.

Parameters
[in]eventEvent for which to set the configuration.
[in]channelChannel through which to publish the event.
__STATIC_INLINE uint32_t nrf_power_rampower_mask_get ( uint8_t  block)

Function for getting the ON mask and retention sections in the selected RAM block.

Parameters
[in]blockRAM block index.
Returns
Mask of sections state composed from nrf_power_rampower_mask_t flags.
__STATIC_INLINE void nrf_power_rampower_mask_off ( uint8_t  block,
uint32_t  section_mask 
)

Turn ON sections in the selected RAM block.

This function turns OFF several sections in one block and also block retention.

See Also
nrf_power_rampower_mask_t
nrf_power_rampower_mask_off
Parameters
[in]blockRAM block index.
[in]section_maskMask of the sections created by merging nrf_power_rampower_mask_t flags.
__STATIC_INLINE void nrf_power_rampower_mask_on ( uint8_t  block,
uint32_t  section_mask 
)

Turn ON sections in the selected RAM block.

This function turns ON several sections in one block and also block retention.

See Also
nrf_power_rampower_mask_t
nrf_power_rampower_mask_off
Parameters
[in]blockRAM block index.
[in]section_maskMask of the sections created by merging nrf_power_rampower_mask_t flags.
__STATIC_INLINE uint32_t nrf_power_ramstatus_get ( void  )

Function for getting the RAMSTATUS register.

Returns
Value with bits set according to the masks in nrf_power_ramblock_mask_t.
__STATIC_INLINE void nrf_power_resetreas_clear ( uint32_t  mask)

Function for clearing the selected reset reason field.

This function clears the selected reset reason field.

Parameters
[in]maskThe mask constructed from nrf_power_resetreas_mask_t enumerator values.
See Also
nrf_power_resetreas_get
__STATIC_INLINE uint32_t nrf_power_resetreas_get ( void  )

Function for getting the reset reason bitmask.

This function returns the reset reason bitmask. Unless cleared, the RESETREAS register is cumulative. A field is cleared by writing '1' to it (see nrf_power_resetreas_clear). If none of the reset sources is flagged, the chip was reset from the on-chip reset generator, which indicates a power-on-reset or a brown out reset.

Returns
The mask of reset reasons constructed with nrf_power_resetreas_mask_t.
__STATIC_INLINE void nrf_power_subscribe_clear ( nrf_power_task_t  task)

Function for clearing the subscribe configuration for a given POWER task.

Parameters
[in]taskTask for which to clear the configuration.
__STATIC_INLINE void nrf_power_subscribe_set ( nrf_power_task_t  task,
uint8_t  channel 
)

Function for setting the subscribe configuration for a given POWER task.

Parameters
[in]taskTask for which to set the configuration.
[in]channelChannel through which to subscribe events.
__STATIC_INLINE uint32_t nrf_power_task_address_get ( nrf_power_task_t  task)

Function for returning the address of a specific POWER task register.

Parameters
[in]taskTask.
Returns
Task address.
__STATIC_INLINE void nrf_power_task_trigger ( nrf_power_task_t  task)

Function for activating a specific POWER task.

Parameters
[in]taskTask.
__STATIC_INLINE uint32_t nrf_power_usbregstatus_get ( void  )

Function for getting the whole USBREGSTATUS register.

Returns
The USBREGSTATUS register value. Use nrf_power_usbregstatus_mask_t values for bit masking.
See Also
nrf_power_usbregstatus_vbusdet_get
nrf_power_usbregstatus_outrdy_get
__STATIC_INLINE bool nrf_power_usbregstatus_outrdy_get ( void  )

Function for getting the state of the elapsed time for the USB supply output settling.

Return values
falseUSBREG output settling time not elapsed.
trueUSBREG output settling time elapsed (same information as USBPWRRDY event).
See Also
nrf_power_usbregstatus_get
__STATIC_INLINE bool nrf_power_usbregstatus_vbusdet_get ( void  )

Function for getting the VBUS input detection status.

USBDETECTED and USBREMOVED events are derived from this information

Return values
falseVBUS voltage below valid threshold.
trueVBUS voltage above valid threshold.
See Also
nrf_power_usbregstatus_get

Documentation feedback | Developer Zone | Subscribe | Updated