Hardware access layer for managing the CLOCK peripheral. More...
Macros | |
#define | NRF_CLOCK_HAS_CALIBRATION 1 |
Symbol indicating whether the Low Frequency Clock calibration is present. | |
#define | NRF_CLOCK_HAS_CALIBRATION_TIMER 1 |
Symbol indicating whether the Low Frequency Clock calibration timer is present. | |
#define | NRF_CLOCK_HAS_HFCLK192M 1 |
Symbol indicating whether the 192 MHz clock is present. | |
#define | NRF_CLOCK_HAS_HFCLKAUDIO 1 |
Symbol indicating whether the Audio clock is present. | |
#define | NRF_CLOCK_HAS_HFCLK_DIV 1 |
Symbol indicating whether the HFCLK frequency configuration is present. | |
#define | NRF_CLOCK_HAS_LFCLK_ALWAYSRUN 1 |
Symbol indicating whether the ALWAYSRUN register is present for LFCLK. | |
#define | NRF_CLOCK_HAS_HFCLK_ALWAYSRUN 1 |
Symbol indicating whether the ALWAYSRUN register is present for HFCLK. | |
#define | NRF_CLOCK_HAS_HFCLKSRC 1 |
Symbol indicating whether the HFCLKSRC register is present. | |
#define | NRF_CLOCK_HAS_PLL 1 |
Symbol indicating whether the PLL section is present. | |
#define | NRF_CLOCK_HAS_XO 1 |
Symbol indicating whether XO registers are present. | |
#define | NRF_CLOCK_HAS_LFCLK_TYPE 1 |
Symbol indicating whether the CLOCK type contains LFCLK subtype. | |
#define | NRF_CLOCK_LFCLKRUN_STATUS_NotTriggered CLOCK_LFCLK_RUN_STATUS_NotTriggered |
#define | NRF_CLOCK_LFCLKRUN_STATUS_Triggered CLOCK_LFCLK_RUN_STATUS_Triggered |
#define | NRF_CLOCK_INTENSET_LFCLKSTARTED_Msk CLOCK_INTENSET_LFCLKSTARTED_Msk |
#define | NRF_LFCLKSRCCOPY LFCLK.SRCCOPY |
#define | NRF_LFCLKRUN LFCLK.RUN |
#define | NRF_LFCLKSTAT LFCLK.STAT |
#define | NRF_LFCLKSRC LFCLK.SRC |
#define | NRF_LFCLKALWAYSRUN LFCLK.ALWAYSRUN |
#define | NRF_CLOCK_LFCLKSRCCOPY_SRC_Msk CLOCK_LFCLK_SRCCOPY_SRC_Msk |
#define | NRF_CLOCK_LFCLKSRCCOPY_SRC_Pos CLOCK_LFCLK_SRCCOPY_SRC_Pos |
#define | NRF_CLOCK_LFCLKRUN_STATUS_Msk CLOCK_LFCLK_RUN_STATUS_Msk |
#define | NRF_CLOCK_LFCLKRUN_STATUS_Pos CLOCK_LFCLK_RUN_STATUS_Pos |
#define | NRF_CLOCK_LFCLKSTAT_SRC_Msk CLOCK_LFCLK_STAT_SRC_Msk |
#define | NRF_CLOCK_LFCLKSTAT_SRC_Pos CLOCK_LFCLK_STAT_SRC_Pos |
#define | NRF_CLOCK_LFCLKSTAT_STATE_Msk CLOCK_LFCLK_STAT_STATE_Msk |
#define | NRF_CLOCK_LFCLKSTAT_STATE_Pos CLOCK_LFCLK_STAT_STATE_Pos |
#define | NRF_CLOCK_LFCLKSTAT_ALWAYSRUNNING_Msk CLOCK_LFCLK_STAT_ALWAYSRUNNING_Msk |
#define | NRF_CLOCK_LFCLKSTAT_ALWAYSRUNNING_Pos CLOCK_LFCLK_STAT_ALWAYSRUNNING_Pos |
#define | NRF_CLOCK_LFCLKALWAYSRUN_ALWAYSRUN_Msk CLOCK_LFCLK_ALWAYSRUN_ALWAYSRUN_Msk |
#define | NRF_CLOCK_LFCLKALWAYSRUN_ALWAYSRUN_Pos CLOCK_LFCLK_ALWAYSRUN_ALWAYSRUN_Pos |
#define | NRF_CLOCK_INTENSET_HFCLKSTARTED_Msk CLOCK_INTEN_XOSTARTED_Msk |
#define | NRF_TASKS_HFCLKSTART TASKS_XOSTART |
#define | NRF_TASKS_HFCLKSTOP TASKS_XOSTOP |
#define | NRF_EVENTS_HFCLKSTARTED EVENTS_XOSTARTED |
#define | NRF_HFCLKRUN XO.RUN |
#define | NRF_HFCLKSTAT XO.STAT |
#define | NRF_CLOCK_HFCLKRUN_STATUS_Msk CLOCK_XO_RUN_STATUS_Msk |
#define | NRF_CLOCK_HFCLKRUN_STATUS_Pos CLOCK_XO_RUN_STATUS_Pos |
#define | NRF_CLOCK_HFCLKSTAT_STATE_Msk CLOCK_XO_STAT_STATE_Msk |
#define | NRF_CLOCK_HFCLKSTAT_STATE_Pos CLOCK_XO_STAT_STATE_Pos |
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_HIGH_ACCURACY = CLOCK_HFCLKSTAT_SRC_Xtal , NRF_CLOCK_HFCLK_LOW_ACCURACY = CLOCK_HFCLKSTAT_SRC_RC } |
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_LFCLK_RUN_STATUS_NotTriggered , NRF_CLOCK_START_TASK_TRIGGERED = CLOCK_LFCLK_RUN_STATUS_Triggered } |
Trigger status of task LFCLKSTART/HFCLKSTART. More... | |
enum | nrf_clock_int_mask_t { NRF_CLOCK_INT_HF_STARTED_MASK = CLOCK_INTEN_XOSTARTED_Msk , NRF_CLOCK_INT_LF_STARTED_MASK = CLOCK_INTENSET_LFCLKSTARTED_Msk , NRFX_CLOCK_INT_PLL_STARTED_MASK = CLOCK_INTENSET_PLLSTARTED_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_XOSTART) , NRF_CLOCK_TASK_HFCLKSTOP = offsetof(NRF_CLOCK_Type, TASKS_XOSTOP) , NRF_CLOCK_TASK_PLLSTART = offsetof(NRF_CLOCK_Type, TASKS_PLLSTART) , NRF_CLOCK_TASK_PLLSTOP = offsetof(NRF_CLOCK_Type, TASKS_PLLSTOP) , 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_XOSTARTED) , NRF_CLOCK_EVENT_PLLSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_PLLSTARTED) , 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. | |
NRF_STATIC_INLINE void | nrf_clock_int_disable (NRF_CLOCK_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupt. | |
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. | |
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. | |
NRF_STATIC_INLINE void | nrf_clock_task_trigger (NRF_CLOCK_Type *p_reg, nrf_clock_task_t task) |
Function for setting the specified task. | |
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. | |
NRF_STATIC_INLINE void | nrf_clock_event_clear (NRF_CLOCK_Type *p_reg, nrf_clock_event_t event) |
Function for clearing the specified 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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
NRF_STATIC_INLINE bool | nrf_clock_lf_is_running (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the state of 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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
NRF_STATIC_INLINE uint16_t | nrf_clock_hfclkaudio_config_get (NRF_CLOCK_Type const *p_reg) |
Function for retrieving the Audio clock FREQ_VALUE. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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.
#define NRF_CLOCK_HFCLKRUN_STATUS_Msk CLOCK_XO_RUN_STATUS_Msk |
HF clock RUN status mask definition.
#define NRF_CLOCK_HFCLKRUN_STATUS_Pos CLOCK_XO_RUN_STATUS_Pos |
HF clock RUN status position definition.
#define NRF_CLOCK_HFCLKSTAT_STATE_Msk CLOCK_XO_STAT_STATE_Msk |
HF clock STAT state mask definition.
#define NRF_CLOCK_HFCLKSTAT_STATE_Pos CLOCK_XO_STAT_STATE_Pos |
HF clock STAT state position definition.
#define NRF_CLOCK_INTENSET_HFCLKSTARTED_Msk CLOCK_INTEN_XOSTARTED_Msk |
HF clock bit mask in interrupt register.
#define NRF_CLOCK_INTENSET_LFCLKSTARTED_Msk CLOCK_INTENSET_LFCLKSTARTED_Msk |
Interrupt on LFCLKSTARTED event mask definition.
#define NRF_CLOCK_LFCLKALWAYSRUN_ALWAYSRUN_Msk CLOCK_LFCLK_ALWAYSRUN_ALWAYSRUN_Msk |
LF clock ALWAYSRUN position definition.
#define NRF_CLOCK_LFCLKALWAYSRUN_ALWAYSRUN_Pos CLOCK_LFCLK_ALWAYSRUN_ALWAYSRUN_Pos |
LF clock ALWAYSRUN mask definition.
#define NRF_CLOCK_LFCLKRUN_STATUS_Msk CLOCK_LFCLK_RUN_STATUS_Msk |
LF clock RUN status mask definition.
#define NRF_CLOCK_LFCLKRUN_STATUS_NotTriggered CLOCK_LFCLK_RUN_STATUS_NotTriggered |
Task LFCLKSTART/HFCLKSTART has not been triggered definiton.
#define NRF_CLOCK_LFCLKRUN_STATUS_Pos CLOCK_LFCLK_RUN_STATUS_Pos |
LF clock RUN status position definition.
#define NRF_CLOCK_LFCLKRUN_STATUS_Triggered CLOCK_LFCLK_RUN_STATUS_Triggered |
Task LFCLKSTART/HFCLKSTART has been triggered.
#define NRF_CLOCK_LFCLKSRCCOPY_SRC_Msk CLOCK_LFCLK_SRCCOPY_SRC_Msk |
LF clock SRCCOPY status mask definition.
#define NRF_CLOCK_LFCLKSRCCOPY_SRC_Pos CLOCK_LFCLK_SRCCOPY_SRC_Pos |
LF clock SRCCOPY status position definition.
#define NRF_CLOCK_LFCLKSTAT_ALWAYSRUNNING_Msk CLOCK_LFCLK_STAT_ALWAYSRUNNING_Msk |
LF clock STAT alwaysrunning position definition.
#define NRF_CLOCK_LFCLKSTAT_ALWAYSRUNNING_Pos CLOCK_LFCLK_STAT_ALWAYSRUNNING_Pos |
LF clock STAT alwaysrunning mask definition.
#define NRF_CLOCK_LFCLKSTAT_SRC_Msk CLOCK_LFCLK_STAT_SRC_Msk |
LF clock STAT source mask definition.
#define NRF_CLOCK_LFCLKSTAT_SRC_Pos CLOCK_LFCLK_STAT_SRC_Pos |
LF clock STAT source position definition.
#define NRF_CLOCK_LFCLKSTAT_STATE_Msk CLOCK_LFCLK_STAT_STATE_Msk |
LF clock STAT state mask definition.
#define NRF_CLOCK_LFCLKSTAT_STATE_Pos CLOCK_LFCLK_STAT_STATE_Pos |
LF clock STAT state position definition.
#define NRF_EVENTS_HFCLKSTARTED EVENTS_XOSTARTED |
Event HF clock startrd definition.
#define NRF_HFCLKRUN XO.RUN |
HF clock RUN register definition.
#define NRF_HFCLKSTAT XO.STAT |
HF clock STAT register definition.
#define NRF_LFCLKALWAYSRUN LFCLK.ALWAYSRUN |
LF clock ALWAYSRUN register definition.
#define NRF_LFCLKRUN LFCLK.RUN |
LF clock RUN register definition.
#define NRF_LFCLKSRC LFCLK.SRC |
LF clock SRC register definition.
#define NRF_LFCLKSRCCOPY LFCLK.SRCCOPY |
LF clock SRCCOPY register definition.
#define NRF_LFCLKSTAT LFCLK.STAT |
LF clock STAT register definition.
#define NRF_TASKS_HFCLKSTART TASKS_XOSTART |
Task HF clock start definition.
#define NRF_TASKS_HFCLKSTOP TASKS_XOSTOP |
Task HF clock stop definition.
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. |
Trigger status of task LFCLKSTART/HFCLKSTART.
Used by LFCLKRUN and HFCLKRUN registers.
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. |
< LF clock STAT register definition.
< LF clock STAT alwaysrunning position definition.
< LF clock STAT alwaysrunning mask definition.
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. |
< LF clock ALWAYSRUN register definition.
< LF clock ALWAYSRUN position definition.
< LF clock ALWAYSRUN mask definition.
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. |
< LF clock ALWAYSRUN register definition.
< LF clock ALWAYSRUN mask definition.
< LF clock ALWAYSRUN position definition.
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. Use nrf_clock_int_mask_t values for bit masking. |
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. Use nrf_clock_int_mask_t values for bit masking. |
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. Use nrf_clock_int_mask_t values for bit masking. |
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. |
< LF clock STAT register definition.
< LF clock STAT state mask definition.
< LF clock STAT register definition.
< LF clock STAT source mask definition.
< LF clock STAT source position definition.
< HF clock STAT register definition.
< HF clock STAT state mask definition.
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. |
< LF clock SRC register definition.
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. |
< LF clock SRC register definition.
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. |
< LF clock SRCCOPY register definition.
< LF clock SRCCOPY status mask definition.
< LF clock SRCCOPY status position definition.
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. |
< LF clock RUN register definition.
< LF clock RUN status mask definition.
< LF clock RUN status position definition.
< HF clock RUN register definition.
< HF clock RUN status mask definition.
< HF clock RUN status position definition.
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. |