![]() |
nrfx 4.5.0
|
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_HFCLK24M 1 |
| Symbol indicating whether the 24 MHz 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_HFCLK 1 |
| Symbol indicating whether the HFCLK clock is present. | |
| #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_XTAL 1 |
| Symbol indicating whether XTAL clock source is present. | |
| #define | NRF_CLOCK_HAS_XO_TUNE 1 |
| Symbol indicating whether XOTUNE registers are present. | |
| #define | NRF_CLOCK_HAS_LFCLK 1 |
| Symbol indicating whether the LFCLK clock is present. | |
| #define | NRF_CLOCK_HAS_LFCLK_TYPE 1 |
| Symbol indicating whether the CLOCK type contains LFCLK subtype. | |
| #define | NRF_CLOCK_HAS_LFCLK_LFXO 1 |
| Symbol indicating whether LFCLK has LFXO source. | |
| #define | NRF_CLOCK_HAS_INTPEND 1 |
| Symbol indicating whether INTPEND register is present. | |
| #define | NRF_CLOCK_HAS_LFCLKCTRL 1 |
| Symbol indicating whether the CLOCK type contains LFCLKCTRL subtype. | |
| #define | NRF_CLOCK_HAS_LFCLKSTAT_SRC_RUN 1 |
| Symbol indicating whether the CLOCK type contains LFCLKSTAT subtype with SRC and RUN registers. | |
| #define | NRF_CLOCK_HAS_CONFIG 1 |
| Symbol indicating whether the CLOCK type contains CONFIG subtype. | |
| #define | NRF_CLOCK_HAS_LFCLK_SRC_CHANGED 1 |
| Symbol indicating whether LFCLK source change event is present. | |
| #define | NRF_CLOCK_HAS_SRC_COPY 1 |
| Symbol indicating whether SRCCOPY register for LFCLK is present. | |
| #define | NRF_CLOCK_HAS_ALWAYSRUN_ACTIVE 1 |
| Symbol indicating whether clock domain always run setting is available. | |
| #define | NRF_CLOCK_HAS_HFDOMAIN 1 |
| Symbol indicating whether high frequency clock domain is present. | |
| #define | NRF_CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT 1 |
| Symbol indicating whether high frequency clock divide register is present. | |
| #define | NRF_CLOCK_HAS_CALSTOP 1 |
| Symbol indicating whether the LFCLK calibration stop task is present. | |
| #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_LPRC = (CLOCK_LFCLKSTAT_SRC_LFLPRC_Active << CLOCK_LFCLKSTAT_SRC_LFLPRC_Pos) , 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_LPRC_XTAL = NRF_CLOCK_LFCLK_LPRC | NRF_CLOCK_LFCLK_XTAL , NRF_CLOCK_LFCLK_RC_XTAL = NRF_CLOCK_LFCLK_RC | NRF_CLOCK_LFCLK_XTAL , NRF_CLOCK_LFCLK_SYNTH_XTAL = NRF_CLOCK_LFCLK_SYNTH | NRF_CLOCK_LFCLK_XTAL , 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 , NRF_CLOCK_DOMAIN_HFCLK24M } |
| 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_int_mask_t { NRF_CLOCK_INT_HF_STARTED_MASK = CLOCK_INTEN_XOSTARTED_Msk , NRF_CLOCK_INT_LF_STARTED_MASK = CLOCK_INTENSET_LFCLKSTARTED_Msk , NRF_CLOCK_INT_LF_SRC_CHANGED_MASK = CLOCK_INTENSET_LFCLKSRCCHANGED_Msk , NRF_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_HFCLK24M_STARTED_MASK = CLOCK_INTENSET_XO24MSTARTED_Msk , NRF_CLOCK_INT_HF192M_STARTED_MASK = CLOCK_INTENSET_HFCLK192MSTARTED_Msk , NRF_CLOCK_INT_XOTUNED_MASK = CLOCK_INTENSET_XOTUNED_Msk , NRF_CLOCK_INT_XOTUNEERROR_MASK = CLOCK_INTENSET_XOTUNEERROR_Msk , NRF_CLOCK_INT_XOTUNEFAILED_MASK = CLOCK_INTENSET_XOTUNEFAILED_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_CALSTOP = offsetof(NRF_CLOCK_Type, TASKS_CALSTOP) , 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_HFCLK24MSTART = offsetof(NRF_CLOCK_Type, TASKS_XO24MSTART) , NRF_CLOCK_TASK_HFCLK24MSTOP = offsetof(NRF_CLOCK_Type, TASKS_XO24MSTOP) , NRF_CLOCK_TASK_HFCLK192MSTART = offsetof(NRF_CLOCK_Type, TASKS_HFCLK192MSTART) , NRF_CLOCK_TASK_HFCLK192MSTOP = offsetof(NRF_CLOCK_Type, TASKS_HFCLK192MSTOP) , NRF_CLOCK_TASK_XOTUNE = offsetof(NRF_CLOCK_Type, TASKS_XOTUNE) , NRF_CLOCK_TASK_XOTUNEABORT = offsetof(NRF_CLOCK_Type, TASKS_XOTUNEABORT) } |
| 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_LFCLKSRCCHANGED = offsetof(NRF_CLOCK_Type, EVENTS_LFCLKSRCCHANGED) , 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_HFCLK24MSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_XO24MSTARTED) , NRF_CLOCK_EVENT_HFCLK192MSTARTED = offsetof(NRF_CLOCK_Type, EVENTS_HFCLK192MSTARTED) , NRF_CLOCK_EVENT_XOTUNED = offsetof(NRF_CLOCK_Type, EVENTS_XOTUNED) , NRF_CLOCK_EVENT_XOTUNEERROR = offsetof(NRF_CLOCK_Type, EVENTS_XOTUNEERROR) , NRF_CLOCK_EVENT_XOTUNEFAILED = offsetof(NRF_CLOCK_Type, EVENTS_XOTUNEFAILED) } |
| 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_int_pending_get (NRF_CLOCK_Type const *p_reg) |
| Function for retrieving the state of pending interrupts. | |
| 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_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 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 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_hfclk_div_set (NRF_CLOCK_Type *p_reg, nrf_clock_hfclk_div_t divider) |
| Function for changing the HFCLK frequency divider. | |
| NRF_STATIC_INLINE nrf_clock_hfclk_div_t | nrf_clock_hfclk_div_get (NRF_CLOCK_Type const *p_reg) |
| Function for retrieving the HFCLK frequency divider. | |
| 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 uint32_t | nrf_clock_subscribe_get (NRF_CLOCK_Type const *p_reg, nrf_clock_task_t task) |
| Function for getting 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. | |
| NRF_STATIC_INLINE uint32_t | nrf_clock_publish_get (NRF_CLOCK_Type const *p_reg, nrf_clock_event_t event) |
| Function for getting the publish configuration for a given CLOCK event. | |
| NRF_STATIC_INLINE void | nrf_clock_config_reset_enable_set (NRF_CLOCK_Type *p_reg, bool enable) |
| Function controls reset to the LF CLOCK peripheral. | |
| NRF_STATIC_INLINE void | nrf_clock_config_bypass_enable_set (NRF_CLOCK_Type *p_reg, nrf_clock_lfclk_t source, bool enable) |
| Function for enabling bypass. | |
| NRF_STATIC_INLINE void | nrf_clock_config_timeout_set (NRF_CLOCK_Type *p_reg, uint8_t timeout) |
| Function for setting the timeout value for the clock alignment procedure. | |
| NRF_STATIC_INLINE uint8_t | nrf_clock_config_timeout_get (NRF_CLOCK_Type const *p_reg) |
| Function for getting the timeout value for the clock alignment procedure. | |
| NRF_STATIC_INLINE void | nrf_clock_config_threshold_set (NRF_CLOCK_Type *p_reg, uint8_t thr_low, uint8_t thr_high, uint8_t thr_diff) |
| Function for setting threshold limit while clock switching. | |
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), high-frequency audio clock (HFCLKAUDIO) and high-frequency 24 MHz clock (HFCLK24M) 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_LPRC | Internal 32 kHz low power RC oscillator. |
| 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_LPRC_XTAL | Internal 32 kHz low power RC oscillator and external 32 kHz crystal. |
| NRF_CLOCK_LFCLK_RC_XTAL | Internal 32 kHz RC oscillator and external 32 kHz crystal. |
| NRF_CLOCK_LFCLK_SYNTH_XTAL | Internal 32 kHz synthesized and external 32 kHz crystal. |
| 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. |
< 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 void nrf_clock_config_bypass_enable_set | ( | NRF_CLOCK_Type * | p_reg, |
| nrf_clock_lfclk_t | source, | ||
| bool | enable ) |
Function for enabling bypass.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | source | Bypass source. |
| [in] | enable | Enable bypass. |
| NRF_STATIC_INLINE void nrf_clock_config_reset_enable_set | ( | NRF_CLOCK_Type * | p_reg, |
| bool | enable ) |
Function controls reset to the LF CLOCK peripheral.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | enable | Enable reset. |
| NRF_STATIC_INLINE void nrf_clock_config_threshold_set | ( | NRF_CLOCK_Type * | p_reg, |
| uint8_t | thr_low, | ||
| uint8_t | thr_high, | ||
| uint8_t | thr_diff ) |
Function for setting threshold limit while clock switching.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | thr_low | Threshold low limit while clock switching. |
| [in] | thr_high | Threshold high limit while clock switching. |
| [in] | thr_diff | Threshold difference while clock switching. |
| NRF_STATIC_INLINE uint8_t nrf_clock_config_timeout_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for getting the timeout value for the clock alignment procedure.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| Number | of 32Ki clocks. |
| NRF_STATIC_INLINE void nrf_clock_config_timeout_set | ( | NRF_CLOCK_Type * | p_reg, |
| uint8_t | timeout ) |
Function for setting the timeout value for the clock alignment procedure.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | timeout | Number of 32Ki clocks. |
| 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 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_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 nrf_clock_hfclk_div_t nrf_clock_hfclk_div_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the HFCLK frequency divider.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_clock_hfclk_div_set | ( | NRF_CLOCK_Type * | p_reg, |
| nrf_clock_hfclk_div_t | divider ) |
Function for changing the HFCLK frequency divider.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | divider | New HFCLK divider. |
| 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 uint32_t nrf_clock_int_pending_get | ( | NRF_CLOCK_Type const * | p_reg | ) |
Function for retrieving the state of pending interrupts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| 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. |
< HF clock STAT register definition.
< HF clock STAT state mask definition.
| 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. |
< LF clock SRCCOPY register definition.
< LF clock SRCCOPY status mask definition.
< LF clock SRCCOPY status position definition.
| 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 uint32_t nrf_clock_publish_get | ( | NRF_CLOCK_Type const * | p_reg, |
| nrf_clock_event_t | event ) |
Function for getting 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 read 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 uint32_t nrf_clock_subscribe_get | ( | NRF_CLOCK_Type const * | p_reg, |
| nrf_clock_task_t | task ) |
Function for getting 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 read 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. |