Hardware access layer for managing the CLOCK peripheral. More...
Macros | |
#define | NRF_CLOCK_HAS_CALIBRATION 1 |
Presence of the Low Frequency Clock calibration. | |
#define | NRF_CLOCK_HAS_CALIBRATION_TIMER 1 |
Presence of the Low Frequency Clock calibration timer. | |
#define | NRF_CLOCK_HAS_HFCLK192M 1 |
Presence of the 192 MHz clock. | |
#define | NRF_CLOCK_HAS_HFCLKAUDIO 1 |
Presence of the Audio clock. | |
#define | NRF_CLOCK_HAS_ALWAYSRUN 1 |
Presence of ALWAYSRUN registers. | |
#define | NRF_CLOCK_HAS_HFCLKSRC 1 |
Presence of HFCLKSRC register. | |
Enumerations | |
enum | nrf_clock_lfclk_t { NRF_CLOCK_LFCLK_LFULP = CLOCK_LFCLKSRC_SRC_LFULP, NRF_CLOCK_LFCLK_RC = CLOCK_LFCLKSRC_SRC_RC, NRF_CLOCK_LFCLK_Xtal = CLOCK_LFCLKSRC_SRC_Xtal, NRF_CLOCK_LFCLK_Synth = CLOCK_LFCLKSRC_SRC_Synth, NRF_CLOCK_LFCLK_Xtal_Low_Swing, NRF_CLOCK_LFCLK_Xtal_Full_Swing } |
Low-frequency clock sources. More... | |
enum | nrf_clock_hfclk_t { NRF_CLOCK_HFCLK_LOW_ACCURACY = CLOCK_HFCLKSTAT_SRC_RC, NRF_CLOCK_HFCLK_HIGH_ACCURACY = CLOCK_HFCLKSTAT_SRC_Xtal } |
High-frequency clock sources. More... | |
enum | nrf_clock_domain_t { NRF_CLOCK_DOMAIN_LFCLK, NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_DOMAIN_HFCLK192M, NRF_CLOCK_DOMAIN_HFCLKAUDIO } |
Clock domains. | |
enum | nrf_clock_hfclk_div_t { NRF_CLOCK_HFCLK_DIV_1 = CLOCK_HFCLKCTRL_HCLK_Div1, NRF_CLOCK_HFCLK_DIV_2 = CLOCK_HFCLKCTRL_HCLK_Div2, NRF_CLOCK_HFCLK_DIV_4 = CLOCK_HFCLK192MCTRL_HCLK192M_Div4 } |
High-frequency clock frequency configuration. More... | |
enum | nrf_clock_start_task_status_t { NRF_CLOCK_START_TASK_NOT_TRIGGERED = CLOCK_LFCLKRUN_STATUS_NotTriggered, NRF_CLOCK_START_TASK_TRIGGERED = CLOCK_LFCLKRUN_STATUS_Triggered } |
Trigger status of task LFCLKSTART/HFCLKSTART. More... | |
enum | nrf_clock_int_mask_t { NRF_CLOCK_INT_HF_STARTED_MASK = CLOCK_INTENSET_HFCLKSTARTED_Msk, NRF_CLOCK_INT_LF_STARTED_MASK = CLOCK_INTENSET_LFCLKSTARTED_Msk, NRF_CLOCK_INT_DONE_MASK = CLOCK_INTENSET_DONE_Msk, NRF_CLOCK_INT_CTTO_MASK = CLOCK_INTENSET_CTTO_Msk, NRF_CLOCK_INT_CTSTARTED_MASK = CLOCK_INTENSET_CTSTARTED_Msk, NRF_CLOCK_INT_CTSTOPPED_MASK, NRF_CLOCK_INT_HF192M_STARTED_MASK = CLOCK_INTENSET_HFCLK192MSTARTED_Msk } |
Interrupts. More... | |
enum | nrf_clock_task_t { NRF_CLOCK_TASK_HFCLKSTART = offsetof(NRF_CLOCK_Type, TASKS_HFCLKSTART), NRF_CLOCK_TASK_HFCLKSTOP = offsetof(NRF_CLOCK_Type, TASKS_HFCLKSTOP), NRF_CLOCK_TASK_LFCLKSTART = offsetof(NRF_CLOCK_Type, TASKS_LFCLKSTART), NRF_CLOCK_TASK_LFCLKSTOP = offsetof(NRF_CLOCK_Type, TASKS_LFCLKSTOP), NRF_CLOCK_TASK_CAL = offsetof(NRF_CLOCK_Type, TASKS_CAL), NRF_CLOCK_TASK_CTSTART = offsetof(NRF_CLOCK_Type, TASKS_CTSTART), NRF_CLOCK_TASK_CTSTOP, NRF_CLOCK_TASK_HFCLKAUDIOSTOP = offsetof(NRF_CLOCK_Type, TASKS_HFCLKAUDIOSTOP), NRF_CLOCK_TASK_HFCLK192MSTART = offsetof(NRF_CLOCK_Type, TASKS_HFCLK192MSTART), NRF_CLOCK_TASK_HFCLK192MSTOP = offsetof(NRF_CLOCK_Type, TASKS_HFCLK192MSTOP) } |
Tasks. More... | |
enum | nrf_clock_event_t { NRF_CLOCK_EVENT_HFCLKSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_HFCLKSTARTED), NRF_CLOCK_EVENT_LFCLKSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_LFCLKSTARTED), NRF_CLOCK_EVENT_DONE = offsetof(NRF_CLOCK_Type, EVENTS_DONE), NRF_CLOCK_EVENT_CTTO = offsetof(NRF_CLOCK_Type, EVENTS_CTTO), NRF_CLOCK_EVENT_CTSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_CTSTARTED), NRF_CLOCK_EVENT_CTSTOPPED, NRF_CLOCK_EVENT_HFCLK192MSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_HFCLK192MSTARTED) } |
Events. More... | |
Functions | |
NRF_STATIC_INLINE void | nrf_clock_int_enable (NRF_CLOCK_Type *p_reg, uint32_t mask) |
Function for enabling the specified interrupt. More... | |
NRF_STATIC_INLINE void | nrf_clock_int_disable (NRF_CLOCK_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupt. More... | |
NRF_STATIC_INLINE uint32_t | nrf_clock_int_enable_check (NRF_CLOCK_Type const *p_reg, uint32_t mask) |
Function for checking if the specified interrupts are enabled. More... | |
NRF_STATIC_INLINE uint32_t | nrf_clock_task_address_get (NRF_CLOCK_Type const *p_reg, nrf_clock_task_t task) |
Function for retrieving the address of the specified task. More... | |
NRF_STATIC_INLINE void | nrf_clock_task_trigger (NRF_CLOCK_Type *p_reg, nrf_clock_task_t task) |
Function for setting the specified task. More... | |
NRF_STATIC_INLINE uint32_t | nrf_clock_event_address_get (NRF_CLOCK_Type const *p_reg, nrf_clock_event_t event) |
Function for retrieving the address of the specified event. More... | |
NRF_STATIC_INLINE void | nrf_clock_event_clear (NRF_CLOCK_Type *p_reg, nrf_clock_event_t event) |
Function for clearing the specified event. More... | |
NRF_STATIC_INLINE bool | nrf_clock_event_check (NRF_CLOCK_Type const *p_reg, nrf_clock_event_t event) |
Function for retrieving the state of the specified event. More... | |
NRF_STATIC_INLINE bool | nrf_clock_start_task_check (NRF_CLOCK_Type const *p_reg, nrf_clock_domain_t domain) |
Function for retrieving the trigger status of the task START for given domain. More... | |
NRF_STATIC_INLINE bool | nrf_clock_is_running (NRF_CLOCK_Type const *p_reg, nrf_clock_domain_t domain, void *p_clk_src) |
Function for retrieving the state of the clock. More... | |
NRF_STATIC_INLINE void | nrf_clock_lf_src_set (NRF_CLOCK_Type *p_reg, nrf_clock_lfclk_t source) |
Function for changing the low-frequency clock source. More... | |
NRF_STATIC_INLINE nrf_clock_lfclk_t | nrf_clock_lf_src_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the selected source for the low-frequency clock. More... | |
NRF_STATIC_INLINE nrf_clock_lfclk_t | nrf_clock_lf_actv_src_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the active source of the low-frequency clock. More... | |
NRF_STATIC_INLINE nrf_clock_lfclk_t | nrf_clock_lf_srccopy_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the clock source for the LFCLK clock when the task LKCLKSTART is triggered. More... | |
NRF_STATIC_INLINE bool | nrf_clock_lf_is_running (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the state of the LFCLK clock. More... | |
NRF_STATIC_INLINE nrf_clock_start_task_status_t | nrf_clock_lf_start_task_status_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the trigger status of the task LFCLKSTART. More... | |
NRF_STATIC_INLINE void | nrf_clock_hf_src_set (NRF_CLOCK_Type *p_reg, nrf_clock_hfclk_t source) |
Function for changing the high-frequency clock source. More... | |
NRF_STATIC_INLINE nrf_clock_hfclk_t | nrf_clock_hf_src_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the selected source of the high-frequency clock. More... | |
NRF_STATIC_INLINE bool | nrf_clock_hf_is_running (NRF_CLOCK_Type const *p_reg, nrf_clock_hfclk_t clk_src) |
Function for retrieving the state of the HFCLK clock. More... | |
NRF_STATIC_INLINE nrf_clock_start_task_status_t | nrf_clock_hf_start_task_status_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the trigger status of the task HFCLKSTART. More... | |
NRF_STATIC_INLINE void | nrf_clock_hfclkaudio_config_set (NRF_CLOCK_Type *p_reg, uint16_t freq_value) |
Function for changing the Audio clock FREQ_VALUE. More... | |
NRF_STATIC_INLINE uint16_t | nrf_clock_hfclkaudio_config_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the Audio clock FREQ_VALUE. More... | |
NRF_STATIC_INLINE void | nrf_clock_cal_timer_timeout_set (NRF_CLOCK_Type *p_reg, uint32_t interval) |
Function for changing the calibration timer interval. More... | |
NRF_STATIC_INLINE void | nrf_clock_hfclk192m_div_set (NRF_CLOCK_Type *p_reg, nrf_clock_hfclk_div_t divider) |
Function for changing the HFCLK192M frequency divider. More... | |
NRF_STATIC_INLINE nrf_clock_hfclk_div_t | nrf_clock_hfclk192m_div_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the HFCLK192M frequency divider. More... | |
NRF_STATIC_INLINE void | nrf_clock_hfclk192m_src_set (NRF_CLOCK_Type *p_reg, nrf_clock_hfclk_t source) |
Function for changing the HFCLK192M source. More... | |
NRF_STATIC_INLINE nrf_clock_hfclk_t | nrf_clock_hfclk192m_src_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the selected source of the HFCLK192M. More... | |
NRF_STATIC_INLINE void | nrf_clock_alwaysrun_set (NRF_CLOCK_Type *p_reg, nrf_clock_domain_t domain, bool alwaysrun) |
Function for setting the clock domain to always run. More... | |
NRF_STATIC_INLINE bool | nrf_clock_alwaysrun_get (NRF_CLOCK_Type const *p_reg, nrf_clock_domain_t domain) |
Function for checking if the clock domain is configured to always run. More... | |
NRF_STATIC_INLINE bool | nrf_clock_alwaysrun_active_get (NRF_CLOCK_Type const *p_reg, nrf_clock_domain_t domain) |
Function for checking if the clock domain always run setting is active. More... | |
NRF_STATIC_INLINE void | nrf_clock_subscribe_set (NRF_CLOCK_Type *p_reg, nrf_clock_task_t task, uint8_t channel) |
Function for setting the subscribe configuration for a given CLOCK task. More... | |
NRF_STATIC_INLINE void | nrf_clock_subscribe_clear (NRF_CLOCK_Type *p_reg, nrf_clock_task_t task) |
Function for clearing the subscribe configuration for a given CLOCK task. More... | |
NRF_STATIC_INLINE void | nrf_clock_publish_set (NRF_CLOCK_Type *p_reg, nrf_clock_event_t event, uint8_t channel) |
Function for setting the publish configuration for a given CLOCK event. More... | |
NRF_STATIC_INLINE void | nrf_clock_publish_clear (NRF_CLOCK_Type *p_reg, nrf_clock_event_t event) |
Function for clearing the publish configuration for a given CLOCK event. More... | |
Hardware access layer for managing the CLOCK peripheral.
This code can be used to manage low-frequency clock (LFCLK), high-frequency clock (HFCLK), high-frequency 192 MHz clock (HFCLK192M) and high-frequency audio clock (HFCLKAUDIO) settings.
enum nrf_clock_event_t |
Events.
enum nrf_clock_hfclk_t |
enum nrf_clock_int_mask_t |
Interrupts.
enum nrf_clock_lfclk_t |
Low-frequency clock sources.
Used by LFCLKSRC, LFCLKSTAT, and LFCLKSRCCOPY registers.
Enumerator | |
---|---|
NRF_CLOCK_LFCLK_LFULP | Internal 32 kHz Ultra-low power oscillator. |
NRF_CLOCK_LFCLK_RC | Internal 32 kHz RC oscillator. |
NRF_CLOCK_LFCLK_Xtal | External 32 kHz crystal. |
NRF_CLOCK_LFCLK_Synth | Internal 32 kHz synthesized from HFCLK system clock. |
NRF_CLOCK_LFCLK_Xtal_Low_Swing | External 32 kHz low swing signal. Used only with the LFCLKSRC register. For the others NRF_CLOCK_LFCLK_Xtal is returned for this setting. |
NRF_CLOCK_LFCLK_Xtal_Full_Swing | External 32 kHz full swing signal. Used only with the LFCLKSRC register. For the others NRF_CLOCK_LFCLK_Xtal is returned for this setting. |
enum nrf_clock_task_t |
Tasks.
The NRF_CLOCK_TASK_LFCLKSTOP task cannot be set when the low-frequency clock is not running. The NRF_CLOCK_TASK_HFCLKSTOP task cannot be set when the high-frequency clock is not running.
NRF_STATIC_INLINE bool nrf_clock_alwaysrun_active_get | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_domain_t | domain | ||
) |
Function for checking if the clock domain always run setting is active.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | domain | Clock domain. |
true | The clock domain always run setting is active. |
false | The clock domain always run setting is not active. |
NRF_STATIC_INLINE bool nrf_clock_alwaysrun_get | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_domain_t | domain | ||
) |
Function for checking if the clock domain is configured to always run.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | domain | Clock domain. |
true | The clock domain is configured to always run. |
false | The clock domain is not configured to always run. |
NRF_STATIC_INLINE void nrf_clock_alwaysrun_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_domain_t | domain, | ||
bool | alwaysrun | ||
) |
Function for setting the clock domain to always run.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | domain | Clock domain. |
[in] | alwaysrun | Ensure the clock is always running. |
NRF_STATIC_INLINE void nrf_clock_cal_timer_timeout_set | ( | NRF_CLOCK_Type * | p_reg, |
uint32_t | interval | ||
) |
Function for changing the calibration timer interval.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | interval | New calibration timer interval in 0.25 s resolution (range: 0.25 seconds to 31.75 seconds). |
NRF_STATIC_INLINE uint32_t nrf_clock_event_address_get | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_event_t | event | ||
) |
Function for retrieving the address of the specified event.
This function can be used by the PPI module.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | CLOCK Event. |
NRF_STATIC_INLINE bool nrf_clock_event_check | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_event_t | event | ||
) |
Function for retrieving the state of the specified event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be checked. |
true | The event has been generated. |
false | The event has not been generated. |
NRF_STATIC_INLINE void nrf_clock_event_clear | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_event_t | event | ||
) |
Function for clearing the specified event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to clear. |
NRF_STATIC_INLINE bool nrf_clock_hf_is_running | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_hfclk_t | clk_src | ||
) |
Function for retrieving the state of the HFCLK clock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | clk_src | Clock source to be checked. |
false | The HFCLK clock is not running. |
true | The HFCLK clock is running. |
NRF_STATIC_INLINE nrf_clock_hfclk_t nrf_clock_hf_src_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the selected source of the high-frequency clock.
For SoCs not featuring the HFCLKSRC register, this is always also the active source of the high-frequency clock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_HFCLK_LOW_ACCURACY | The internal RC oscillator is the selected source of the high-frequency clock. |
NRF_CLOCK_HFCLK_HIGH_ACCURACY | An external crystal oscillator is the selected source of the high-frequency clock. |
NRF_STATIC_INLINE void nrf_clock_hf_src_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_hfclk_t | source | ||
) |
Function for changing the high-frequency clock source.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | source | New high-frequency clock source. |
NRF_STATIC_INLINE nrf_clock_start_task_status_t nrf_clock_hf_start_task_status_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the trigger status of the task HFCLKSTART.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_START_TASK_NOT_TRIGGERED | The task HFCLKSTART has not been triggered. |
NRF_CLOCK_START_TASK_TRIGGERED | The task HFCLKSTART has been triggered. |
NRF_STATIC_INLINE nrf_clock_hfclk_div_t nrf_clock_hfclk192m_div_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the HFCLK192M frequency divider.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_clock_hfclk192m_div_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_hfclk_div_t | divider | ||
) |
Function for changing the HFCLK192M frequency divider.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | divider | New HFCLK192M divider. |
NRF_STATIC_INLINE nrf_clock_hfclk_t nrf_clock_hfclk192m_src_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the selected source of the HFCLK192M.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_HFCLK_LOW_ACCURACY | The internal RC oscillator is the selected source of the HFCLK192M. |
NRF_CLOCK_HFCLK_HIGH_ACCURACY | An external crystal oscillator is the selected source of the HFCLK192M. |
NRF_STATIC_INLINE void nrf_clock_hfclk192m_src_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_hfclk_t | source | ||
) |
Function for changing the HFCLK192M source.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | source | New HFCLK192M source. |
NRF_STATIC_INLINE uint16_t nrf_clock_hfclkaudio_config_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the Audio clock FREQ_VALUE.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
The frequency of HFCLKAUDIO ranges from 10.666 MHz to 13.333 MHz in 40.7 Hz steps. To calculate frequency corresponding to the returned FREQ_VALUE, use the following equation: f_out = 32M * (4 + FREQ_VALUE * 2^(-16))/12
NRF_STATIC_INLINE void nrf_clock_hfclkaudio_config_set | ( | NRF_CLOCK_Type * | p_reg, |
uint16_t | freq_value | ||
) |
Function for changing the Audio clock FREQ_VALUE.
The frequency of HFCLKAUDIO ranges from 10.666 MHz to 13.333 MHz in 40.7 Hz steps. To calculate freq_value
corresponding to the chosen frequency, use the following equation: FREQ_VALUE = 2^16 * ((12 * f_out / 32M) - 4)
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | freq_value | New FREQ_VALUE |
NRF_STATIC_INLINE void nrf_clock_int_disable | ( | NRF_CLOCK_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling the specified interrupt.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. |
NRF_STATIC_INLINE void nrf_clock_int_enable | ( | NRF_CLOCK_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling the specified interrupt.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. |
NRF_STATIC_INLINE uint32_t nrf_clock_int_enable_check | ( | NRF_CLOCK_Type const * | p_reg, |
uint32_t | mask | ||
) |
Function for checking if the specified interrupts are enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. |
NRF_STATIC_INLINE bool nrf_clock_is_running | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_domain_t | domain, | ||
void * | p_clk_src | ||
) |
Function for retrieving the state of the clock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | domain | Clock domain. |
[out] | p_clk_src | Pointer to clock source that is running. Set to NULL if not needed. Ignored for HFCLKAUDIO domain. Variable pointed by p_clk_src must be of either nrf_clock_lfclk_t type for LFCLK or nrf_clock_hfclk_t type for HFCLK and HFCLK192M. |
false | The clock is not running. |
true | The clock is running. |
NRF_STATIC_INLINE nrf_clock_lfclk_t nrf_clock_lf_actv_src_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the active source of the low-frequency clock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_LFCLK_RC | The internal 32 kHz RC oscillator is the active source of the low-frequency clock. |
NRF_CLOCK_LFCLK_Xtal | An external 32 kHz crystal oscillator is the active source of the low-frequency clock. |
NRF_CLOCK_LFCLK_Synth | The internal 32 kHz synthesized from the HFCLK is the active source of the low-frequency clock. |
NRF_STATIC_INLINE bool nrf_clock_lf_is_running | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the state of the LFCLK clock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
false | The LFCLK clock is not running. |
true | The LFCLK clock is running. |
NRF_STATIC_INLINE nrf_clock_lfclk_t nrf_clock_lf_src_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the selected source for the low-frequency clock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_LFCLK_RC | The internal 32 kHz RC oscillator is the selected source for the low-frequency clock. |
NRF_CLOCK_LFCLK_Xtal | An external 32 kHz crystal oscillator is the selected source for the low-frequency clock. |
NRF_CLOCK_LFCLK_Synth | The internal 32 kHz synthesized from the HFCLK is the selected source for the low-frequency clock. |
NRF_STATIC_INLINE void nrf_clock_lf_src_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_lfclk_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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | source | New low-frequency clock source. |
NRF_STATIC_INLINE nrf_clock_lfclk_t nrf_clock_lf_srccopy_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the clock source for the LFCLK clock when the task LKCLKSTART is triggered.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_LFCLK_RC | The internal 32 kHz RC oscillator is running and generating the LFCLK clock. |
NRF_CLOCK_LFCLK_Xtal | An external 32 kHz crystal oscillator is running and generating the LFCLK clock. |
NRF_CLOCK_LFCLK_Synth | The internal 32 kHz synthesized from the HFCLK is running and generating the LFCLK clock. |
NRF_STATIC_INLINE nrf_clock_start_task_status_t nrf_clock_lf_start_task_status_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the trigger status of the task LFCLKSTART.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_CLOCK_START_TASK_NOT_TRIGGERED | The task LFCLKSTART has not been triggered. |
NRF_CLOCK_START_TASK_TRIGGERED | The task LFCLKSTART has been triggered. |
NRF_STATIC_INLINE void nrf_clock_publish_clear | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_event_t | event | ||
) |
Function for clearing the publish configuration for a given CLOCK event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to clear the configuration. |
NRF_STATIC_INLINE void nrf_clock_publish_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_event_t | event, | ||
uint8_t | channel | ||
) |
Function for setting the publish configuration for a given CLOCK event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to set the configuration. |
[in] | channel | Channel through which to publish the event. |
NRF_STATIC_INLINE bool nrf_clock_start_task_check | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_domain_t | domain | ||
) |
Function for retrieving the trigger status of the task START for given domain.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | domain | Clock domain. |
false | The task START for the given domain has not been triggered. |
true | The task START for the given domain has been triggered. |
NRF_STATIC_INLINE void nrf_clock_subscribe_clear | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_task_t | task | ||
) |
Function for clearing the subscribe configuration for a given CLOCK task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to clear the configuration. |
NRF_STATIC_INLINE void nrf_clock_subscribe_set | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_task_t | task, | ||
uint8_t | channel | ||
) |
Function for setting the subscribe configuration for a given CLOCK task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to set the configuration. |
[in] | channel | Channel through which to subscribe events. |
NRF_STATIC_INLINE uint32_t nrf_clock_task_address_get | ( | NRF_CLOCK_Type const * | p_reg, |
nrf_clock_task_t | task | ||
) |
Function for retrieving the address of the specified task.
This function can be used by the PPI module.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | CLOCK Task. |
NRF_STATIC_INLINE void nrf_clock_task_trigger | ( | NRF_CLOCK_Type * | p_reg, |
nrf_clock_task_t | task | ||
) |
Function for setting the specified task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task to be activated. |