nrfx 4.5.0
Loading...
Searching...
No Matches
REGULATORS HAL

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

Data Structures

struct  nrf_regulators_pof_config_t
 POF Comparator configuration structure. More...
 

Macros

#define NRF_REGULATORS_HAS_VREG_MAIN   1
 Symbol indicating whether the main voltage regulator (VREGMAIN) is present.
 
#define NRF_REGULATORS_HAS_VREG_HIGH   1
 Symbol indicating whether high voltage regulator (VREGH) is present.
 
#define NRF_REGULATORS_HAS_VREG_MEDIUM   1
 Symbol indicating whether medium voltage regulator (VREGM) is present.
 
#define NRF_REGULATORS_HAS_VREG_RADIO   1
 Symbol indicating whether radio regulator (VREGRADIO) is present.
 
#define NRF_REGULATORS_HAS_SYSTEMOFF   1
 Symbol indicating whether SYSTEMOFF functionality is present.
 
#define NRF_REGULATORS_HAS_VREG_ANY   1
 Symbol indicating whether any regulator is present.
 
#define NRF_REGULATORS_HAS_POF   1
 Symbol indicating whether Power-On-Fail Comparator (POF Comparator) is present.
 
#define NRF_REGULATORS_HAS_POF_VDDH   1
 Symbol indicating whether POF Comparator for VDDH is present.
 
#define NRF_REGULATORS_HAS_POF_WARN_DISABLE   1
 Symbol indicating whether POF Comparator can disable POFWARN event.
 
#define NRF_REGULATORS_HAS_POF_STATUS   1
 Symbol indicating whether POF Comparator status is present.
 
#define NRF_REGULATORS_HAS_TRIM   1
 Symbol indicating whether TRIM register is present.
 
#define NRF_REGULATORS_HAS_MAIN_STATUS   1
 Symbol indicating whether main supply status is present.
 
#define NRF_REGULATORS_HAS_INDUCTOR_DET   1
 Symbol indicating whether inductor detection is present.
 
#define NRF_REGULATORS_HAS_HIBERNATOR   1
 Symbol indicating whether HIBERNATOR register is present.
 

Enumerations

enum  nrf_regulators_vreg_t {
  NRF_REGULATORS_VREG_MAIN ,
  NRF_REGULATORS_VREG_HIGH ,
  NRF_REGULATORS_VREG_MEDIUM ,
  NRF_REGULATORS_VREG_RADIO
}
 Voltage regulators. More...
 
enum  nrf_regulators_pof_thr_t {
  NRF_REGULATORS_POF_THR_0V9 = REGULATORS_POFCON_THRESHOLD_V090 ,
  NRF_REGULATORS_POF_THR_0V95 = REGULATORS_POFCON_THRESHOLD_V095 ,
  NRF_REGULATORS_POF_THR_1V0 = REGULATORS_POFCON_THRESHOLD_V100 ,
  NRF_REGULATORS_POF_THR_1V05 = REGULATORS_POFCON_THRESHOLD_V105 ,
  NRF_REGULATORS_POF_THR_1V1 = REGULATORS_POFCON_THRESHOLD_V110 ,
  NRF_REGULATORS_POF_THR_1V15 = REGULATORS_POFCON_THRESHOLD_V115 ,
  NRF_REGULATORS_POF_THR_1V2 = REGULATORS_POFCON_THRESHOLD_V120 ,
  NRF_REGULATORS_POF_THR_1V25 = REGULATORS_POFCON_THRESHOLD_V125 ,
  NRF_REGULATORS_POF_THR_1V3 = REGULATORS_POFCON_THRESHOLD_V130 ,
  NRF_REGULATORS_POF_THR_1V35 = REGULATORS_POFCON_THRESHOLD_V135 ,
  NRF_REGULATORS_POF_THR_1V4 = REGULATORS_POFCON_THRESHOLD_V140 ,
  NRF_REGULATORS_POF_THR_1V45 = REGULATORS_POFCON_THRESHOLD_V145 ,
  NRF_REGULATORS_POF_THR_1V5 = REGULATORS_POFCON_THRESHOLD_V150 ,
  NRF_REGULATORS_POF_THR_1V55 = REGULATORS_POFCON_THRESHOLD_V155 ,
  NRF_REGULATORS_POF_THR_1V6 = REGULATORS_POFCON_THRESHOLD_V160 ,
  NRF_REGULATORS_POF_THR_1V65 = REGULATORS_POFCON_THRESHOLD_V165 ,
  NRF_REGULATORS_POF_THR_1V7 = REGULATORS_POFCON_THRESHOLD_V17 ,
  NRF_REGULATORS_POF_THR_1V8 = REGULATORS_POFCON_THRESHOLD_V18 ,
  NRF_REGULATORS_POF_THR_1V9 = REGULATORS_POFCON_THRESHOLD_V19 ,
  NRF_REGULATORS_POF_THR_2V0 = REGULATORS_POFCON_THRESHOLD_V20 ,
  NRF_REGULATORS_POF_THR_2V1 = REGULATORS_POFCON_THRESHOLD_V21 ,
  NRF_REGULATORS_POF_THR_2V2 = REGULATORS_POFCON_THRESHOLD_V22 ,
  NRF_REGULATORS_POF_THR_2V3 = REGULATORS_POFCON_THRESHOLD_V23 ,
  NRF_REGULATORS_POF_THR_2V4 = REGULATORS_POFCON_THRESHOLD_V24 ,
  NRF_REGULATORS_POF_THR_2V5 = REGULATORS_POFCON_THRESHOLD_V25 ,
  NRF_REGULATORS_POF_THR_2V6 = REGULATORS_POFCON_THRESHOLD_V26 ,
  NRF_REGULATORS_POF_THR_2V7 = REGULATORS_POFCON_THRESHOLD_V27 ,
  NRF_REGULATORS_POF_THR_2V8 = REGULATORS_POFCON_THRESHOLD_V28
}
 POF Comparator thresholds. More...
 
enum  nrf_regulators_pof_thr_vddh_t {
  NRF_REGULATORS_POF_THR_VDDH_2V7 = REGULATORS_POFCON_THRESHOLDVDDH_V27 ,
  NRF_REGULATORS_POF_THR_VDDH_2V8 = REGULATORS_POFCON_THRESHOLDVDDH_V28 ,
  NRF_REGULATORS_POF_THR_VDDH_2V9 = REGULATORS_POFCON_THRESHOLDVDDH_V29 ,
  NRF_REGULATORS_POF_THR_VDDH_3V0 = REGULATORS_POFCON_THRESHOLDVDDH_V30 ,
  NRF_REGULATORS_POF_THR_VDDH_3V1 = REGULATORS_POFCON_THRESHOLDVDDH_V31 ,
  NRF_REGULATORS_POF_THR_VDDH_3V2 = REGULATORS_POFCON_THRESHOLDVDDH_V32 ,
  NRF_REGULATORS_POF_THR_VDDH_3V3 = REGULATORS_POFCON_THRESHOLDVDDH_V33 ,
  NRF_REGULATORS_POF_THR_VDDH_3V4 = REGULATORS_POFCON_THRESHOLDVDDH_V34 ,
  NRF_REGULATORS_POF_THR_VDDH_3V5 = REGULATORS_POFCON_THRESHOLDVDDH_V35 ,
  NRF_REGULATORS_POF_THR_VDDH_3V6 = REGULATORS_POFCON_THRESHOLDVDDH_V36 ,
  NRF_REGULATORS_POF_THR_VDDH_3V7 = REGULATORS_POFCON_THRESHOLDVDDH_V37 ,
  NRF_REGULATORS_POF_THR_VDDH_3V8 = REGULATORS_POFCON_THRESHOLDVDDH_V38 ,
  NRF_REGULATORS_POF_THR_VDDH_3V9 = REGULATORS_POFCON_THRESHOLDVDDH_V39 ,
  NRF_REGULATORS_POF_THR_VDDH_4V0 = REGULATORS_POFCON_THRESHOLDVDDH_V40 ,
  NRF_REGULATORS_POF_THR_VDDH_4V1 = REGULATORS_POFCON_THRESHOLDVDDH_V41 ,
  NRF_REGULATORS_POF_THR_VDDH_4V2 = REGULATORS_POFCON_THRESHOLDVDDH_V42
}
 POF Comparator thresholds for VDDH. More...
 
enum  nrf_regulators_elv_mode_allow_mask_t { NRF_REGULATORS_ELV_MODE_ALLOW_MASK_EXT }
 Components allowed to introduce ELV mode. More...
 
enum  nrf_regulators_main_status_t {
  NRF_REGULATORS_MAIN_STATUS_NORMAL = REGULATORS_MAINREGSTATUS_VREGH_Inactive ,
  NRF_REGULATORS_MAIN_STATUS_HIGH = REGULATORS_MAINREGSTATUS_VREGH_Active
}
 Main supply status. More...
 

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.
 
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.
 
NRF_STATIC_INLINE void nrf_regulators_system_off (NRF_REGULATORS_Type *p_reg)
 Function for putting the CPU in System OFF mode.
 
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.
 
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.
 
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.
 
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).
 
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.
 
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.
 
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.
 
NRF_STATIC_INLINE void nrf_regulators_system_hibernate (NRF_REGULATORS_Type *p_reg)
 Function for putting the CPU in hibernation mode.
 
NRF_STATIC_INLINE void nrf_regulators_gpio_retention_release_set (NRF_REGULATORS_Type *p_reg, bool enable)
 Function for enabling or disabling the GPIO retention release on wake up from hibernation mode.
 
NRF_STATIC_INLINE bool nrf_regulators_gpio_retention_check (NRF_REGULATORS_Type const *p_reg)
 Function for checking the GPIO retention status.
 

Detailed Description

Hardware access layer for managing the REGULATORS peripheral.

Enumeration Type Documentation

◆ nrf_regulators_elv_mode_allow_mask_t

Components allowed to introduce ELV mode.

Enumerator
NRF_REGULATORS_ELV_MODE_ALLOW_MASK_EXT 

Reserved. For internal use only.

◆ nrf_regulators_main_status_t

Main supply status.

Enumerator
NRF_REGULATORS_MAIN_STATUS_NORMAL 

Normal voltage mode. Voltage supplied on VDD and VDDH.

NRF_REGULATORS_MAIN_STATUS_HIGH 

High voltage mode. Voltage supplied on VDDH.

◆ nrf_regulators_pof_thr_t

POF Comparator thresholds.

Enumerator
NRF_REGULATORS_POF_THR_0V9 

Set threshold to 0.9 V.

NRF_REGULATORS_POF_THR_0V95 

Set threshold to 0.95 V.

NRF_REGULATORS_POF_THR_1V0 

Set threshold to 1.0 V.

NRF_REGULATORS_POF_THR_1V05 

Set threshold to 1.05 V.

NRF_REGULATORS_POF_THR_1V1 

Set threshold to 1.1 V.

NRF_REGULATORS_POF_THR_1V15 

Set threshold to 1.15 V.

NRF_REGULATORS_POF_THR_1V2 

Set threshold to 1.2 V.

NRF_REGULATORS_POF_THR_1V25 

Set threshold to 1.25 V.

NRF_REGULATORS_POF_THR_1V3 

Set threshold to 1.3 V.

NRF_REGULATORS_POF_THR_1V35 

Set threshold to 1.35 V.

NRF_REGULATORS_POF_THR_1V4 

Set threshold to 1.4 V.

NRF_REGULATORS_POF_THR_1V45 

Set threshold to 1.45 V.

NRF_REGULATORS_POF_THR_1V5 

Set threshold to 1.5 V.

NRF_REGULATORS_POF_THR_1V55 

Set threshold to 1.55 V.

NRF_REGULATORS_POF_THR_1V6 

Set threshold to 1.6 V.

NRF_REGULATORS_POF_THR_1V65 

Set threshold to 1.65 V.

NRF_REGULATORS_POF_THR_1V7 

Set threshold to 1.7 V.

NRF_REGULATORS_POF_THR_1V8 

Set threshold to 1.8 V.

NRF_REGULATORS_POF_THR_1V9 

Set threshold to 1.9 V.

NRF_REGULATORS_POF_THR_2V0 

Set threshold to 2.0 V.

NRF_REGULATORS_POF_THR_2V1 

Set threshold to 2.1 V.

NRF_REGULATORS_POF_THR_2V2 

Set threshold to 2.2 V.

NRF_REGULATORS_POF_THR_2V3 

Set threshold to 2.3 V.

NRF_REGULATORS_POF_THR_2V4 

Set threshold to 2.4 V.

NRF_REGULATORS_POF_THR_2V5 

Set threshold to 2.5 V.

NRF_REGULATORS_POF_THR_2V6 

Set threshold to 2.6 V.

NRF_REGULATORS_POF_THR_2V7 

Set threshold to 2.7 V.

NRF_REGULATORS_POF_THR_2V8 

Set threshold to 2.8 V.

◆ nrf_regulators_pof_thr_vddh_t

POF Comparator thresholds for VDDH.

Enumerator
NRF_REGULATORS_POF_THR_VDDH_2V7 

Set threshold to 2.7 V.

NRF_REGULATORS_POF_THR_VDDH_2V8 

Set threshold to 2.8 V.

NRF_REGULATORS_POF_THR_VDDH_2V9 

Set threshold to 2.9 V.

NRF_REGULATORS_POF_THR_VDDH_3V0 

Set threshold to 3.0 V.

NRF_REGULATORS_POF_THR_VDDH_3V1 

Set threshold to 3.1 V.

NRF_REGULATORS_POF_THR_VDDH_3V2 

Set threshold to 3.2 V.

NRF_REGULATORS_POF_THR_VDDH_3V3 

Set threshold to 3.3 V.

NRF_REGULATORS_POF_THR_VDDH_3V4 

Set threshold to 3.4 V.

NRF_REGULATORS_POF_THR_VDDH_3V5 

Set threshold to 3.5 V.

NRF_REGULATORS_POF_THR_VDDH_3V6 

Set threshold to 3.6 V.

NRF_REGULATORS_POF_THR_VDDH_3V7 

Set threshold to 3.7 V.

NRF_REGULATORS_POF_THR_VDDH_3V8 

Set threshold to 3.8 V.

NRF_REGULATORS_POF_THR_VDDH_3V9 

Set threshold to 3.9 V.

NRF_REGULATORS_POF_THR_VDDH_4V0 

Set threshold to 4.0 V.

NRF_REGULATORS_POF_THR_VDDH_4V1 

Set threshold to 4.1 V.

NRF_REGULATORS_POF_THR_VDDH_4V2 

Set threshold to 4.2 V.

◆ nrf_regulators_vreg_t

Voltage regulators.

Enumerator
NRF_REGULATORS_VREG_MAIN 

Main voltage regulator (VREGMAIN).

NRF_REGULATORS_VREG_HIGH 

High voltage regulator (VREGH).

NRF_REGULATORS_VREG_MEDIUM 

Medium voltage regulator (VREGM).

NRF_REGULATORS_VREG_RADIO 

Radio voltage regulator (VREGRADIO).

Function Documentation

◆ nrf_regulators_elv_mode_allow_get()

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
[in]p_regPointer 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_regulators_elv_mode_allow_set()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of components to be set, created using nrf_regulators_elv_mode_allow_mask_t.

◆ nrf_regulators_gpio_retention_check()

NRF_STATIC_INLINE bool nrf_regulators_gpio_retention_check ( NRF_REGULATORS_Type const * p_reg)

Function for checking the GPIO retention status.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueGPIO retention is active.
falseGPIO retention is not active.

◆ nrf_regulators_gpio_retention_release_set()

NRF_STATIC_INLINE void nrf_regulators_gpio_retention_release_set ( NRF_REGULATORS_Type * p_reg,
bool enable )

Function for enabling or disabling the GPIO retention release on wake up from hibernation mode.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if GPIO retention release is to be enabled, false otherwise.

◆ nrf_regulators_inductor_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueInductor detected.
falseInductor not detected.

◆ nrf_regulators_main_status_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The current main supply status.

◆ nrf_regulators_pof_below_thr_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueVoltage below VPOF threshold has been detected.
falseVoltage above VPOF threshold has been detected.

◆ nrf_regulators_pof_config_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_configPointer to the structure to be filled with POF Comparator configuration.

◆ nrf_regulators_pof_config_set()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the structure containing POF Comparator configuration.

◆ nrf_regulators_system_hibernate()

NRF_STATIC_INLINE void nrf_regulators_system_hibernate ( NRF_REGULATORS_Type * p_reg)

Function for putting the CPU in hibernation mode.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_regulators_system_off()

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
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_regulators_vreg_enable_check()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]regulatorRegulator to be checked.
Return values
trueSpecified voltage regulator is enabled.
falseSpecified voltage regulator is disabled.

◆ nrf_regulators_vreg_enable_set()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]regulatorRegulator to be enabled or disabled.
[in]enableTrue if specified voltage regulator is to be enabled, false otherwise.