nrfx 3.3
Macros | Typedefs | Enumerations | Functions
Low Frequency Clock Multiplexer HAL

Hardware access layer for managing the Low Frequency Clock Multiplexer. More...

Macros

#define NRF_LFCLOCKMUX   NRF_CLOCK
 Clock component name redefinition.
 

Typedefs

typedef NRF_CLOCK_Type NRF_LFCLOCKMUX_Type
 Clock component type redefinition.
 

Enumerations

enum  nrf_lfclockmux_task_t {
  NRF_LFCLOCKMUX_TASK_LFCLKSTART = offsetof(NRF_LFCLOCKMUX_Type, TASKS_LFCLKSTART) ,
  NRF_LFCLOCKMUX_TASK_LFCLKSTOP = offsetof(NRF_LFCLOCKMUX_Type, TASKS_LFCLKSTOP)
}
 Tasks. More...
 
enum  nrf_lfclockmux_event_t {
  NRF_LFCLOCKMUX_EVENT_LFCLKSTARTED = offsetof(NRF_LFCLOCKMUX_Type, EVENTS_LFCLKSTARTED) ,
  NRF_LFCLOCKMUX_EVENT_LFCLKSRCCHANGED = offsetof(NRF_LFCLOCKMUX_Type, EVENTS_LFCLKSRCCHANGED)
}
 Events. More...
 
enum  nrf_lfclockmux_int_mask_t {
  NRF_LFCLOCKMUX_INT_LFCLKSTARTED_MASK = CLOCK_INTENSET_LFCLKSTARTED_Msk ,
  NRF_LFCLOCKMUX_INT_LFCLKSRCCHANGED_MASK = CLOCK_INTENSET_LFCLKSRCCHANGED_Msk
}
 Interrupts. More...
 
enum  nrf_lfclockmux_source_t {
  NRF_LFCLOCKMUX_SOURCE_LPRC = (CLOCK_LFCLKSTAT_SRC_LFLPRC_Active << CLOCK_LFCLKSTAT_SRC_LFLPRC_Pos) ,
  NRF_LFCLOCKMUX_SOURCE_RC = (CLOCK_LFCLKSTAT_SRC_LFRC_Active << CLOCK_LFCLKSTAT_SRC_LFRC_Pos) ,
  NRF_LFCLOCKMUX_SOURCE_XTAL = (CLOCK_LFCLKSTAT_SRC_LFXO_Active << CLOCK_LFCLKSTAT_SRC_LFXO_Pos) ,
  NRF_LFCLOCKMUX_SOURCE_SYNTH = (CLOCK_LFCLKSTAT_SRC_SYNTH_Active << CLOCK_LFCLKSTAT_SRC_SYNTH_Pos) ,
  NRF_LFCLOCKMUX_SOURCE_LPRC_XTAL = NRF_LFCLOCKMUX_SOURCE_LPRC | NRF_LFCLOCKMUX_SOURCE_XTAL ,
  NRF_LFCLOCKMUX_SOURCE_RC_XTAL = NRF_LFCLOCKMUX_SOURCE_RC | NRF_LFCLOCKMUX_SOURCE_XTAL ,
  NRF_LFCLOCKMUX_SOURCE_SYNTH_XTAL = NRF_LFCLOCKMUX_SOURCE_SYNTH | NRF_LFCLOCKMUX_SOURCE_XTAL
}
 Low-frequency clock sources. More...
 

Functions

NRF_STATIC_INLINE uint32_t nrf_lfclockmux_task_address_get (NRF_LFCLOCKMUX_Type const *p_reg, nrf_lfclockmux_task_t task)
 Function for retrieving the address of the specified task.
 
NRF_STATIC_INLINE void nrf_lfclockmux_task_trigger (NRF_LFCLOCKMUX_Type *p_reg, nrf_lfclockmux_task_t task)
 Function for setting the specified task.
 
NRF_STATIC_INLINE uint32_t nrf_lfclockmux_event_address_get (NRF_LFCLOCKMUX_Type const *p_reg, nrf_lfclockmux_event_t event)
 Function for retrieving the address of the specified event.
 
NRF_STATIC_INLINE void nrf_lfclockmux_event_clear (NRF_LFCLOCKMUX_Type *p_reg, nrf_lfclockmux_event_t event)
 Function for clearing the specified event.
 
NRF_STATIC_INLINE bool nrf_lfclockmux_event_check (NRF_LFCLOCKMUX_Type const *p_reg, nrf_lfclockmux_event_t event)
 Function for retrieving the state of the specified event.
 
NRF_STATIC_INLINE void nrf_lfclockmux_int_enable (NRF_LFCLOCKMUX_Type *p_reg, uint32_t mask)
 Function for enabling the specified interrupts.
 
NRF_STATIC_INLINE void nrf_lfclockmux_int_disable (NRF_LFCLOCKMUX_Type *p_reg, uint32_t mask)
 Function for disabling the specified interrupts.
 
NRF_STATIC_INLINE uint32_t nrf_lfclockmux_int_enable_check (NRF_LFCLOCKMUX_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled.
 
NRF_STATIC_INLINE uint32_t nrf_lfclockmux_int_pending_get (NRF_LFCLOCKMUX_Type const *p_reg)
 Function for retrieving the state of pending interrupts.
 
NRF_STATIC_INLINE bool nrf_lfclockmux_stat_run_check (NRF_LFCLOCKMUX_Type const *p_reg)
 Function for retrieving the trigger status of the task START for LF clock.
 
NRF_STATIC_INLINE nrf_lfclockmux_source_t nrf_lfclockmux_stat_src_get (NRF_LFCLOCKMUX_Type const *p_reg)
 Function for retrieving the status indicating which clock source is running for LF clock.
 
NRF_STATIC_INLINE void nrf_lfclockmux_lf_src_set (NRF_LFCLOCKMUX_Type *p_reg, nrf_lfclockmux_source_t source)
 Function for changing the low-frequency clock source.
 
NRF_STATIC_INLINE nrf_lfclockmux_source_t nrf_lfclockmux_lf_src_get (NRF_LFCLOCKMUX_Type const *p_reg)
 Function for retrieving the selected source for the low-frequency clock.
 
NRF_STATIC_INLINE void nrf_lfclockmux_alwaysrun_set (NRF_LFCLOCKMUX_Type *p_reg, bool alwaysrun)
 Function for setting the LF clock domain to always run.
 
NRF_STATIC_INLINE bool nrf_lfclockmux_alwaysrun_get (NRF_LFCLOCKMUX_Type const *p_reg)
 Function for checking if the LF clock domain is configured to always run.
 
NRF_STATIC_INLINE void nrf_lfclockmux_config_reset_set (NRF_LFCLOCKMUX_Type *p_reg, bool en)
 Function controls reset to the LF CLOCK MUX peripheral.
 
NRF_STATIC_INLINE void nrf_lfclockmux_config_bypass_set (NRF_LFCLOCKMUX_Type *p_reg, nrf_lfclockmux_source_t source)
 Function for enabling bypass.
 
NRF_STATIC_INLINE void nrf_lfclockmux_config_timeout_set (NRF_LFCLOCKMUX_Type *p_reg, uint8_t timeout)
 Function for setting the timeout value for the clock alignment procedure.
 
NRF_STATIC_INLINE uint8_t nrf_lfclockmux_config_timeout_get (NRF_LFCLOCKMUX_Type const *p_reg)
 Function for getting the timeout value for the clock alignment procedure.
 
NRF_STATIC_INLINE void nrf_lfclockmux_config_threshold_set (NRF_LFCLOCKMUX_Type *p_reg, uint8_t thr_low, uint8_t thr_high, uint8_t thr_diff)
 Function for setting threshold limit while clock switching.
 

Detailed Description

Hardware access layer for managing the Low Frequency Clock Multiplexer.

Enumeration Type Documentation

◆ nrf_lfclockmux_event_t

Events.

Enumerator
NRF_LFCLOCKMUX_EVENT_LFCLKSTARTED 

LFCLK oscillator started.

NRF_LFCLOCKMUX_EVENT_LFCLKSRCCHANGED 

LFCLK oscillator source changed.

◆ nrf_lfclockmux_int_mask_t

Interrupts.

Enumerator
NRF_LFCLOCKMUX_INT_LFCLKSTARTED_MASK 

Interrupt on LFCLKSTARTED event.

NRF_LFCLOCKMUX_INT_LFCLKSRCCHANGED_MASK 

Interrupt on LFCLKSTARTED event.

◆ nrf_lfclockmux_source_t

Low-frequency clock sources.

Used by LFCLKCTRL and LFCLKSTAT.SRC registers.

Enumerator
NRF_LFCLOCKMUX_SOURCE_LPRC 

Internal 32 kHz low power RC oscillator.

NRF_LFCLOCKMUX_SOURCE_RC 

Internal 32 kHz RC oscillator.

NRF_LFCLOCKMUX_SOURCE_XTAL 

External 32 kHz crystal.

NRF_LFCLOCKMUX_SOURCE_SYNTH 

Internal 32 kHz synthesized.

NRF_LFCLOCKMUX_SOURCE_LPRC_XTAL 

Internal 32 kHz low power RC oscillator and external 32 kHz crystal.

NRF_LFCLOCKMUX_SOURCE_RC_XTAL 

Internal 32 kHz RC oscillator and external 32 kHz crystal.

NRF_LFCLOCKMUX_SOURCE_SYNTH_XTAL 

Internal 32 kHz synthesized and external 32 kHz crystal.

◆ nrf_lfclockmux_task_t

Tasks.

The NRF_LFCLOCKMUX_TASK_LFCLKSTOP task cannot be set when the low-frequency clock is not running.

Enumerator
NRF_LFCLOCKMUX_TASK_LFCLKSTART 

Start LFCLK clock source.

NRF_LFCLOCKMUX_TASK_LFCLKSTOP 

Stop LFCLK clock source.

Function Documentation

◆ nrf_lfclockmux_alwaysrun_get()

NRF_STATIC_INLINE bool nrf_lfclockmux_alwaysrun_get ( NRF_LFCLOCKMUX_Type const *  p_reg)

Function for checking if the LF clock domain is configured to always run.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe LF clock domain is configured to always run.
falseThe LF clock domain is not configured to always run.

◆ nrf_lfclockmux_alwaysrun_set()

NRF_STATIC_INLINE void nrf_lfclockmux_alwaysrun_set ( NRF_LFCLOCKMUX_Type p_reg,
bool  alwaysrun 
)

Function for setting the LF clock domain to always run.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]alwaysrunEnsure the clock is always running.

◆ nrf_lfclockmux_config_bypass_set()

NRF_STATIC_INLINE void nrf_lfclockmux_config_bypass_set ( NRF_LFCLOCKMUX_Type p_reg,
nrf_lfclockmux_source_t  source 
)

Function for enabling bypass.

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

◆ nrf_lfclockmux_config_reset_set()

NRF_STATIC_INLINE void nrf_lfclockmux_config_reset_set ( NRF_LFCLOCKMUX_Type p_reg,
bool  en 
)

Function controls reset to the LF CLOCK MUX peripheral.

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

◆ nrf_lfclockmux_config_threshold_set()

NRF_STATIC_INLINE void nrf_lfclockmux_config_threshold_set ( NRF_LFCLOCKMUX_Type p_reg,
uint8_t  thr_low,
uint8_t  thr_high,
uint8_t  thr_diff 
)

Function for setting threshold limit while clock switching.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]thr_lowThreshold low limit while clock switching.
[in]thr_highThreshold high limit while clock switching.
[in]thr_diffThreshold difference while clock switching.

◆ nrf_lfclockmux_config_timeout_get()

NRF_STATIC_INLINE uint8_t nrf_lfclockmux_config_timeout_get ( NRF_LFCLOCKMUX_Type const *  p_reg)

Function for getting the timeout value for the clock alignment procedure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Numberof 32Ki clocks.

◆ nrf_lfclockmux_config_timeout_set()

NRF_STATIC_INLINE void nrf_lfclockmux_config_timeout_set ( NRF_LFCLOCKMUX_Type p_reg,
uint8_t  timeout 
)

Function for setting the timeout value for the clock alignment procedure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]timeoutNumber of 32Ki clocks.

◆ nrf_lfclockmux_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_lfclockmux_event_address_get ( NRF_LFCLOCKMUX_Type const *  p_reg,
nrf_lfclockmux_event_t  event 
)

Function for retrieving the address of the specified event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventLFCLOCKMUX Event.
Returns
Address of the specified event register.

◆ nrf_lfclockmux_event_check()

NRF_STATIC_INLINE bool nrf_lfclockmux_event_check ( NRF_LFCLOCKMUX_Type const *  p_reg,
nrf_lfclockmux_event_t  event 
)

Function for retrieving the state of the specified event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrf_lfclockmux_event_clear()

NRF_STATIC_INLINE void nrf_lfclockmux_event_clear ( NRF_LFCLOCKMUX_Type p_reg,
nrf_lfclockmux_event_t  event 
)

Function for clearing the specified event.

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

◆ nrf_lfclockmux_int_disable()

NRF_STATIC_INLINE void nrf_lfclockmux_int_disable ( NRF_LFCLOCKMUX_Type p_reg,
uint32_t  mask 
)

Function for disabling the specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_lfclockmux_int_mask_t values for bit masking.

◆ nrf_lfclockmux_int_enable()

NRF_STATIC_INLINE void nrf_lfclockmux_int_enable ( NRF_LFCLOCKMUX_Type p_reg,
uint32_t  mask 
)

Function for enabling the specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_lfclockmux_int_mask_t values for bit masking.

◆ nrf_lfclockmux_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_lfclockmux_int_enable_check ( NRF_LFCLOCKMUX_Type const *  p_reg,
uint32_t  mask 
)

Function for checking if the specified interrupts are enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked. Use nrf_lfclockmux_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrf_lfclockmux_int_pending_get()

NRF_STATIC_INLINE uint32_t nrf_lfclockmux_int_pending_get ( NRF_LFCLOCKMUX_Type const *  p_reg)

Function for retrieving the state of pending interrupts.

Note
States of pending interrupt are saved as a bitmask. One set at particular position means that interrupt for event is pending.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Bitmask with information about pending interrupts. Use nrf_lfclockmux_int_mask_t values for bit masking.

◆ nrf_lfclockmux_lf_src_get()

NRF_STATIC_INLINE nrf_lfclockmux_source_t nrf_lfclockmux_lf_src_get ( NRF_LFCLOCKMUX_Type const *  p_reg)

Function for retrieving the selected source for the low-frequency clock.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Source of the low-frequency clock.

◆ nrf_lfclockmux_lf_src_set()

NRF_STATIC_INLINE void nrf_lfclockmux_lf_src_set ( NRF_LFCLOCKMUX_Type p_reg,
nrf_lfclockmux_source_t  source 
)

Function for changing the low-frequency clock source.

Check in Product Specification if this function can be called when the low-frequency clock is running.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]sourceNew low-frequency clock source.

◆ nrf_lfclockmux_stat_run_check()

NRF_STATIC_INLINE bool nrf_lfclockmux_stat_run_check ( NRF_LFCLOCKMUX_Type const *  p_reg)

Function for retrieving the trigger status of the task START for LF clock.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
falseThe task START for the LF clock has not been triggered.
trueThe task START for the LF clock has been triggered.

◆ nrf_lfclockmux_stat_src_get()

NRF_STATIC_INLINE nrf_lfclockmux_source_t nrf_lfclockmux_stat_src_get ( NRF_LFCLOCKMUX_Type const *  p_reg)

Function for retrieving the status indicating which clock source is running for LF clock.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Current low-frequency clock source.

◆ nrf_lfclockmux_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_lfclockmux_task_address_get ( NRF_LFCLOCKMUX_Type const *  p_reg,
nrf_lfclockmux_task_t  task 
)

Function for retrieving the address of the specified task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskLFCLOCKMUX Task.
Returns
Address of the requested task register.

◆ nrf_lfclockmux_task_trigger()

NRF_STATIC_INLINE void nrf_lfclockmux_task_trigger ( NRF_LFCLOCKMUX_Type p_reg,
nrf_lfclockmux_task_t  task 
)

Function for setting the specified task.

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

Documentation feedback | Developer Zone | Subscribe | Updated