Lines Matching refs:NRF_CLOCK
237 nrf_clock_int_disable(NRF_CLOCK, int_mask); in clock_stop()
238 nrf_clock_task_trigger(NRF_CLOCK, task); in clock_stop()
239 nrf_clock_event_clear(NRF_CLOCK, event); in clock_stop()
326 nrf_clock_lf_src_set(NRF_CLOCK, clock_initial_lfclksrc_get()); in nrfx_clock_enable()
328 nrf_clock_hf_src_set(NRF_CLOCK, NRF_CLOCK_HFCLK_HIGH_ACCURACY); in nrfx_clock_enable()
331 nrf_clock_hfclk192m_src_set(NRF_CLOCK, (nrf_clock_hfclk_t)NRFX_CLOCK_CONFIG_HFCLK192M_SRC); in nrfx_clock_enable()
354 IRQn_Type irqn = nrfx_get_irq_number(NRF_CLOCK); in nrfx_clock_disable()
359 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_HF_STARTED_MASK | in nrfx_clock_disable()
406 if (nrf_clock_is_running(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK, &lfclksrc)) in nrfx_clock_start()
413 else if (nrf_clock_start_task_check(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK)) in nrfx_clock_start()
416 lfclksrc = nrf_clock_lf_srccopy_get(NRF_CLOCK); in nrfx_clock_start()
424 nrf_clock_int_enable(NRF_CLOCK, NRF_CLOCK_INT_LF_STARTED_MASK); in nrfx_clock_start()
428 while (!nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_LFCLKSTARTED)) in nrfx_clock_start()
430 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_LFCLKSTARTED); in nrfx_clock_start()
442 nrf_clock_lf_src_set(NRF_CLOCK, lfclksrc); in nrfx_clock_start()
478 nrf_clock_event_clear(NRF_CLOCK, event); in nrfx_clock_start()
485 nrf_clock_task_trigger(NRF_CLOCK, task); in nrfx_clock_start()
488 nrf_clock_int_enable(NRF_CLOCK, int_mask); in nrfx_clock_start()
492 while (!nrf_clock_event_check(NRF_CLOCK, event)) in nrfx_clock_start()
494 nrf_clock_event_clear(NRF_CLOCK, event); in nrfx_clock_start()
533 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_DONE); in nrfx_clock_calibration_start()
539 nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_CAL); in nrfx_clock_calibration_start()
542 nrf_clock_int_enable(NRF_CLOCK, NRF_CLOCK_INT_DONE_MASK); in nrfx_clock_calibration_start()
546 while (!nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_DONE)) in nrfx_clock_calibration_start()
548 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_DONE); in nrfx_clock_calibration_start()
576 nrf_clock_hfclk_t hfclksrc = nrf_clock_hf_src_get(NRF_CLOCK); in nrfx_clock_xo_tune_start()
582 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNED); in nrfx_clock_xo_tune_start()
583 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEFAILED); in nrfx_clock_xo_tune_start()
588 nrf_clock_int_enable(NRF_CLOCK, int_mask); in nrfx_clock_xo_tune_start()
593 nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_XOTUNE); in nrfx_clock_xo_tune_start()
601 evt_xotuned = nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNED); in nrfx_clock_xo_tune_start()
602 evt_xotunefailed = nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEFAILED); in nrfx_clock_xo_tune_start()
606 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNED); in nrfx_clock_xo_tune_start()
607 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEFAILED); in nrfx_clock_xo_tune_start()
620 nrf_clock_hfclk_t hfclksrc = nrf_clock_hf_src_get(NRF_CLOCK); in nrfx_clock_xo_tune_abort()
626 nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_XOTUNEABORT); in nrfx_clock_xo_tune_abort()
632 nrf_clock_int_disable(NRF_CLOCK, int_mask); in nrfx_clock_xo_tune_abort()
642 bool quality_issue = nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEERROR); in nrfx_clock_xo_tune_error_check()
645 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEERROR); in nrfx_clock_xo_tune_error_check()
655 nrf_clock_cal_timer_timeout_set(NRF_CLOCK, interval); in nrfx_clock_calibration_timer_start()
656 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_CTTO); in nrfx_clock_calibration_timer_start()
658 nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_CTSTART); in nrfx_clock_calibration_timer_start()
661 nrf_clock_int_enable(NRF_CLOCK, NRF_CLOCK_INT_CTTO_MASK); in nrfx_clock_calibration_timer_start()
665 while (!nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_CTTO)) in nrfx_clock_calibration_timer_start()
667 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_CTTO); in nrfx_clock_calibration_timer_start()
673 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_CTTO_MASK); in nrfx_clock_calibration_timer_stop()
674 nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_CTSTOP); in nrfx_clock_calibration_timer_stop()
696 nrf_clock_hfclk_div_set(NRF_CLOCK, div); in nrfx_clock_divider_set()
707 nrf_clock_hfclk_div_set(NRF_CLOCK, div); in nrfx_clock_divider_set()
721 nrf_clock_hfclk_div_set(NRF_CLOCK, div); in nrfx_clock_divider_set()
728 nrf_clock_hfclk_div_set(NRF_CLOCK, div); in nrfx_clock_divider_set()
745 nrf_clock_hfclk192m_div_set(NRF_CLOCK, div); in nrfx_clock_divider_set()
758 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLKSTARTED)) in nrfx_clock_irq_handler()
760 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLKSTARTED); in nrfx_clock_irq_handler()
762 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_HF_STARTED_MASK); in nrfx_clock_irq_handler()
774 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_LFCLKSTARTED)) in nrfx_clock_irq_handler()
776 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_LFCLKSTARTED); in nrfx_clock_irq_handler()
781 (void)nrf_clock_is_running(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK, &lfclksrc); in nrfx_clock_irq_handler()
785 nrf_clock_lf_src_set(NRF_CLOCK, (nrf_clock_lfclk_t)NRFX_CLOCK_CONFIG_LF_SRC); in nrfx_clock_irq_handler()
786 nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); in nrfx_clock_irq_handler()
792 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_LF_STARTED_MASK); in nrfx_clock_irq_handler()
798 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_PLLSTARTED)) in nrfx_clock_irq_handler()
800 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_PLLSTARTED); in nrfx_clock_irq_handler()
802 nrf_clock_int_disable(NRF_CLOCK, NRFX_CLOCK_INT_PLL_STARTED_MASK); in nrfx_clock_irq_handler()
809 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_CTTO) && in nrfx_clock_irq_handler()
810 nrf_clock_int_enable_check(NRF_CLOCK, NRF_CLOCK_INT_CTTO_MASK)) in nrfx_clock_irq_handler()
812 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_CTTO); in nrfx_clock_irq_handler()
814 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_CTTO_MASK); in nrfx_clock_irq_handler()
820 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_DONE) && in nrfx_clock_irq_handler()
821 nrf_clock_int_enable_check(NRF_CLOCK, NRF_CLOCK_INT_DONE_MASK)) in nrfx_clock_irq_handler()
826 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_DONE); in nrfx_clock_irq_handler()
828 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_DONE_MASK); in nrfx_clock_irq_handler()
835 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLKAUDIOSTARTED)) in nrfx_clock_irq_handler()
837 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLKAUDIOSTARTED); in nrfx_clock_irq_handler()
839 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_HFAUDIO_STARTED_MASK); in nrfx_clock_irq_handler()
846 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLK192MSTARTED)) in nrfx_clock_irq_handler()
848 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLK192MSTARTED); in nrfx_clock_irq_handler()
850 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_HF192M_STARTED_MASK); in nrfx_clock_irq_handler()
857 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNED)) in nrfx_clock_irq_handler()
860 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNED); in nrfx_clock_irq_handler()
862 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNED); in nrfx_clock_irq_handler()
864 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEERROR); in nrfx_clock_irq_handler()
865 nrf_clock_int_enable(NRF_CLOCK, NRF_CLOCK_INT_XOTUNEERROR_MASK); in nrfx_clock_irq_handler()
870 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEERROR) && in nrfx_clock_irq_handler()
871 nrf_clock_int_enable_check(NRF_CLOCK, NRF_CLOCK_INT_XOTUNEERROR_MASK)) in nrfx_clock_irq_handler()
873 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEERROR); in nrfx_clock_irq_handler()
875 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_INT_XOTUNEERROR_MASK); in nrfx_clock_irq_handler()
880 if (nrf_clock_event_check(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEFAILED)) in nrfx_clock_irq_handler()
883 nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEFAILED); in nrfx_clock_irq_handler()
885 nrf_clock_int_disable(NRF_CLOCK, NRF_CLOCK_EVENT_XOTUNEFAILED); in nrfx_clock_irq_handler()