REGULATORS HAL

group nrf_regulators_hal

Hardware access layer for managing the REGULATORS peripheral.

Defines

NRF_REGULATORS_HAS_VREG_HIGH

Symbol indicating whether high voltage regulator (VREGH) is present.

NRF_REGULATORS_HAS_VREG_MEDIUM

Symbol indicating whether medium voltage regulator (VREGM) is present.

NRF_REGULATORS_HAS_VREG_RADIO

Symbol indicating whether radio regulator (VREGRADIO) is present.

NRF_REGULATORS_HAS_POF

Symbol indicating whether Power-On-Fail Comparator (POF Comparator) is present.

NRF_REGULATORS_HAS_POF_VDDH

Symbol indicating whether POF Comparator for VDDH is present.

NRF_REGULATORS_HAS_POF_WARN_DISABLE

Symbol indicating whether POF Comparator can disable POFWARN event.

NRF_REGULATORS_HAS_POF_STATUS

Symbol indicating whether POF Comparator status is present.

NRF_REGULATORS_HAS_TRIM

Symbol indicating whether TRIM register is present.

NRF_REGULATORS_HAS_MAIN_STATUS

Symbol indicating whether main supply status is present.

NRF_REGULATORS_HAS_INDUCTOR_DET

Symbol indicating whether inductor detection is present.

Enums

enum nrf_regulators_vreg_t

Voltage regulators.

Values:

enumerator NRF_REGULATORS_VREG_MAIN

Main voltage regulator (VREGMAIN).

enumerator NRF_REGULATORS_VREG_HIGH

High voltage regulator (VREGH).

enumerator NRF_REGULATORS_VREG_MEDIUM

Medium voltage regulator (VREGM).

enumerator NRF_REGULATORS_VREG_RADIO

Radio voltage regulator (VREGRADIO).

enum nrf_regulators_pof_thr_t

POF Comparator thresholds.

Values:

enumerator NRF_REGULATORS_POF_THR_1V7

Set threshold to 1.7 V.

enumerator NRF_REGULATORS_POF_THR_1V8

Set threshold to 1.8 V.

enumerator NRF_REGULATORS_POF_THR_1V9

Set threshold to 1.9 V.

enumerator NRF_REGULATORS_POF_THR_2V0

Set threshold to 2.0 V.

enumerator NRF_REGULATORS_POF_THR_2V1

Set threshold to 2.1 V.

enumerator NRF_REGULATORS_POF_THR_2V2

Set threshold to 2.2 V.

enumerator NRF_REGULATORS_POF_THR_2V3

Set threshold to 2.3 V.

enumerator NRF_REGULATORS_POF_THR_2V4

Set threshold to 2.4 V.

enumerator NRF_REGULATORS_POF_THR_2V5

Set threshold to 2.5 V.

enumerator NRF_REGULATORS_POF_THR_2V6

Set threshold to 2.6 V.

enumerator NRF_REGULATORS_POF_THR_2V7

Set threshold to 2.7 V.

enumerator NRF_REGULATORS_POF_THR_2V8

Set threshold to 2.8 V.

enum nrf_regulators_pof_thr_vddh_t

POF Comparator thresholds for VDDH.

Values:

enumerator NRF_REGULATORS_POF_THR_VDDH_2V7

Set threshold to 2.7 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_2V8

Set threshold to 2.8 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_2V9

Set threshold to 2.9 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V0

Set threshold to 3.0 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V1

Set threshold to 3.1 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V2

Set threshold to 3.2 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V3

Set threshold to 3.3 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V4

Set threshold to 3.4 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V5

Set threshold to 3.5 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V6

Set threshold to 3.6 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V7

Set threshold to 3.7 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V8

Set threshold to 3.8 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_3V9

Set threshold to 3.9 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_4V0

Set threshold to 4.0 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_4V1

Set threshold to 4.1 V.

enumerator NRF_REGULATORS_POF_THR_VDDH_4V2

Set threshold to 4.2 V.

enum nrf_regulators_elv_mode_allow_mask_t

Components allowed to introduce ELV mode.

Values:

enumerator NRF_REGULATORS_ELV_MODE_ALLOW_MASK_EXT

Reserved. For internal use only.

enum nrf_regulators_main_status_t

Main supply status.

Values:

enumerator NRF_REGULATORS_MAIN_STATUS_NORMAL

Normal voltage mode. Voltage supplied on VDD and VDDH.

enumerator NRF_REGULATORS_MAIN_STATUS_HIGH

High voltage mode. Voltage supplied on VDDH.

Functions

NRF_STATIC_INLINE void nrf_regulators_vreg_enable_set(NRF_REGULATORS_Type *p_reg, nrf_regulators_vreg_t regulator, bool enable)

Function for enabling or disabling the specified voltage regulator.

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

  • regulator[in] Regulator to be enabled or disabled.

  • enable[in] True if specified voltage regulator is to be enabled, false otherwise.

NRF_STATIC_INLINE bool nrf_regulators_vreg_enable_check(NRF_REGULATORS_Type const *p_reg, nrf_regulators_vreg_t regulator)

Function for checking whether the specified voltage regulator is enabled.

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

  • regulator[in] Regulator to be checked.

Return values:
  • true – Specified voltage regulator is enabled.

  • false – Specified voltage regulator is disabled.

NRF_STATIC_INLINE void nrf_regulators_system_off(NRF_REGULATORS_Type *p_reg)

Function for putting the CPU in System OFF mode.

Note

This function never returns.

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

NRF_STATIC_INLINE nrf_regulators_main_status_t nrf_regulators_main_status_get(NRF_REGULATORS_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 void nrf_regulators_pof_config_set(NRF_REGULATORS_Type *p_reg, nrf_regulators_pof_config_t const *p_config)

Function for setting the POF Comparator configuration.

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

  • p_config[in] Pointer to the structure containing POF Comparator configuration.

NRF_STATIC_INLINE void nrf_regulators_pof_config_get(NRF_REGULATORS_Type const *p_reg, nrf_regulators_pof_config_t *p_config)

Function for getting the POF Comparator configuration.

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

  • p_config[out] Pointer to the structure to be filled with POF Comparator configuration.

NRF_STATIC_INLINE bool nrf_regulators_pof_below_thr_check(NRF_REGULATORS_Type const *p_reg)

Function for checking if the detected voltage is below or above the threshold of VPOF (POF Comparator’s threshold voltage).

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

Return values:
  • true – Voltage below VPOF threshold has been detected.

  • false – Voltage above VPOF threshold has been detected.

NRF_STATIC_INLINE void nrf_regulators_elv_mode_allow_set(NRF_REGULATORS_Type *p_reg, uint32_t mask)

Function for setting components that are allowed to introduce the ELV mode.

Warning

This register is retained when retention is enabled.

Parameters:
NRF_STATIC_INLINE uint32_t nrf_regulators_elv_mode_allow_get(NRF_REGULATORS_Type const *p_reg)

Function for geting components that are allowed to introduce the ELV mode.

Warning

This register is retained when retention is enabled.

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

Returns:

Mask of components allowed to introduce ELV mode, created using nrf_regulators_elv_mode_allow_mask_t.

NRF_STATIC_INLINE bool nrf_regulators_inductor_check(NRF_REGULATORS_Type const *p_reg)

Function for checking whether an inductor is connected to the DCC pin.

Note

The detection can only take place if the VREG_MAIN DC/DC converter is not enabled.

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

Return values:
  • true – Inductor detected.

  • false – Inductor not detected.

struct nrf_regulators_pof_config_t
#include <nrf_regulators.h>

POF Comparator configuration structure.

Public Members

bool enable

Enable or disable POF Comparator.

nrf_regulators_pof_thr_t thr

Threshold to be set for POF Comparator.

nrf_regulators_pof_thr_vddh_t thr_vddh

Threshold to be set for POF Comparator for VDDH.

bool warn_disable

Disable or enable POFWARN event.