@@ -264,6 +264,18 @@ NRF_STATIC_INLINE void nrf_clock_event_clear(NRF_CLOCK_Type * p_reg, nrf_clock_e
264264 */
265265NRF_STATIC_INLINE bool nrf_clock_event_check (NRF_CLOCK_Type const * p_reg , nrf_clock_event_t event );
266266
267+ /**
268+ * @brief Function for retrieving the trigger status of the task START for given domain.
269+ *
270+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
271+ * @param[in] domain Clock domain.
272+ *
273+ * @retval false The task START for the given domain has not been triggered.
274+ * @retval true The task START for the given domain has been triggered.
275+ */
276+ NRF_STATIC_INLINE bool nrf_clock_start_task_check (NRF_CLOCK_Type const * p_reg ,
277+ nrf_clock_domain_t domain );
278+
267279/**
268280 * @brief Function for changing the low-frequency clock source.
269281 * @details This function cannot be called when the low-frequency clock is running.
@@ -287,6 +299,45 @@ NRF_STATIC_INLINE void nrf_clock_lf_src_set(NRF_CLOCK_Type * p_reg, nrf_clock_lf
287299 */
288300NRF_STATIC_INLINE nrf_clock_lfclk_t nrf_clock_lf_src_get (NRF_CLOCK_Type const * p_reg );
289301
302+ /**
303+ * @brief Function for retrieving the clock source for the LFCLK clock when
304+ * the task LKCLKSTART is triggered.
305+ *
306+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
307+ *
308+ * @retval NRF_CLOCK_LFCLK_RC The internal 32 kHz RC oscillator
309+ * is running and generating the LFCLK clock.
310+ * @retval NRF_CLOCK_LFCLK_Xtal An external 32 kHz crystal oscillator
311+ * is running and generating the LFCLK clock.
312+ * @retval NRF_CLOCK_LFCLK_Synth The internal 32 kHz synthesized from
313+ * the HFCLK is running and generating the LFCLK clock.
314+ */
315+ NRF_STATIC_INLINE nrf_clock_lfclk_t nrf_clock_lf_srccopy_get (NRF_CLOCK_Type const * p_reg );
316+
317+ /**
318+ * @brief Function for retrieving the selected source of the high-frequency clock.
319+ *
320+ * For SoCs not featuring the HFCLKSRC register, this is always also the active source
321+ * of the high-frequency clock.
322+ *
323+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
324+ *
325+ * @retval NRF_CLOCK_HFCLK_LOW_ACCURACY The internal RC oscillator is the selected
326+ * source of the high-frequency clock.
327+ * @retval NRF_CLOCK_HFCLK_HIGH_ACCURACY An external crystal oscillator is the selected
328+ * source of the high-frequency clock.
329+ */
330+ NRF_STATIC_INLINE nrf_clock_hfclk_t nrf_clock_hf_src_get (NRF_CLOCK_Type const * p_reg );
331+
332+ /**
333+ * @brief Function for changing the calibration timer interval.
334+ *
335+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
336+ * @param[in] interval New calibration timer interval in 0.25 s resolution
337+ * (range: 0.25 seconds to 31.75 seconds).
338+ */
339+ void nrf_clock_cal_timer_timeout_set (NRF_CLOCK_Type * p_reg , uint32_t interval );
340+
290341
291342/* Bodies for inlined functions */
292343
@@ -300,6 +351,23 @@ NRF_STATIC_INLINE bool nrf_clock_event_check(NRF_CLOCK_Type const * p_reg, nrf_c
300351 return (bool )* ((volatile uint32_t * )((uint8_t * )p_reg + event ));
301352}
302353
354+ NRF_STATIC_INLINE bool nrf_clock_start_task_check (NRF_CLOCK_Type const * p_reg ,
355+ nrf_clock_domain_t domain )
356+ {
357+ switch (domain )
358+ {
359+ case NRF_CLOCK_DOMAIN_LFCLK :
360+ return ((p_reg -> LFCLKRUN & CLOCK_LFCLKRUN_STATUS_Msk )
361+ >> CLOCK_LFCLKRUN_STATUS_Pos );
362+ case NRF_CLOCK_DOMAIN_HFCLK :
363+ return ((p_reg -> HFCLKRUN & CLOCK_HFCLKRUN_STATUS_Msk )
364+ >> CLOCK_HFCLKRUN_STATUS_Pos );
365+ default :
366+ NRFX_ASSERT (0 );
367+ return false;
368+ }
369+ }
370+
303371NRF_STATIC_INLINE void nrf_clock_lf_src_set (NRF_CLOCK_Type * p_reg , nrf_clock_lfclk_t source )
304372{
305373 p_reg -> LFCLKSRC = (uint32_t )(source );
@@ -369,6 +437,19 @@ NRF_STATIC_INLINE bool nrf_clock_is_running(NRF_CLOCK_Type const * p_reg,
369437 return false;
370438}
371439
440+ NRF_STATIC_INLINE nrf_clock_lfclk_t nrf_clock_lf_srccopy_get (NRF_CLOCK_Type const * p_reg )
441+ {
442+ /*simple approximation LFCLKSRC = LFCLKSRCCOPY*/
443+ return (nrf_clock_lfclk_t )((p_reg -> LFCLKSRC & CLOCK_LFCLKSRC_SRC_Msk )
444+ >> CLOCK_LFCLKSRC_SRC_Pos );
445+ }
446+
447+ NRF_STATIC_INLINE nrf_clock_hfclk_t nrf_clock_hf_src_get (NRF_CLOCK_Type const * p_reg )
448+ {
449+ return (nrf_clock_hfclk_t )((p_reg -> HFCLKSTAT & CLOCK_HFCLKSTAT_SRC_Msk )
450+ >> CLOCK_HFCLKSTAT_SRC_Pos );
451+ }
452+
372453#ifdef __cplusplus
373454}
374455#endif
0 commit comments