POWER HAL

group nrf_power_hal

Hardware access layer for managing the POWER peripheral.

Defines

NRF_POWER_HAS_CONST_LATENCY

Symbol indicating whether Constant Latency mode is present.

NRF_POWER_HAS_LOW_POWER

Symbol indicating whether Low-Power mode is present.

NRF_POWER_HAS_SLEEPEVT

Symbol indicating whether sleep events are present.

NRF_POWER_HAS_USBREG

Symbol indicating whether the POWER peripheral controls the USB regulator.

NRF_POWER_HAS_DCDCEN_VDDH

Symbol indicating whether DCDCEN for REG0 is present.

NRF_POWER_HAS_DCDCEN

Symbol indicating whether DCDCEN for REG1 is present.

NRF_POWER_HAS_POFWARN

Symbol indicating whether power failure event is present.

NRF_POWER_HAS_POFCON

Symbol indicating whether power failure comparator is present.

NRF_POWER_HAS_POFCON_VDDH

Symbol indicating whether power failure comparator for VDDH is present.

NRF_POWER_HAS_RESETREAS

Auxiliary definition to mark the fact that RESETREAS register is present in POWER.

NRF_POWER_HAS_MAINREGSTATUS

Symbol indicating whether MAINREGSTATUS register is present.

NRF_POWER_HAS_GPREGRET

Symbol indicating whether GPREGRET register is present.

NRF_POWER_HAS_GPREGRET_ARRAY

Symbol indicating whether GPREGRET register is treated as an array.

NRF_POWER_HAS_SEMAPHORE

Symbol indicating whether semaphore for regulator voltage scaling procedure is present.

NRF_POWER_HAS_VREG_UPDATE_TASK_EVENT

Symbol indicating whether task and event responsible for updating voltage regulators configuration are present.

NRF_POWER_HAS_VREG_CONFIG

Symbol indicating whether voltage regulators are configurable.

NRF_POWER_HAS_ABB

Symbol indicating whether the Adaptive Body Biasing (ABB) domains are present.

NRF_POWER_HAS_BLOCK_MODES

Symbol indicating whether the power block modes are present.

NRF_POWER_HAS_BILS

Symbol indicating whether the Built-in Leakage Sensors (BILS) are present.

NRF_POWER_HAS_PMIC

Symbol indicating whether the Power Management IC (PMIC) is present.

NRF_POWER_EVENTS_ABB_LOCK_COUNT

Symbol specifying the maximum number of available ABB_LOCK events.

Enums

enum nrf_power_task_t

POWER tasks.

Values:

enumerator NRF_POWER_TASK_CONSTLAT

Enable constant latency mode.

enumerator NRF_POWER_TASK_LOWPWR

Enable low-power mode (variable latency).

enumerator NRF_POWER_TASK_SEMAPHORE_ACQUIRE

Acquire the semaphore for regulator voltage scaling procedure.

enumerator NRF_POWER_TASK_SEMAPHORE_RELEASE

Release the semaphore for regulator voltage scaling procedure.

enumerator NRF_POWER_TASK_REGULATOR_UPDATE

Update the regulator configuration.

enum nrf_power_event_t

POWER events.

Values:

enumerator NRF_POWER_EVENT_POFWARN

Power failure warning.

enumerator NRF_POWER_EVENT_SLEEPENTER

CPU entered WFI/WFE sleep mode.

enumerator NRF_POWER_EVENT_SLEEPEXIT

CPU exited WFI/WFE sleep mode.

enumerator NRF_POWER_EVENT_USBDETECTED

Voltage supply detected on VBUS.

enumerator NRF_POWER_EVENT_USBREMOVED

Voltage supply removed from VBUS.

enumerator NRF_POWER_EVENT_USBPWRRDY

USB 3.3 V supply ready.

enumerator NRF_POWER_EVENT_SEMAPHORE_ACQUIRED

Acquired the semaphore for regulator voltage scaling procedure.

enumerator NRF_POWER_EVENT_SEMAPHORE_RELEASED

Released the semaphore for regulator voltage scaling procedure.

enumerator NRF_POWER_EVENT_REGULATOR_UPDATED

Updated the regulator configuration.

enumerator NRF_POWER_EVENT_ABB_LOCK_0

ABB lock for the ABB domain 0.

enumerator NRF_POWER_EVENT_ABB_LOCK_1

ABB lock for the ABB domain 1.

enum nrf_power_int_mask_t

POWER interrupts.

Values:

enumerator NRF_POWER_INT_POFWARN_MASK

Write ‘1’ to enable interrupt for POFWARN event.

enumerator NRF_POWER_INT_SLEEPENTER_MASK

Write ‘1’ to enable interrupt for SLEEPENTER event.

enumerator NRF_POWER_INT_SLEEPEXIT_MASK

Write ‘1’ to enable interrupt for SLEEPEXIT event.

enumerator NRF_POWER_INT_USBDETECTED_MASK

Write ‘1’ to enable interrupt for USBDETECTED event.

enumerator NRF_POWER_INT_USBREMOVED_MASK

Write ‘1’ to enable interrupt for USBREMOVED event.

enumerator NRF_POWER_INT_USBPWRRDY_MASK

Write ‘1’ to enable interrupt for USBPWRRDY event.

enumerator NRF_POWER_INT_SEMAPHORE_ACQUIRED

Write ‘1’ to enable interrupt for SEMAPHORE_ACQUIRED event.

enumerator NRF_POWER_INT_SEMAPHORE_RELEASED

Write ‘1’ to enable interrupt for SEMAPHORE_RELEASED event.

enumerator NRF_POWER_INT_REGULATOR_UPDATED

Write ‘1’ to enable interrupt for REGULATOR_UPDATED event.

enumerator NRF_POWER_INT_ABB_LOCK_0

Write ‘1’ to enable interrupt for ABB_LOCK_0 event.

enumerator NRF_POWER_INT_ABB_LOCK_1

Write ‘1’ to enable interrupt for ABB_LOCK_1 event.

enum nrf_power_resetreas_mask_t

Reset reason.

Values:

enumerator NRF_POWER_RESETREAS_RESETPIN_MASK

Bit mask of RESETPIN field.

enumerator NRF_POWER_RESETREAS_DOG_MASK

Bit mask of DOG field.

enumerator NRF_POWER_RESETREAS_SREQ_MASK

Bit mask of SREQ field.

enumerator NRF_POWER_RESETREAS_LOCKUP_MASK

Bit mask of LOCKUP field.

enumerator NRF_POWER_RESETREAS_OFF_MASK

Bit mask of OFF field.

enumerator NRF_POWER_RESETREAS_LPCOMP_MASK

Bit mask of LPCOMP field.

enumerator NRF_POWER_RESETREAS_DIF_MASK

Bit mask of DIF field.

enumerator NRF_POWER_RESETREAS_NFC_MASK

Bit mask of NFC field.

enumerator NRF_POWER_RESETREAS_VBUS_MASK

Bit mask of VBUS field.

enum nrf_power_usbregstatus_mask_t

USBREGSTATUS register bit masks.

Values:

enumerator NRF_POWER_USBREGSTATUS_VBUSDETECT_MASK

USB detected or removed.

enumerator NRF_POWER_USBREGSTATUS_OUTPUTRDY_MASK

USB 3.3 V supply ready.

enum nrf_power_ramblock_t

Numbers of RAM blocks.

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.

Values:

enumerator NRF_POWER_RAMBLOCK0
enumerator NRF_POWER_RAMBLOCK1
enumerator NRF_POWER_RAMBLOCK2
enumerator NRF_POWER_RAMBLOCK3
enum nrf_power_ramblock_mask_t

Masks of RAM blocks.

Values:

enumerator NRF_POWER_RAMBLOCK0_MASK
enumerator NRF_POWER_RAMBLOCK1_MASK
enumerator NRF_POWER_RAMBLOCK2_MASK
enumerator NRF_POWER_RAMBLOCK3_MASK
enum nrf_power_onoffram_t

RAM power state position of the bits.

Values:

enumerator NRF_POWER_ONRAM0

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

enumerator NRF_POWER_OFFRAM0

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

enumerator NRF_POWER_ONRAM1

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

enumerator NRF_POWER_OFFRAM1

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

enumerator NRF_POWER_ONRAM2

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

enumerator NRF_POWER_OFFRAM2

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

enumerator NRF_POWER_ONRAM3

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

enumerator NRF_POWER_OFFRAM3

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

enum nrf_power_onoffram_mask_t

RAM power state bit masks.

Values:

enumerator NRF_POWER_ONRAM0_MASK

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

enumerator NRF_POWER_OFFRAM0_MASK

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

enumerator NRF_POWER_ONRAM1_MASK

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

enumerator NRF_POWER_OFFRAM1_MASK

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

enumerator NRF_POWER_ONRAM2_MASK

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

enumerator NRF_POWER_OFFRAM2_MASK

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

enumerator NRF_POWER_ONRAM3_MASK

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

enumerator NRF_POWER_OFFRAM3_MASK

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

enum nrf_power_pof_thr_t

Power failure comparator thresholds.

Values:

enumerator NRF_POWER_POFTHR_V21

Set threshold to 2.1 V.

enumerator NRF_POWER_POFTHR_V23

Set threshold to 2.3 V.

enumerator NRF_POWER_POFTHR_V25

Set threshold to 2.5 V.

enumerator NRF_POWER_POFTHR_V27

Set threshold to 2.7 V.

enumerator NRF_POWER_POFTHR_V17

Set threshold to 1.7 V.

enumerator NRF_POWER_POFTHR_V18

Set threshold to 1.8 V.

enumerator NRF_POWER_POFTHR_V19

Set threshold to 1.9 V.

enumerator NRF_POWER_POFTHR_V20

Set threshold to 2.0 V.

enumerator NRF_POWER_POFTHR_V22

Set threshold to 2.2 V.

enumerator NRF_POWER_POFTHR_V24

Set threshold to 2.4 V.

enumerator NRF_POWER_POFTHR_V26

Set threshold to 2.6 V.

enumerator NRF_POWER_POFTHR_V28

Set threshold to 2.8 V.

enum nrf_power_pof_thrvddh_t

Power failure comparator thresholds for VDDH.

Values:

enumerator NRF_POWER_POFTHRVDDH_V27

Set threshold to 2.7 V.

enumerator NRF_POWER_POFTHRVDDH_V28

Set threshold to 2.8 V.

enumerator NRF_POWER_POFTHRVDDH_V29

Set threshold to 2.9 V.

enumerator NRF_POWER_POFTHRVDDH_V30

Set threshold to 3.0 V.

enumerator NRF_POWER_POFTHRVDDH_V31

Set threshold to 3.1 V.

enumerator NRF_POWER_POFTHRVDDH_V32

Set threshold to 3.2 V.

enumerator NRF_POWER_POFTHRVDDH_V33

Set threshold to 3.3 V.

enumerator NRF_POWER_POFTHRVDDH_V34

Set threshold to 3.4 V.

enumerator NRF_POWER_POFTHRVDDH_V35

Set threshold to 3.5 V.

enumerator NRF_POWER_POFTHRVDDH_V36

Set threshold to 3.6 V.

enumerator NRF_POWER_POFTHRVDDH_V37

Set threshold to 3.7 V.

enumerator NRF_POWER_POFTHRVDDH_V38

Set threshold to 3.8 V.

enumerator NRF_POWER_POFTHRVDDH_V39

Set threshold to 3.9 V.

enumerator NRF_POWER_POFTHRVDDH_V40

Set threshold to 4.0 V.

enumerator NRF_POWER_POFTHRVDDH_V41

Set threshold to 4.1 V.

enumerator NRF_POWER_POFTHRVDDH_V42

Set threshold to 4.2 V.

enum nrf_power_mainregstatus_t

Main regulator status.

Values:

enumerator NRF_POWER_MAINREGSTATUS_NORMAL

Normal voltage mode. Voltage supplied on VDD.

enumerator NRF_POWER_MAINREGSTATUS_HIGH

High voltage mode. Voltage supplied on VDDH.

enum nrf_power_rampower_t

Bit positions for RAMPOWER register.

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

Values:

enumerator NRF_POWER_RAMPOWER_S0POWER

Keep RAM section S0 ON in System ON mode

enumerator NRF_POWER_RAMPOWER_S1POWER

Keep RAM section S1 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S2POWER

Keep RAM section S2 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S3POWER

Keep RAM section S3 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S4POWER

Keep RAM section S4 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S5POWER

Keep RAM section S5 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S6POWER

Keep RAM section S6 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S7POWER

Keep RAM section S7 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S8POWER

Keep RAM section S8 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S9POWER

Keep RAM section S9 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S10POWER

Keep RAM section S10 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S11POWER

Keep RAM section S11 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S12POWER

Keep RAM section S12 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S13POWER

Keep RAM section S13 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S14POWER

Keep RAM section S14 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S15POWER

Keep RAM section S15 ON in System ON mode.

enumerator NRF_POWER_RAMPOWER_S0RETENTION

Keep section retention in OFF mode when section is OFF

enumerator NRF_POWER_RAMPOWER_S1RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S2RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S3RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S4RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S5RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S6RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S7RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S8RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S9RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S10RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S11RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S12RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S13RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S14RETENTION

Keep section retention in OFF mode when section is OFF.

enumerator NRF_POWER_RAMPOWER_S15RETENTION

Keep section retention in OFF mode when section is OFF.

enum nrf_power_rampower_mask_t

Bit masks for RAMPOWER register.

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

Values:

enumerator NRF_POWER_RAMPOWER_S0POWER_MASK
enumerator NRF_POWER_RAMPOWER_S1POWER_MASK
enumerator NRF_POWER_RAMPOWER_S2POWER_MASK
enumerator NRF_POWER_RAMPOWER_S3POWER_MASK
enumerator NRF_POWER_RAMPOWER_S4POWER_MASK
enumerator NRF_POWER_RAMPOWER_S5POWER_MASK
enumerator NRF_POWER_RAMPOWER_S7POWER_MASK
enumerator NRF_POWER_RAMPOWER_S8POWER_MASK
enumerator NRF_POWER_RAMPOWER_S9POWER_MASK
enumerator NRF_POWER_RAMPOWER_S10POWER_MASK
enumerator NRF_POWER_RAMPOWER_S11POWER_MASK
enumerator NRF_POWER_RAMPOWER_S12POWER_MASK
enumerator NRF_POWER_RAMPOWER_S13POWER_MASK
enumerator NRF_POWER_RAMPOWER_S14POWER_MASK
enumerator NRF_POWER_RAMPOWER_S15POWER_MASK
enumerator NRF_POWER_RAMPOWER_S0RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S1RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S2RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S3RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S4RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S5RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S7RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S8RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S9RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S10RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S11RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S12RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S13RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S14RETENTION_MASK
enumerator NRF_POWER_RAMPOWER_S15RETENTION_MASK
enum nrf_power_vreg_mask_t

POWER voltage regulators bit masks.

Values:

enumerator NRF_POWER_VREG_1V8_MASK

1.8 V regulator.

enumerator NRF_POWER_VREG_1V0_MASK

1.0 V regulator.

enumerator NRF_POWER_VREG_0V8_MASK

0.8 V regulator.

enumerator NRF_POWER_VREG_VS_MASK

Voltage scaled regulator.

enumerator NRF_POWER_VREG_MAIN1V8_MASK

1.8 V rail at VREGMAIN regulator.

enumerator NRF_POWER_VREG_MAIN1V0_MASK

1.0 V rail at VREGMAIN regulator.

enumerator NRF_POWER_VREG_MAINVS_MASK

Voltage scaled rail at VREGMAIN regulator.

enumerator NRF_POWER_VREG_FORCE_MASK

Force the regulator enable configuration.

enum nrf_power_op_point_t

POWER operating points for ABB domain.

Values:

enumerator NRF_POWER_OP_POINT_0V4

Operating point 0.4 V.

enumerator NRF_POWER_OP_POINT_0V5

Operating point 0.5 V.

enumerator NRF_POWER_OP_POINT_0V6

Operating point 0.6 V.

enumerator NRF_POWER_OP_POINT_0V8

Operating point 0.8 V.

enum nrf_power_override_value_t

POWER operating points for ABB domain.

Values:

enumerator NRF_POWER_OVERRIDE_VALUE_POWER_DOWN

ABB analog macro powered down.

enumerator NRF_POWER_OVERRIDE_VALUE_POWER_UP

ABB analog macro powered up.

Functions

NRF_STATIC_INLINE void nrf_power_task_trigger(NRF_POWER_Type *p_reg, nrf_power_task_t task)

Function for activating a specific POWER task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task.

NRF_STATIC_INLINE uint32_t nrf_power_task_address_get(NRF_POWER_Type const *p_reg, nrf_power_task_t task)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task.

Returns:

Task address.

NRF_STATIC_INLINE void nrf_power_event_clear(NRF_POWER_Type *p_reg, nrf_power_event_t event)

Function for clearing a specific event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event.

NRF_STATIC_INLINE bool nrf_power_event_check(NRF_POWER_Type const *p_reg, nrf_power_event_t event)

Function for retrieving the state of the POWER event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to be checked.

Return values:
  • true – The event has been generated.

  • false – The event has not been generated.

NRF_STATIC_INLINE bool nrf_power_event_get_and_clear(NRF_POWER_Type *p_reg, 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event.

Return values:
  • true – The event was set.

  • false – The event was not set.

NRF_STATIC_INLINE uint32_t nrf_power_event_address_get(NRF_POWER_Type const *p_reg, nrf_power_event_t event)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event.

Returns:

Address.

NRF_STATIC_INLINE void nrf_power_int_enable(NRF_POWER_Type *p_reg, uint32_t mask)

Function for enabling selected interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be enabled. Use nrf_power_int_mask_t values for bit masking.

NRF_STATIC_INLINE uint32_t nrf_power_int_enable_check(NRF_POWER_Type const *p_reg, uint32_t mask)

Function for checking if the specified interrupts are enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be checked. Use nrf_power_int_mask_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_power_int_enable_get(NRF_POWER_Type const *p_reg)

Function for retrieving the information about enabled interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The flags of enabled interrupts.

NRF_STATIC_INLINE void nrf_power_int_disable(NRF_POWER_Type *p_reg, uint32_t mask)

Function for disabling selected interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be disabled. Use nrf_power_int_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_power_subscribe_set(NRF_POWER_Type *p_reg, nrf_power_task_t task, uint8_t channel)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task for which to set the configuration.

  • channel[in] Channel through which to subscribe events.

NRF_STATIC_INLINE void nrf_power_subscribe_clear(NRF_POWER_Type *p_reg, nrf_power_task_t task)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task for which to clear the configuration.

NRF_STATIC_INLINE void nrf_power_publish_set(NRF_POWER_Type *p_reg, nrf_power_event_t event, uint8_t channel)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event for which to set the configuration.

  • channel[in] Channel through which to publish the event.

NRF_STATIC_INLINE void nrf_power_publish_clear(NRF_POWER_Type *p_reg, nrf_power_event_t event)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event for which to clear the configuration.

NRF_STATIC_INLINE uint32_t nrf_power_resetreas_get(NRF_POWER_Type const *p_reg)

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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The mask of reset reasons constructed with nrf_power_resetreas_mask_t.

NRF_STATIC_INLINE void nrf_power_resetreas_clear(NRF_POWER_Type *p_reg, uint32_t mask)

Function for clearing the selected reset reason field.

This function clears the selected reset reason field.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] The mask constructed from nrf_power_resetreas_mask_t enumerator values.

NRF_STATIC_INLINE bool nrf_power_powerstatus_get(NRF_POWER_Type const *p_reg)

Function for getting power status of the LTE Modem domain.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – The LTE Modem domain is powered on.

  • false – The LTE Modem domain is powered off.

NRF_STATIC_INLINE uint32_t nrf_power_ramstatus_get(NRF_POWER_Type const *p_reg)

Function for getting the RAMSTATUS register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Value with bits set according to the masks in nrf_power_ramblock_mask_t.

NRF_STATIC_INLINE void nrf_power_pofcon_set(NRF_POWER_Type *p_reg, bool enable, nrf_power_pof_thr_t thr)

Function for setting the power failure comparator configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if the power failure comparator is to be enabled, false otherwise.

  • thr[in] Voltage threshold value.

NRF_STATIC_INLINE nrf_power_pof_thr_t nrf_power_pofcon_get(NRF_POWER_Type const *p_reg, bool *p_enabled)

Function for getting the power failure comparator configuration.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_enabled[out] Function 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.

NRF_STATIC_INLINE void nrf_power_pofcon_vddh_set(NRF_POWER_Type *p_reg, nrf_power_pof_thrvddh_t thr)

Function for setting the VDDH power failure comparator threshold.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • thr[in] Threshold to be set.

NRF_STATIC_INLINE nrf_power_pof_thrvddh_t nrf_power_pofcon_vddh_get(NRF_POWER_Type const *p_reg)

Function for getting the VDDH power failure comparator threshold.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

VDDH threshold currently configured.

NRF_STATIC_INLINE void nrf_power_gpregret_set(NRF_POWER_Type *p_reg, uint8_t val)

Function for setting the general purpose retention register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • val[in] Value to be set in the register.

NRF_STATIC_INLINE uint8_t nrf_power_gpregret_get(NRF_POWER_Type const *p_reg)

Function for getting general purpose retention register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The value from the register.

NRF_STATIC_INLINE void nrf_power_gpregret2_set(NRF_POWER_Type *p_reg, uint8_t val)

Function for setting the general purpose retention register 2.

Note

This register is not available in the nRF51 MCU family.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • val[in] Value to be set in the register.

NRF_STATIC_INLINE uint8_t nrf_power_gpregret2_get(NRF_POWER_Type const *p_reg)

Function for getting the general purpose retention register 2.

Note

This register is not available in all MCUs.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The value from the register.

NRF_STATIC_INLINE uint8_t nrf_power_gpregret_ext_get(NRF_POWER_Type const *p_reg, uint8_t reg_num)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • reg_num[in] General purpose retention register number.

Returns:

The value from the register

NRF_STATIC_INLINE void nrf_power_gpregret_ext_set(NRF_POWER_Type *p_reg, uint8_t reg_num, uint8_t val)

Function for setting particular general purpose retention register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • reg_num[in] General purpose retention register number.

  • val[in] Value to be set in the register

NRF_STATIC_INLINE void nrf_power_dcdcen_set(NRF_POWER_Type *p_reg, 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if DCDC converter is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_dcdcen_get(NRF_POWER_Type const *p_reg)

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).

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – Converter is enabled.

  • false – Converter is disabled.

NRF_STATIC_INLINE void nrf_power_rampower_mask_on(NRF_POWER_Type *p_reg, 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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • block[in] RAM block index.

  • section_mask[in] Mask of the sections created by merging nrf_power_rampower_mask_t flags.

NRF_STATIC_INLINE void nrf_power_rampower_mask_off(NRF_POWER_Type *p_reg, 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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • block[in] RAM block index.

  • section_mask[in] Mask of the sections created by merging nrf_power_rampower_mask_t flags.

NRF_STATIC_INLINE uint32_t nrf_power_rampower_mask_get(NRF_POWER_Type const *p_reg, uint8_t block)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • block[in] RAM block index.

Returns:

Mask of sections state composed from nrf_power_rampower_mask_t flags.

NRF_STATIC_INLINE void nrf_power_dcdcen_vddh_set(NRF_POWER_Type *p_reg, bool enable)

Function for enabling or disabling the DCDC converter on VDDH.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if DCDC converter on VDDH is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_dcdcen_vddh_get(NRF_POWER_Type const *p_reg)

Function for getting the state of DCDC converter on VDDH.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – Converter is enabled.

  • false – Converter is disabled.

NRF_STATIC_INLINE nrf_power_mainregstatus_t nrf_power_mainregstatus_get(NRF_POWER_Type const *p_reg)

Function for getting the main supply status.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The current main supply status.

NRF_STATIC_INLINE uint32_t nrf_power_usbregstatus_get(NRF_POWER_Type const *p_reg)

Function for getting the whole USBREGSTATUS register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

The USBREGSTATUS register value. Use nrf_power_usbregstatus_mask_t values for bit masking.

NRF_STATIC_INLINE bool nrf_power_usbregstatus_vbusdet_get(NRF_POWER_Type const *p_reg)

Function for getting the VBUS input detection status.

USBDETECTED and USBREMOVED events are derived from this information

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • false – VBUS voltage below valid threshold.

  • true – VBUS voltage above valid threshold.

NRF_STATIC_INLINE bool nrf_power_usbregstatus_outrdy_get(NRF_POWER_Type const *p_reg)

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

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • false – USBREG output settling time not elapsed.

  • true – USBREG output settling time elapsed (same information as USBPWRRDY event).

NRF_STATIC_INLINE bool nrf_power_abb_busy_check(NRF_POWER_Type const *p_reg, uint8_t domain_idx)

Function for checking whether the specified ABB domain is busy.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • domain_idx[in] Index of ABB domain.

Return values:
  • true – The ABB is busy with applying the new operating point.

  • false – The ABB is ready to accept the new operating point.

NRF_STATIC_INLINE void nrf_power_abb_config_set(NRF_POWER_Type *p_reg, uint8_t domain_idx, nrf_power_abb_config_t const *p_config)

Function for setting configuration of the operating point for the specified ABB domain.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • domain_idx[in] Index of ABB domain.

  • p_config[in] Pointer to the structure with configuration to be set.

NRF_STATIC_INLINE void nrf_power_abb_config_get(NRF_POWER_Type const *p_reg, uint8_t domain_idx, nrf_power_abb_config_t *p_config)

Function for getting configuration of the operating point for the specified ABB domain.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • domain_idx[in] Index of ABB domain.

  • p_config[in] Pointer to the structure with configuration to be set.

NRF_STATIC_INLINE void nrf_power_abb_force_lock_set(NRF_POWER_Type *p_reg, uint8_t domain_idx, bool enable)

Function for setting the force lock for the specified ABB domain.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • domain_idx[in] Index of ABB domain.

  • enable[in] True if force lock is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_abb_force_lock_check(NRF_POWER_Type const *p_reg, uint8_t domain_idx)

Function for checking if the force lock for the specified ABB domain is enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • domain_idx[in] Index of ABB domain whose status is checked.

Return values:
  • true – Force lock is enabled.

  • false – Force lock is disabled.

NRF_STATIC_INLINE void nrf_power_vreg_enable(NRF_POWER_Type *p_reg, uint32_t mask)

Function for enabling specified voltage regulator.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of voltage regulators to be enabled. Use nrf_power_vreg_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_power_vreg_disable(NRF_POWER_Type *p_reg, uint32_t mask)

Function for disabling specified voltage regulator.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of voltage regulators to be disabled. Use nrf_power_vreg_mask_t values for bit masking.

NRF_STATIC_INLINE uint32_t nrf_power_vreg_enable_check(NRF_POWER_Type const *p_reg, uint32_t mask)

Function for checking if the specified voltage regulator is enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of voltage regulator to be checked. Use nrf_power_vreg_mask_t values for bit masking.

Returns:

Mask of enabled voltage regulators.

NRF_STATIC_INLINE void nrf_power_ulp_mode_set(NRF_POWER_Type *p_reg, bool enable)

Function for setting the Ultra Low Power (ULP) mode.

Note

Going into ULP mode is allowed only if this mode is enabled - otherwise it is blocked. If the ULV mode is blocked, the ULP mode is also blocked.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if ULP mode is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_ulp_mode_check(NRF_POWER_Type const *p_reg)

Function for checking if the ULP mode is enabled.

Note

Going into ULP mode is allowed only if this mode is enabled - otherwise it is blocked. If the ULV mode is blocked, the ULP mode is also blocked.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – ULP mode is enabled.

  • false – ULP mode is disabled.

NRF_STATIC_INLINE void nrf_power_ulv_mode_set(NRF_POWER_Type *p_reg, bool enable)

Function for setting the Ultra Low Voltage (ULV) mode.

Note

Going into ULP mode is allowed only if this mode is enabled - otherwise it is blocked. If the ULV mode is blocked, the ULP mode is also blocked.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if ULV mode is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_ulv_mode_check(NRF_POWER_Type const *p_reg)

Function for checking if the ULV mode is enabled.

Note

Going into ULP mode is allowed only if this mode is enabled - otherwise it is blocked. If the ULV mode is blocked, the ULP mode is also blocked.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – ULV mode is enabled.

  • false – ULV mode is disabled.

NRF_STATIC_INLINE bool nrf_power_sem_status_get(NRF_POWER_Type const *p_reg)

Function for getting the POWER semaphore status.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – Semaphore is acquired.

  • false – Semaphore is released.

NRF_STATIC_INLINE void nrf_power_bils_set(NRF_POWER_Type *p_reg, bool enable)

Function for setting BILS instances.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if all configured BILS instances are to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_bils_check(NRF_POWER_Type const *p_reg)

Function for checking if BILS instances are enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – All configured BILS instances are enabled.

  • false – All BILS instances are disabled.

NRF_STATIC_INLINE void nrf_power_pmic_set(NRF_POWER_Type *p_reg, bool enable)

Function for setting the PMIC interface.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if PMIC interface is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_power_pmic_check(NRF_POWER_Type const *p_reg)

Function for checking if the PMIC interface is enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – PMIC interface is enabled.

  • false – PMIC interface is disabled.

struct nrf_power_abb_config_t
#include <nrf_power.h>

POWER operating point for ABB domain structure.

Public Members

nrf_power_op_point_t op_point

ABB operating point.

nrf_power_override_value_t override_value

Override value of ABB analog macro powerup signal.

Value is applied only if override_enable is enabled.

bool override_enable

True if the override of ABB analog macro signal is to be applied, false otherwise.