REGULATORS HAL

group nrf_regulators_hal

Hardware access layer for managing the REGULATORS peripheral.

Defines

NRF_REGULATORS_HAS_MAINREGSTATUS

Symbol indicating whether MAINREGSTATUS register is present.

NRF_REGULATORS_HAS_POFCON

Symbol indicating whether power failure comparator is present.

NRF_REGULATORS_HAS_POFCON_VDDH

Symbol indicating whether power failure comparator for VDDH is present.

NRF_REGULATORS_HAS_DCDCEN_VDDH

Symbol indicating whether high voltage regulator is present.

NRF_REGULATORS_HAS_DCDCEN_RADIO

Symbol indicating whether radio regulator is present.

Enums

enum nrf_regulators_mainregstatus_t

Main regulator status.

Values:

enumerator NRF_REGULATORS_MAINREGSTATUS_NORMAL

Normal voltage mode. Voltage supplied on VDD and VDDH.

enumerator NRF_REGULATORS_MAINREGSTATUS_HIGH

High voltage mode. Voltage supplied on VDDH.

enum nrf_regulators_pof_thr_t

Power failure comparator thresholds.

Values:

enumerator NRF_REGULATORS_POFTHR_V19

Set threshold to 1.9V.

enumerator NRF_REGULATORS_POFTHR_V20

Set threshold to 2.0V.

enumerator NRF_REGULATORS_POFTHR_V21

Set threshold to 2.1V.

enumerator NRF_REGULATORS_POFTHR_V22

Set threshold to 2.2V.

enumerator NRF_REGULATORS_POFTHR_V23

Set threshold to 2.3V.

enumerator NRF_REGULATORS_POFTHR_V24

Set threshold to 2.4V.

enumerator NRF_REGULATORS_POFTHR_V25

Set threshold to 2.5V.

enumerator NRF_REGULATORS_POFTHR_V26

Set threshold to 2.6V.

enumerator NRF_REGULATORS_POFTHR_V27

Set threshold to 2.7V.

enumerator NRF_REGULATORS_POFTHR_V28

Set threshold to 2.8V.

enum nrf_regulators_pof_thrvddh_t

Power failure comparator thresholds for VDDH.

Values:

enumerator NRF_REGULATORS_POFTHRVDDH_V27

Set threshold to 2.7V.

enumerator NRF_REGULATORS_POFTHRVDDH_V28

Set threshold to 2.8V.

enumerator NRF_REGULATORS_POFTHRVDDH_V29

Set threshold to 2.9V.

enumerator NRF_REGULATORS_POFTHRVDDH_V30

Set threshold to 3.0V.

enumerator NRF_REGULATORS_POFTHRVDDH_V31

Set threshold to 3.1V.

enumerator NRF_REGULATORS_POFTHRVDDH_V32

Set threshold to 3.2V.

enumerator NRF_REGULATORS_POFTHRVDDH_V33

Set threshold to 3.3V.

enumerator NRF_REGULATORS_POFTHRVDDH_V34

Set threshold to 3.4V.

enumerator NRF_REGULATORS_POFTHRVDDH_V35

Set threshold to 3.5V.

enumerator NRF_REGULATORS_POFTHRVDDH_V36

Set threshold to 3.6V.

enumerator NRF_REGULATORS_POFTHRVDDH_V37

Set threshold to 3.7V.

enumerator NRF_REGULATORS_POFTHRVDDH_V38

Set threshold to 3.8V.

enumerator NRF_REGULATORS_POFTHRVDDH_V39

Set threshold to 3.9V.

enumerator NRF_REGULATORS_POFTHRVDDH_V40

Set threshold to 4.0V.

enumerator NRF_REGULATORS_POFTHRVDDH_V41

Set threshold to 4.1V.

enumerator NRF_REGULATORS_POFTHRVDDH_V42

Set threshold to 4.2V.

Functions

NRF_STATIC_INLINE void nrf_regulators_dcdcen_set(NRF_REGULATORS_Type *p_reg, bool enable)

Function for enabling or disabling DCDC converter.

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 void nrf_regulators_system_off(NRF_REGULATORS_Type *p_reg)

Function for putting CPU in system OFF mode.

This function puts the CPU into system off mode. The only way to wake up the CPU is by reset.

Note

This function never returns.

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

NRF_STATIC_INLINE nrf_regulators_mainregstatus_t nrf_regulators_mainregstatus_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_pofcon_set(NRF_REGULATORS_Type *p_reg, bool enable, nrf_regulators_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 power failure comparator is to be enabled, false otherwise.

  • thr[in] Voltage threshold value.

NRF_STATIC_INLINE nrf_regulators_pof_thr_t nrf_regulators_pofcon_get(NRF_REGULATORS_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_regulators_pofcon_vddh_set(NRF_REGULATORS_Type *p_reg, nrf_regulators_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_regulators_pof_thrvddh_t nrf_regulators_pofcon_vddh_get(NRF_REGULATORS_Type const *p_reg)

Function for getting the VDDH regulators failure comparator threshold.

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

Returns:

Threshold setting for regulators failure comparator.

NRF_STATIC_INLINE void nrf_regulators_dcdcen_vddh_set(NRF_REGULATORS_Type *p_reg, bool enable)

Function for enabling or disabling the high voltage regulator.

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

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

NRF_STATIC_INLINE void nrf_regulators_dcdcen_radio_set(NRF_REGULATORS_Type *p_reg, bool enable)

Function for enabling or disabling the radio regulator.

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

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