Lines Matching refs:p_reg
46 NRFY_STATIC_INLINE bool __nrfy_internal_saadc_event_handle(NRF_SAADC_Type * p_reg,
52 uint32_t __nrfy_internal_saadc_events_process(NRF_SAADC_Type * p_reg,
56 NRFY_STATIC_INLINE void __nrfy_internal_saadc_event_enabled_clear(NRF_SAADC_Type * p_reg,
60 NRFY_STATIC_INLINE void __nrfy_internal_saadc_buffer_latch(NRF_SAADC_Type * p_reg, bool wait);
62 NRFY_STATIC_INLINE void __nrfy_internal_saadc_stop(NRF_SAADC_Type * p_reg, bool wait);
98 NRFY_STATIC_INLINE void nrfy_saadc_periph_configure(NRF_SAADC_Type * p_reg, in nrfy_saadc_periph_configure() argument
101 nrf_saadc_resolution_set(p_reg, p_config->resolution); in nrfy_saadc_periph_configure()
102 nrf_saadc_oversample_set(p_reg, p_config->oversampling); in nrfy_saadc_periph_configure()
114 NRFY_STATIC_INLINE void nrfy_saadc_int_init(NRF_SAADC_Type * p_reg, in nrfy_saadc_int_init() argument
119 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, NRF_SAADC_EVENT_STARTED); in nrfy_saadc_int_init()
120 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, NRF_SAADC_EVENT_END); in nrfy_saadc_int_init()
121 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, NRF_SAADC_EVENT_DONE); in nrfy_saadc_int_init()
122 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, NRF_SAADC_EVENT_RESULTDONE); in nrfy_saadc_int_init()
123 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, NRF_SAADC_EVENT_CALIBRATEDONE); in nrfy_saadc_int_init()
124 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, NRF_SAADC_EVENT_STOPPED); in nrfy_saadc_int_init()
129 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, event); in nrfy_saadc_int_init()
132 __nrfy_internal_saadc_event_enabled_clear(p_reg, mask, event); in nrfy_saadc_int_init()
137 NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number(p_reg), irq_priority); in nrfy_saadc_int_init()
138 NRFX_IRQ_ENABLE(nrfx_get_irq_number(p_reg)); in nrfy_saadc_int_init()
141 nrf_saadc_int_enable(p_reg, mask); in nrfy_saadc_int_init()
152 NRFY_STATIC_INLINE void nrfy_saadc_int_uninit(NRF_SAADC_Type * p_reg) in nrfy_saadc_int_uninit() argument
154 NRFX_IRQ_DISABLE(nrfx_get_irq_number(p_reg)); in nrfy_saadc_int_uninit()
169 NRFY_STATIC_INLINE uint32_t nrfy_saadc_events_process(NRF_SAADC_Type * p_reg, in nrfy_saadc_events_process() argument
173 uint32_t evt_mask = __nrfy_internal_saadc_events_process(p_reg, mask, p_desc); in nrfy_saadc_events_process()
188 NRFY_STATIC_INLINE void nrfy_saadc_channel_configure(NRF_SAADC_Type * p_reg, in nrfy_saadc_channel_configure() argument
195 nrf_saadc_channel_init(p_reg, channel, p_config); in nrfy_saadc_channel_configure()
199 nrf_saadc_channel_input_set(p_reg, channel, p_input->input_p, p_input->input_n); in nrfy_saadc_channel_configure()
212 NRFY_STATIC_INLINE void nrfy_saadc_buffer_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_buffer_set() argument
217 nrf_saadc_buffer_init(p_reg, p_desc->p_buffer, p_desc->length); in nrfy_saadc_buffer_set()
221 __nrfy_internal_saadc_buffer_latch(p_reg, wait); in nrfy_saadc_buffer_set()
231 NRFY_STATIC_INLINE void nrfy_saadc_buffer_latch(NRF_SAADC_Type * p_reg, bool wait) in nrfy_saadc_buffer_latch() argument
233 __nrfy_internal_saadc_buffer_latch(p_reg, wait); in nrfy_saadc_buffer_latch()
243 NRFY_STATIC_INLINE void nrfy_saadc_sample_start(NRF_SAADC_Type * p_reg, in nrfy_saadc_sample_start() argument
246 nrf_saadc_task_trigger(p_reg, NRF_SAADC_TASK_SAMPLE); in nrfy_saadc_sample_start()
251 while (!__nrfy_internal_saadc_events_process(p_reg, evt_mask, p_desc)) in nrfy_saadc_sample_start()
253 nrf_saadc_event_clear(p_reg, NRF_SAADC_EVENT_DONE); in nrfy_saadc_sample_start()
254 nrf_saadc_event_clear(p_reg, NRF_SAADC_EVENT_RESULTDONE); in nrfy_saadc_sample_start()
266 NRFY_STATIC_INLINE void nrfy_saadc_abort(NRF_SAADC_Type * p_reg, in nrfy_saadc_abort() argument
269 __nrfy_internal_saadc_stop(p_reg, p_desc ? true : false); in nrfy_saadc_abort()
272 (void)__nrfy_internal_saadc_events_process(p_reg, in nrfy_saadc_abort()
285 NRFY_STATIC_INLINE void nrfy_saadc_stop(NRF_SAADC_Type * p_reg, bool wait) in nrfy_saadc_stop() argument
287 __nrfy_internal_saadc_stop(p_reg, wait); in nrfy_saadc_stop()
297 NRFY_STATIC_INLINE void nrfy_saadc_calibrate(NRF_SAADC_Type * p_reg, bool wait) in nrfy_saadc_calibrate() argument
299 nrf_saadc_task_trigger(p_reg, NRF_SAADC_TASK_CALIBRATEOFFSET); in nrfy_saadc_calibrate()
304 while (!__nrfy_internal_saadc_events_process(p_reg, evt_mask, NULL)) in nrfy_saadc_calibrate()
306 nrf_saadc_event_clear(p_reg, NRF_SAADC_EVENT_END); in nrfy_saadc_calibrate()
312 NRFY_STATIC_INLINE void nrfy_saadc_task_trigger(NRF_SAADC_Type * p_reg, nrf_saadc_task_t task) in nrfy_saadc_task_trigger() argument
314 nrf_saadc_task_trigger(p_reg, task); in nrfy_saadc_task_trigger()
319 NRFY_STATIC_INLINE uint32_t nrfy_saadc_task_address_get(NRF_SAADC_Type const * p_reg, in nrfy_saadc_task_address_get() argument
322 return nrf_saadc_task_address_get(p_reg, task); in nrfy_saadc_task_address_get()
326 NRFY_STATIC_INLINE bool nrfy_saadc_event_check(NRF_SAADC_Type const * p_reg, in nrfy_saadc_event_check() argument
330 bool check = nrf_saadc_event_check(p_reg, event); in nrfy_saadc_event_check()
336 NRFY_STATIC_INLINE void nrfy_saadc_event_clear(NRF_SAADC_Type * p_reg, nrf_saadc_event_t event) in nrfy_saadc_event_clear() argument
338 nrf_saadc_event_clear(p_reg, event); in nrfy_saadc_event_clear()
343 NRFY_STATIC_INLINE uint32_t nrfy_saadc_event_address_get(NRF_SAADC_Type const * p_reg, in nrfy_saadc_event_address_get() argument
346 return nrf_saadc_event_address_get(p_reg, event); in nrfy_saadc_event_address_get()
351 NRFY_STATIC_INLINE void nrfy_saadc_subscribe_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_subscribe_set() argument
355 nrf_saadc_subscribe_set(p_reg, task, channel); in nrfy_saadc_subscribe_set()
360 NRFY_STATIC_INLINE void nrfy_saadc_subscribe_clear(NRF_SAADC_Type * p_reg, nrf_saadc_task_t task) in nrfy_saadc_subscribe_clear() argument
362 nrf_saadc_subscribe_clear(p_reg, task); in nrfy_saadc_subscribe_clear()
367 NRFY_STATIC_INLINE void nrfy_saadc_publish_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_publish_set() argument
371 nrf_saadc_publish_set(p_reg, event, channel); in nrfy_saadc_publish_set()
376 NRFY_STATIC_INLINE void nrfy_saadc_publish_clear(NRF_SAADC_Type * p_reg, nrf_saadc_event_t event) in nrfy_saadc_publish_clear() argument
378 nrf_saadc_publish_clear(p_reg, event); in nrfy_saadc_publish_clear()
391 NRFY_STATIC_INLINE void nrfy_saadc_channel_input_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_channel_input_set() argument
396 nrf_saadc_channel_input_set(p_reg, channel, pselp, pseln); in nrfy_saadc_channel_input_set()
401 NRFY_STATIC_INLINE void nrfy_saadc_channel_pos_input_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_channel_pos_input_set() argument
405 nrf_saadc_channel_pos_input_set(p_reg, channel, pselp); in nrfy_saadc_channel_pos_input_set()
410 NRFY_STATIC_INLINE void nrfy_saadc_channel_neg_input_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_channel_neg_input_set() argument
414 nrf_saadc_channel_neg_input_set(p_reg, channel, pseln); in nrfy_saadc_channel_neg_input_set()
419 NRFY_STATIC_INLINE void nrfy_saadc_channel_limits_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_channel_limits_set() argument
424 nrf_saadc_channel_limits_set(p_reg, channel, low, high); in nrfy_saadc_channel_limits_set()
429 NRFY_STATIC_INLINE void nrfy_saadc_int_set(NRF_SAADC_Type * p_reg, uint32_t mask) in nrfy_saadc_int_set() argument
431 nrf_saadc_int_set(p_reg, mask); in nrfy_saadc_int_set()
436 NRFY_STATIC_INLINE void nrfy_saadc_int_enable(NRF_SAADC_Type * p_reg, uint32_t mask) in nrfy_saadc_int_enable() argument
438 nrf_saadc_int_enable(p_reg, mask); in nrfy_saadc_int_enable()
443 NRFY_STATIC_INLINE uint32_t nrfy_saadc_int_enable_check(NRF_SAADC_Type const * p_reg, uint32_t mask) in nrfy_saadc_int_enable_check() argument
446 uint32_t check = nrf_saadc_int_enable_check(p_reg, mask); in nrfy_saadc_int_enable_check()
452 NRFY_STATIC_INLINE void nrfy_saadc_int_disable(NRF_SAADC_Type * p_reg, uint32_t mask) in nrfy_saadc_int_disable() argument
454 nrf_saadc_int_disable(p_reg, mask); in nrfy_saadc_int_disable()
466 NRFY_STATIC_INLINE bool nrfy_saadc_busy_check(NRF_SAADC_Type const * p_reg) in nrfy_saadc_busy_check() argument
469 bool check = nrf_saadc_busy_check(p_reg); in nrfy_saadc_busy_check()
475 NRFY_STATIC_INLINE void nrfy_saadc_enable(NRF_SAADC_Type * p_reg) in nrfy_saadc_enable() argument
477 nrf_saadc_enable(p_reg); in nrfy_saadc_enable()
482 NRFY_STATIC_INLINE void nrfy_saadc_disable(NRF_SAADC_Type * p_reg) in nrfy_saadc_disable() argument
484 nrf_saadc_disable(p_reg); in nrfy_saadc_disable()
489 NRFY_STATIC_INLINE bool nrfy_saadc_enable_check(NRF_SAADC_Type const * p_reg) in nrfy_saadc_enable_check() argument
492 bool check = nrf_saadc_enable_check(p_reg); in nrfy_saadc_enable_check()
498 NRFY_STATIC_INLINE void nrfy_saadc_buffer_init(NRF_SAADC_Type * p_reg, in nrfy_saadc_buffer_init() argument
502 nrf_saadc_buffer_init(p_reg, p_buffer, size); in nrfy_saadc_buffer_init()
507 NRFY_STATIC_INLINE void nrfy_saadc_buffer_pointer_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_buffer_pointer_set() argument
510 nrf_saadc_buffer_pointer_set(p_reg, p_buffer); in nrfy_saadc_buffer_pointer_set()
515 NRFY_STATIC_INLINE nrf_saadc_value_t * nrfy_saadc_buffer_pointer_get(NRF_SAADC_Type const * p_reg) in nrfy_saadc_buffer_pointer_get() argument
518 nrf_saadc_value_t * p_buffer = nrf_saadc_buffer_pointer_get(p_reg); in nrfy_saadc_buffer_pointer_get()
524 NRFY_STATIC_INLINE uint16_t nrfy_saadc_amount_get(NRF_SAADC_Type const * p_reg) in nrfy_saadc_amount_get() argument
527 uint16_t amount = nrf_saadc_amount_get(p_reg); in nrfy_saadc_amount_get()
533 NRFY_STATIC_INLINE void nrfy_saadc_resolution_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_resolution_set() argument
536 nrf_saadc_resolution_set(p_reg, resolution); in nrfy_saadc_resolution_set()
541 NRFY_STATIC_INLINE nrf_saadc_resolution_t nrfy_saadc_resolution_get(NRF_SAADC_Type const * p_reg) in nrfy_saadc_resolution_get() argument
544 nrf_saadc_resolution_t resolution = nrf_saadc_resolution_get(p_reg); in nrfy_saadc_resolution_get()
550 NRFY_STATIC_INLINE void nrfy_saadc_oversample_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_oversample_set() argument
553 nrf_saadc_oversample_set(p_reg, oversample); in nrfy_saadc_oversample_set()
558 NRFY_STATIC_INLINE nrf_saadc_oversample_t nrfy_saadc_oversample_get(NRF_SAADC_Type const * p_reg) in nrfy_saadc_oversample_get() argument
561 nrf_saadc_oversample_t oversample = nrf_saadc_oversample_get(p_reg); in nrfy_saadc_oversample_get()
574 NRFY_STATIC_INLINE void nrfy_saadc_continuous_mode_enable(NRF_SAADC_Type * p_reg, uint16_t cc) in nrfy_saadc_continuous_mode_enable() argument
576 nrf_saadc_continuous_mode_enable(p_reg, cc); in nrfy_saadc_continuous_mode_enable()
581 NRFY_STATIC_INLINE bool nrfy_saadc_continuous_mode_enable_check(NRF_SAADC_Type const * p_reg) in nrfy_saadc_continuous_mode_enable_check() argument
584 bool check = nrf_saadc_continuous_mode_enable_check(p_reg); in nrfy_saadc_continuous_mode_enable_check()
590 NRFY_STATIC_INLINE void nrfy_saadc_continuous_mode_disable(NRF_SAADC_Type * p_reg) in nrfy_saadc_continuous_mode_disable() argument
592 nrf_saadc_continuous_mode_disable(p_reg); in nrfy_saadc_continuous_mode_disable()
597 NRFY_STATIC_INLINE void nrfy_saadc_channel_init(NRF_SAADC_Type * p_reg, in nrfy_saadc_channel_init() argument
601 nrf_saadc_channel_init(p_reg, channel, config); in nrfy_saadc_channel_init()
606 NRFY_STATIC_INLINE void nrfy_saadc_burst_set(NRF_SAADC_Type * p_reg, in nrfy_saadc_burst_set() argument
610 nrf_saadc_burst_set(p_reg, channel, burst); in nrfy_saadc_burst_set()
628 NRFY_STATIC_INLINE bool __nrfy_internal_saadc_event_handle(NRF_SAADC_Type * p_reg, in __nrfy_internal_saadc_event_handle() argument
633 if ((mask & NRFY_EVENT_TO_INT_BITMASK(event)) && nrf_saadc_event_check(p_reg, event)) in __nrfy_internal_saadc_event_handle()
635 nrf_saadc_event_clear(p_reg, event); in __nrfy_internal_saadc_event_handle()
646 uint32_t __nrfy_internal_saadc_events_process(NRF_SAADC_Type * p_reg, in __nrfy_internal_saadc_events_process() argument
654 (void)__nrfy_internal_saadc_event_handle(p_reg, mask, NRF_SAADC_EVENT_STARTED, &evt_mask); in __nrfy_internal_saadc_events_process()
655 bool stop = __nrfy_internal_saadc_event_handle(p_reg, mask, NRF_SAADC_EVENT_STOPPED, &evt_mask); in __nrfy_internal_saadc_events_process()
657 if (__nrfy_internal_saadc_event_handle(p_reg, mask, NRF_SAADC_EVENT_END, &evt_mask) && p_desc) in __nrfy_internal_saadc_events_process()
659 size_t size = stop ? nrf_saadc_amount_get(p_reg) : p_desc->length; in __nrfy_internal_saadc_events_process()
663 (void)__nrfy_internal_saadc_event_handle(p_reg, mask, NRF_SAADC_EVENT_DONE, &evt_mask); in __nrfy_internal_saadc_events_process()
664 (void)__nrfy_internal_saadc_event_handle(p_reg, mask, NRF_SAADC_EVENT_RESULTDONE, &evt_mask); in __nrfy_internal_saadc_events_process()
665 (void)__nrfy_internal_saadc_event_handle(p_reg, mask, NRF_SAADC_EVENT_CALIBRATEDONE, &evt_mask); in __nrfy_internal_saadc_events_process()
672 __nrfy_internal_saadc_event_handle(p_reg, mask, event, &evt_mask); in __nrfy_internal_saadc_events_process()
675 __nrfy_internal_saadc_event_handle(p_reg, mask, event, &evt_mask); in __nrfy_internal_saadc_events_process()
682 NRFY_STATIC_INLINE void __nrfy_internal_saadc_event_enabled_clear(NRF_SAADC_Type * p_reg, in __nrfy_internal_saadc_event_enabled_clear() argument
688 nrf_saadc_event_clear(p_reg, event); in __nrfy_internal_saadc_event_enabled_clear()
692 NRFY_STATIC_INLINE void __nrfy_internal_saadc_buffer_latch(NRF_SAADC_Type * p_reg, bool wait) in __nrfy_internal_saadc_buffer_latch() argument
694 nrf_saadc_task_trigger(p_reg, NRF_SAADC_TASK_START); in __nrfy_internal_saadc_buffer_latch()
699 while (!__nrfy_internal_saadc_events_process(p_reg, evt_mask, NULL)) in __nrfy_internal_saadc_buffer_latch()
705 NRFY_STATIC_INLINE void __nrfy_internal_saadc_stop(NRF_SAADC_Type * p_reg, bool wait) in __nrfy_internal_saadc_stop() argument
707 nrf_saadc_task_trigger(p_reg, NRF_SAADC_TASK_STOP); in __nrfy_internal_saadc_stop()
712 while (!__nrfy_internal_saadc_events_process(p_reg, evt_mask, NULL)) in __nrfy_internal_saadc_stop()