Lines Matching refs:p_reg
46 NRFY_STATIC_INLINE bool __nrfy_internal_pdm_event_handle(NRF_PDM_Type * p_reg,
51 NRFY_STATIC_INLINE uint32_t __nrfy_internal_pdm_events_process(NRF_PDM_Type * p_reg,
55 NRFY_STATIC_INLINE void __nrfy_internal_pdm_event_enabled_clear(NRF_PDM_Type * p_reg,
116 NRFY_STATIC_INLINE void nrfy_pdm_periph_configure(NRF_PDM_Type * p_reg, in nrfy_pdm_periph_configure() argument
120 nrf_pdm_ratio_set(p_reg, p_config->ratio); in nrfy_pdm_periph_configure()
124 nrf_pdm_mclksrc_configure(p_reg, p_config->mclksrc); in nrfy_pdm_periph_configure()
127 nrf_pdm_clock_set(p_reg, p_config->clock_freq); in nrfy_pdm_periph_configure()
129 nrf_pdm_prescaler_set(p_reg, p_config->prescaler); in nrfy_pdm_periph_configure()
131 nrf_pdm_mode_set(p_reg, p_config->mode, p_config->edge); in nrfy_pdm_periph_configure()
132 nrf_pdm_gain_set(p_reg, p_config->gain_l, p_config->gain_r); in nrfy_pdm_periph_configure()
135 nrf_pdm_psel_connect(p_reg, p_config->pins.clk_pin, p_config->pins.din_pin); in nrfy_pdm_periph_configure()
148 NRFY_STATIC_INLINE void nrfy_pdm_int_init(NRF_PDM_Type * p_reg, in nrfy_pdm_int_init() argument
153 __nrfy_internal_pdm_event_enabled_clear(p_reg, mask, NRF_PDM_EVENT_STARTED); in nrfy_pdm_int_init()
154 __nrfy_internal_pdm_event_enabled_clear(p_reg, mask, NRF_PDM_EVENT_END); in nrfy_pdm_int_init()
155 __nrfy_internal_pdm_event_enabled_clear(p_reg, mask, NRF_PDM_EVENT_STOPPED); in nrfy_pdm_int_init()
158 NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number(p_reg), irq_priority); in nrfy_pdm_int_init()
159 NRFX_IRQ_ENABLE(nrfx_get_irq_number(p_reg)); in nrfy_pdm_int_init()
162 nrf_pdm_int_enable(p_reg, mask); in nrfy_pdm_int_init()
173 NRFY_STATIC_INLINE void nrfy_pdm_int_uninit(NRF_PDM_Type * p_reg) in nrfy_pdm_int_uninit() argument
175 NRFX_IRQ_DISABLE(nrfx_get_irq_number(p_reg)); in nrfy_pdm_int_uninit()
189 NRFY_STATIC_INLINE uint32_t nrfy_pdm_events_process(NRF_PDM_Type * p_reg, in nrfy_pdm_events_process() argument
193 uint32_t evt_mask = __nrfy_internal_pdm_events_process(p_reg, mask, p_buffer); in nrfy_pdm_events_process()
204 NRFY_STATIC_INLINE void nrfy_pdm_buffer_set(NRF_PDM_Type * p_reg, in nrfy_pdm_buffer_set() argument
207 nrf_pdm_buffer_set(p_reg, (uint32_t *)(p_buffer->p_buff), p_buffer->length); in nrfy_pdm_buffer_set()
218 NRFY_STATIC_INLINE void nrfy_pdm_start(NRF_PDM_Type * p_reg, in nrfy_pdm_start() argument
221 nrf_pdm_task_trigger(p_reg, NRF_PDM_TASK_START); in nrfy_pdm_start()
226 while (!__nrfy_internal_pdm_events_process(p_reg, evt_mask, p_buffer)) in nrfy_pdm_start()
239 NRFY_STATIC_INLINE void nrfy_pdm_abort(NRF_PDM_Type * p_reg, in nrfy_pdm_abort() argument
242 nrf_pdm_task_trigger(p_reg, NRF_PDM_TASK_STOP); in nrfy_pdm_abort()
248 while (!__nrfy_internal_pdm_events_process(p_reg, evt_mask, p_buffer)) in nrfy_pdm_abort()
260 NRFY_STATIC_INLINE void nrfy_pdm_pins_set(NRF_PDM_Type * p_reg, nrfy_pdm_pins_t * p_pins) in nrfy_pdm_pins_set() argument
262 nrf_pdm_psel_connect(p_reg, p_pins->clk_pin, p_pins->din_pin); in nrfy_pdm_pins_set()
272 NRFY_STATIC_INLINE void nrfy_pdm_pins_get(NRF_PDM_Type const * p_reg, nrfy_pdm_pins_t * p_pins) in nrfy_pdm_pins_get() argument
275 p_pins->clk_pin = nrf_pdm_clk_pin_get(p_reg); in nrfy_pdm_pins_get()
276 p_pins->din_pin = nrf_pdm_din_pin_get(p_reg); in nrfy_pdm_pins_get()
281 NRFY_STATIC_INLINE void nrfy_pdm_task_trigger(NRF_PDM_Type * p_reg, in nrfy_pdm_task_trigger() argument
284 nrf_pdm_task_trigger(p_reg, task); in nrfy_pdm_task_trigger()
289 NRFY_STATIC_INLINE uint32_t nrfy_pdm_task_address_get(NRF_PDM_Type const * p_reg, in nrfy_pdm_task_address_get() argument
292 return nrf_pdm_task_address_get(p_reg, task); in nrfy_pdm_task_address_get()
296 NRFY_STATIC_INLINE bool nrfy_pdm_event_check(NRF_PDM_Type const * p_reg, in nrfy_pdm_event_check() argument
300 bool check = nrf_pdm_event_check(p_reg, event); in nrfy_pdm_event_check()
306 NRFY_STATIC_INLINE void nrfy_pdm_event_clear(NRF_PDM_Type * p_reg, in nrfy_pdm_event_clear() argument
309 nrf_pdm_event_clear(p_reg, event); in nrfy_pdm_event_clear()
314 NRFY_STATIC_INLINE uint32_t nrfy_pdm_event_address_get(NRF_PDM_Type const * p_reg, in nrfy_pdm_event_address_get() argument
317 return nrf_pdm_event_address_get(p_reg, event); in nrfy_pdm_event_address_get()
321 NRFY_STATIC_INLINE void nrfy_pdm_int_enable(NRF_PDM_Type * p_reg, in nrfy_pdm_int_enable() argument
324 nrf_pdm_int_enable(p_reg, mask); in nrfy_pdm_int_enable()
329 NRFY_STATIC_INLINE uint32_t nrfy_pdm_int_enable_check(NRF_PDM_Type const * p_reg, in nrfy_pdm_int_enable_check() argument
333 uint32_t check = nrf_pdm_int_enable_check(p_reg, mask); in nrfy_pdm_int_enable_check()
339 NRFY_STATIC_INLINE void nrfy_pdm_int_disable(NRF_PDM_Type * p_reg, in nrfy_pdm_int_disable() argument
342 nrf_pdm_int_disable(p_reg, mask); in nrfy_pdm_int_disable()
348 NRFY_STATIC_INLINE void nrfy_pdm_subscribe_set(NRF_PDM_Type * p_reg, in nrfy_pdm_subscribe_set() argument
352 nrf_pdm_subscribe_set(p_reg, task, channel); in nrfy_pdm_subscribe_set()
357 NRFY_STATIC_INLINE void nrfy_pdm_subscribe_clear(NRF_PDM_Type * p_reg, in nrfy_pdm_subscribe_clear() argument
360 nrf_pdm_subscribe_clear(p_reg, task); in nrfy_pdm_subscribe_clear()
365 NRFY_STATIC_INLINE void nrfy_pdm_publish_set(NRF_PDM_Type * p_reg, in nrfy_pdm_publish_set() argument
369 nrf_pdm_publish_set(p_reg, event, channel); in nrfy_pdm_publish_set()
374 NRFY_STATIC_INLINE void nrfy_pdm_publish_clear(NRF_PDM_Type * p_reg, in nrfy_pdm_publish_clear() argument
377 nrf_pdm_publish_clear(p_reg, event); in nrfy_pdm_publish_clear()
383 NRFY_STATIC_INLINE void nrfy_pdm_enable(NRF_PDM_Type * p_reg) in nrfy_pdm_enable() argument
385 nrf_pdm_enable(p_reg); in nrfy_pdm_enable()
390 NRFY_STATIC_INLINE void nrfy_pdm_disable(NRF_PDM_Type * p_reg) in nrfy_pdm_disable() argument
392 nrf_pdm_disable(p_reg); in nrfy_pdm_disable()
397 NRFY_STATIC_INLINE bool nrfy_pdm_enable_check(NRF_PDM_Type const * p_reg) in nrfy_pdm_enable_check() argument
400 bool check = nrf_pdm_enable_check(p_reg); in nrfy_pdm_enable_check()
406 NRFY_STATIC_INLINE void nrfy_pdm_mode_set(NRF_PDM_Type * p_reg, in nrfy_pdm_mode_set() argument
410 nrf_pdm_mode_set(p_reg, pdm_mode, pdm_edge); in nrfy_pdm_mode_set()
415 NRFY_STATIC_INLINE void nrfy_pdm_mode_get(NRF_PDM_Type const * p_reg, in nrfy_pdm_mode_get() argument
420 nrf_pdm_mode_get(p_reg, p_pdm_mode, p_pdm_edge); in nrfy_pdm_mode_get()
426 NRFY_STATIC_INLINE void nrfy_pdm_clock_set(NRF_PDM_Type * p_reg, in nrfy_pdm_clock_set() argument
429 nrf_pdm_clock_set(p_reg, pdm_freq); in nrfy_pdm_clock_set()
434 NRFY_STATIC_INLINE nrf_pdm_freq_t nrfy_pdm_clock_get(NRF_PDM_Type const * p_reg) in nrfy_pdm_clock_get() argument
437 nrf_pdm_freq_t clock = nrf_pdm_clock_get(p_reg); in nrfy_pdm_clock_get()
445 NRFY_STATIC_INLINE void nrfy_pdm_prescaler_set(NRF_PDM_Type * p_reg, uint32_t prescaler) in nrfy_pdm_prescaler_set() argument
447 nrf_pdm_prescaler_set(p_reg, prescaler); in nrfy_pdm_prescaler_set()
452 NRFY_STATIC_INLINE uint32_t nrfy_pdm_prescaler_get(NRF_PDM_Type const * p_reg) in nrfy_pdm_prescaler_get() argument
455 uint32_t prescaler = nrf_pdm_prescaler_get(p_reg); in nrfy_pdm_prescaler_get()
462 NRFY_STATIC_INLINE void nrfy_pdm_pin_disconnect(NRF_PDM_Type * p_reg) in nrfy_pdm_pin_disconnect() argument
464 nrf_pdm_psel_disconnect(p_reg); in nrfy_pdm_pin_disconnect()
469 NRFY_STATIC_INLINE void nrfy_pdm_gain_set(NRF_PDM_Type * p_reg, in nrfy_pdm_gain_set() argument
473 nrf_pdm_gain_set(p_reg, gain_l, gain_r); in nrfy_pdm_gain_set()
478 NRFY_STATIC_INLINE void nrfy_pdm_gain_get(NRF_PDM_Type const * p_reg, in nrfy_pdm_gain_get() argument
483 nrf_pdm_gain_get(p_reg, p_gain_l, p_gain_r); in nrfy_pdm_gain_get()
488 NRFY_STATIC_INLINE uint32_t * nrfy_pdm_buffer_get(NRF_PDM_Type const * p_reg) in nrfy_pdm_buffer_get() argument
491 uint32_t * p_buffer = nrf_pdm_buffer_get(p_reg); in nrfy_pdm_buffer_get()
498 NRFY_STATIC_INLINE void nrfy_pdm_ratio_set(NRF_PDM_Type * p_reg, in nrfy_pdm_ratio_set() argument
501 nrf_pdm_ratio_set(p_reg, ratio); in nrfy_pdm_ratio_set()
508 NRFY_STATIC_INLINE void nrfy_pdm_mclksrc_configure(NRF_PDM_Type * p_reg, in nrfy_pdm_mclksrc_configure() argument
511 nrf_pdm_mclksrc_configure(p_reg, mclksrc); in nrfy_pdm_mclksrc_configure()
518 NRFY_STATIC_INLINE bool __nrfy_internal_pdm_event_handle(NRF_PDM_Type * p_reg, in __nrfy_internal_pdm_event_handle() argument
523 if ((mask & NRFY_EVENT_TO_INT_BITMASK(event)) && nrf_pdm_event_check(p_reg, event)) in __nrfy_internal_pdm_event_handle()
525 nrf_pdm_event_clear(p_reg, event); in __nrfy_internal_pdm_event_handle()
535 NRFY_STATIC_INLINE uint32_t __nrfy_internal_pdm_events_process(NRF_PDM_Type * p_reg, in __nrfy_internal_pdm_events_process() argument
542 (void)__nrfy_internal_pdm_event_handle(p_reg, mask, NRF_PDM_EVENT_STARTED, &evt_mask); in __nrfy_internal_pdm_events_process()
544 if (__nrfy_internal_pdm_event_handle(p_reg, mask, NRF_PDM_EVENT_STOPPED, &evt_mask) && in __nrfy_internal_pdm_events_process()
550 (void)__nrfy_internal_pdm_event_handle(p_reg, mask, NRF_PDM_EVENT_END, &evt_mask); in __nrfy_internal_pdm_events_process()
554 NRFY_STATIC_INLINE void __nrfy_internal_pdm_event_enabled_clear(NRF_PDM_Type * p_reg, in __nrfy_internal_pdm_event_enabled_clear() argument
560 nrf_pdm_event_clear(p_reg, event); in __nrfy_internal_pdm_event_enabled_clear()