123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- #ifndef NRFX_CLOCK_H__
- #define NRFX_CLOCK_H__
- #include <nrfx.h>
- #include <hal/nrf_clock.h>
- #include <nrfx_power_clock.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef enum
- {
- NRFX_CLOCK_EVT_HFCLK_STARTED,
- NRFX_CLOCK_EVT_LFCLK_STARTED,
- NRFX_CLOCK_EVT_CTTO,
- NRFX_CLOCK_EVT_CAL_DONE
- } nrfx_clock_evt_type_t;
- typedef void (*nrfx_clock_event_handler_t)(nrfx_clock_evt_type_t event);
- nrfx_err_t nrfx_clock_init(nrfx_clock_event_handler_t event_handler);
- void nrfx_clock_enable(void);
- void nrfx_clock_disable(void);
- void nrfx_clock_uninit(void);
- void nrfx_clock_lfclk_start(void);
- void nrfx_clock_lfclk_stop(void);
- __STATIC_INLINE bool nrfx_clock_lfclk_is_running(void);
- void nrfx_clock_hfclk_start(void);
- void nrfx_clock_hfclk_stop(void);
- __STATIC_INLINE bool nrfx_clock_hfclk_is_running(void);
- nrfx_err_t nrfx_clock_calibration_start(void);
- nrfx_err_t nrfx_clock_is_calibrating(void);
- void nrfx_clock_calibration_timer_start(uint8_t interval);
- void nrfx_clock_calibration_timer_stop(void);
- __STATIC_INLINE uint32_t nrfx_clock_ppi_task_addr(nrf_clock_task_t task);
- __STATIC_INLINE uint32_t nrfx_clock_ppi_event_addr(nrf_clock_event_t event);
- #ifndef SUPPRESS_INLINE_IMPLEMENTATION
- __STATIC_INLINE uint32_t nrfx_clock_ppi_task_addr(nrf_clock_task_t task)
- {
- return nrf_clock_task_address_get(task);
- }
- __STATIC_INLINE uint32_t nrfx_clock_ppi_event_addr(nrf_clock_event_t event)
- {
- return nrf_clock_event_address_get(event);
- }
- __STATIC_INLINE bool nrfx_clock_hfclk_is_running(void)
- {
- return nrf_clock_hf_is_running(NRF_CLOCK_HFCLK_HIGH_ACCURACY);
- }
- __STATIC_INLINE bool nrfx_clock_lfclk_is_running(void)
- {
- return nrf_clock_lf_is_running();
- }
- #endif
- void nrfx_clock_irq_handler(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|