Lines Matching refs:p_reg
46 NRFY_STATIC_INLINE bool __nrfy_internal_spim_event_handle(NRF_SPIM_Type * p_reg,
52 uint32_t __nrfy_internal_spim_events_process(NRF_SPIM_Type * p_reg,
56 NRFY_STATIC_INLINE void __nrfy_internal_spim_event_enabled_clear(NRF_SPIM_Type * p_reg,
209 NRFY_STATIC_INLINE void nrfy_spim_periph_configure(NRF_SPIM_Type * p_reg, in nrfy_spim_periph_configure() argument
214 nrf_spim_pins_set(p_reg, in nrfy_spim_periph_configure()
217 nrf_spim_dcx_pin_set(p_reg, p_config->ext_config.pins.dcx_pin); in nrfy_spim_periph_configure()
220 nrf_spim_csn_configure(p_reg, in nrfy_spim_periph_configure()
226 nrf_spim_orc_set(p_reg, p_config->orc); in nrfy_spim_periph_configure()
228 nrf_spim_frequency_set(p_reg, p_config->frequency); in nrfy_spim_periph_configure()
230 nrf_spim_prescaler_set(p_reg, p_config->prescaler); in nrfy_spim_periph_configure()
232 nrf_spim_configure(p_reg, p_config->mode, p_config->bit_order); in nrfy_spim_periph_configure()
234 nrf_spim_iftiming_set(p_reg, p_config->ext_config.rx_delay); in nrfy_spim_periph_configure()
247 NRFY_STATIC_INLINE void nrfy_spim_int_init(NRF_SPIM_Type * p_reg, in nrfy_spim_int_init() argument
252 __nrfy_internal_spim_event_enabled_clear(p_reg, mask, NRF_SPIM_EVENT_STOPPED); in nrfy_spim_int_init()
253 __nrfy_internal_spim_event_enabled_clear(p_reg, mask, NRF_SPIM_EVENT_ENDRX); in nrfy_spim_int_init()
254 __nrfy_internal_spim_event_enabled_clear(p_reg, mask, NRF_SPIM_EVENT_END); in nrfy_spim_int_init()
255 __nrfy_internal_spim_event_enabled_clear(p_reg, mask, NRF_SPIM_EVENT_ENDTX); in nrfy_spim_int_init()
256 __nrfy_internal_spim_event_enabled_clear(p_reg, mask, NRF_SPIM_EVENT_STARTED); in nrfy_spim_int_init()
259 NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number(p_reg), irq_priority); in nrfy_spim_int_init()
260 NRFX_IRQ_ENABLE(nrfx_get_irq_number(p_reg)); in nrfy_spim_int_init()
263 nrf_spim_int_enable(p_reg, mask); in nrfy_spim_int_init()
273 NRFY_STATIC_INLINE void nrfy_spim_int_uninit(NRF_SPIM_Type * p_reg) in nrfy_spim_int_uninit() argument
275 NRFX_IRQ_DISABLE(nrfx_get_irq_number(p_reg)); in nrfy_spim_int_uninit()
290 NRFY_STATIC_INLINE uint32_t nrfy_spim_events_process(NRF_SPIM_Type * p_reg, in nrfy_spim_events_process() argument
294 uint32_t evt_mask = __nrfy_internal_spim_events_process(p_reg, mask, p_xfer); in nrfy_spim_events_process()
305 NRFY_STATIC_INLINE void nrfy_spim_buffers_set(NRF_SPIM_Type * p_reg, in nrfy_spim_buffers_set() argument
312 nrf_spim_tx_buffer_set(p_reg, p_xfer->p_tx_buffer, p_xfer->tx_length); in nrfy_spim_buffers_set()
313 nrf_spim_rx_buffer_set(p_reg, p_xfer->p_rx_buffer, p_xfer->rx_length); in nrfy_spim_buffers_set()
324 NRFY_STATIC_INLINE void nrfy_spim_xfer_start(NRF_SPIM_Type * p_reg, in nrfy_spim_xfer_start() argument
327 nrf_spim_task_trigger(p_reg, NRF_SPIM_TASK_START); in nrfy_spim_xfer_start()
331 while (!nrf_spim_event_check(p_reg, NRF_SPIM_EVENT_END)) in nrfy_spim_xfer_start()
333 (void)__nrfy_internal_spim_events_process(p_reg, in nrfy_spim_xfer_start()
347 NRFY_STATIC_INLINE void nrfy_spim_abort(NRF_SPIM_Type * p_reg, nrfy_spim_xfer_desc_t const * p_xfer) in nrfy_spim_abort() argument
349 nrf_spim_task_trigger(p_reg, NRF_SPIM_TASK_STOP); in nrfy_spim_abort()
354 while (!__nrfy_internal_spim_events_process(p_reg, evt_mask, p_xfer)) in nrfy_spim_abort()
356 (void)__nrfy_internal_spim_events_process(p_reg, in nrfy_spim_abort()
369 NRFY_STATIC_INLINE void nrfy_spim_pins_get(NRF_SPIM_Type const * p_reg, nrfy_spim_pins_t * p_pins) in nrfy_spim_pins_get() argument
371 p_pins->sck_pin = nrf_spim_sck_pin_get(p_reg); in nrfy_spim_pins_get()
372 p_pins->mosi_pin = nrf_spim_mosi_pin_get(p_reg); in nrfy_spim_pins_get()
373 p_pins->miso_pin = nrf_spim_miso_pin_get(p_reg); in nrfy_spim_pins_get()
383 NRFY_STATIC_INLINE void nrfy_spim_ext_pins_get(NRF_SPIM_Type const * p_reg, in nrfy_spim_ext_pins_get() argument
386 p_pins->dcx_pin = nrf_spim_dcx_pin_get(p_reg); in nrfy_spim_ext_pins_get()
388 p_pins->csn_pin = nrf_spim_csn_pin_get(p_reg); in nrfy_spim_ext_pins_get()
400 NRFY_STATIC_INLINE void nrfy_spim_tx_list_set(NRF_SPIM_Type * p_reg, bool enable) in nrfy_spim_tx_list_set() argument
404 nrf_spim_tx_list_enable(p_reg); in nrfy_spim_tx_list_set()
408 nrf_spim_tx_list_disable(p_reg); in nrfy_spim_tx_list_set()
419 NRFY_STATIC_INLINE void nrfy_spim_rx_list_set(NRF_SPIM_Type * p_reg, bool enable) in nrfy_spim_rx_list_set() argument
423 nrf_spim_rx_list_enable(p_reg); in nrfy_spim_rx_list_set()
427 nrf_spim_rx_list_disable(p_reg); in nrfy_spim_rx_list_set()
434 NRFY_STATIC_INLINE void nrfy_spim_task_trigger(NRF_SPIM_Type * p_reg, in nrfy_spim_task_trigger() argument
437 nrf_spim_task_trigger(p_reg, task); in nrfy_spim_task_trigger()
442 NRFY_STATIC_INLINE uint32_t nrfy_spim_task_address_get(NRF_SPIM_Type const * p_reg, in nrfy_spim_task_address_get() argument
445 return nrf_spim_task_address_get(p_reg, task); in nrfy_spim_task_address_get()
449 NRFY_STATIC_INLINE void nrfy_spim_event_clear(NRF_SPIM_Type * p_reg, nrf_spim_event_t event) in nrfy_spim_event_clear() argument
451 nrf_spim_event_clear(p_reg, event); in nrfy_spim_event_clear()
456 NRFY_STATIC_INLINE bool nrfy_spim_event_check(NRF_SPIM_Type const * p_reg, nrf_spim_event_t event) in nrfy_spim_event_check() argument
459 bool check = nrf_spim_event_check(p_reg, event); in nrfy_spim_event_check()
465 NRFY_STATIC_INLINE uint32_t nrfy_spim_event_address_get(NRF_SPIM_Type const * p_reg, in nrfy_spim_event_address_get() argument
468 return nrf_spim_event_address_get(p_reg, event); in nrfy_spim_event_address_get()
472 NRFY_STATIC_INLINE void nrfy_spim_shorts_enable(NRF_SPIM_Type * p_reg, uint32_t mask) in nrfy_spim_shorts_enable() argument
474 nrf_spim_shorts_enable(p_reg, mask); in nrfy_spim_shorts_enable()
479 NRFY_STATIC_INLINE void nrfy_spim_shorts_disable(NRF_SPIM_Type * p_reg, uint32_t mask) in nrfy_spim_shorts_disable() argument
481 nrf_spim_shorts_disable(p_reg, mask); in nrfy_spim_shorts_disable()
486 NRFY_STATIC_INLINE uint32_t nrfy_spim_shorts_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_shorts_get() argument
489 uint32_t shorts = nrf_spim_shorts_get(p_reg); in nrfy_spim_shorts_get()
495 NRFY_STATIC_INLINE void nrfy_spim_int_enable(NRF_SPIM_Type * p_reg, uint32_t mask) in nrfy_spim_int_enable() argument
497 nrf_spim_int_enable(p_reg, mask); in nrfy_spim_int_enable()
502 NRFY_STATIC_INLINE void nrfy_spim_int_disable(NRF_SPIM_Type * p_reg, uint32_t mask) in nrfy_spim_int_disable() argument
504 nrf_spim_int_disable(p_reg, mask); in nrfy_spim_int_disable()
509 NRFY_STATIC_INLINE uint32_t nrfy_spim_int_enable_check(NRF_SPIM_Type const * p_reg, uint32_t mask) in nrfy_spim_int_enable_check() argument
512 uint32_t check = nrf_spim_int_enable_check(p_reg, mask); in nrfy_spim_int_enable_check()
519 NRFY_STATIC_INLINE void nrfy_spim_subscribe_set(NRF_SPIM_Type * p_reg, in nrfy_spim_subscribe_set() argument
523 nrf_spim_subscribe_set(p_reg, task, channel); in nrfy_spim_subscribe_set()
528 NRFY_STATIC_INLINE void nrfy_spim_subscribe_clear(NRF_SPIM_Type * p_reg, in nrfy_spim_subscribe_clear() argument
531 nrf_spim_subscribe_clear(p_reg, task); in nrfy_spim_subscribe_clear()
536 NRFY_STATIC_INLINE void nrfy_spim_publish_set(NRF_SPIM_Type * p_reg, in nrfy_spim_publish_set() argument
540 nrf_spim_publish_set(p_reg, event, channel); in nrfy_spim_publish_set()
545 NRFY_STATIC_INLINE void nrfy_spim_publish_clear(NRF_SPIM_Type * p_reg, in nrfy_spim_publish_clear() argument
548 nrf_spim_publish_clear(p_reg, event); in nrfy_spim_publish_clear()
554 NRFY_STATIC_INLINE void nrfy_spim_enable(NRF_SPIM_Type * p_reg) in nrfy_spim_enable() argument
556 nrf_spim_enable(p_reg); in nrfy_spim_enable()
561 NRFY_STATIC_INLINE void nrfy_spim_disable(NRF_SPIM_Type * p_reg) in nrfy_spim_disable() argument
563 nrf_spim_disable(p_reg); in nrfy_spim_disable()
568 NRFY_STATIC_INLINE bool nrfy_spim_enable_check(NRF_SPIM_Type const * p_reg) in nrfy_spim_enable_check() argument
571 bool check = nrf_spim_enable_check(p_reg); in nrfy_spim_enable_check()
577 NRFY_STATIC_INLINE void nrfy_spim_pins_set(NRF_SPIM_Type * p_reg, in nrfy_spim_pins_set() argument
582 nrf_spim_pins_set(p_reg, sck_pin, mosi_pin, miso_pin); in nrfy_spim_pins_set()
587 NRFY_STATIC_INLINE uint32_t nrfy_spim_sck_pin_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_sck_pin_get() argument
590 uint32_t pin = nrf_spim_sck_pin_get(p_reg); in nrfy_spim_sck_pin_get()
596 NRFY_STATIC_INLINE uint32_t nrfy_spim_mosi_pin_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_mosi_pin_get() argument
599 uint32_t pin = nrf_spim_mosi_pin_get(p_reg); in nrfy_spim_mosi_pin_get()
605 NRFY_STATIC_INLINE uint32_t nrfy_spim_miso_pin_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_miso_pin_get() argument
608 uint32_t pin = nrf_spim_miso_pin_get(p_reg); in nrfy_spim_miso_pin_get()
616 NRFY_STATIC_INLINE void nrfy_spim_csn_configure(NRF_SPIM_Type * p_reg, in nrfy_spim_csn_configure() argument
621 nrf_spim_csn_configure(p_reg, pin, polarity, duration); in nrfy_spim_csn_configure()
626 NRFY_STATIC_INLINE uint32_t nrfy_spim_csn_pin_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_csn_pin_get() argument
629 uint32_t pin = nrf_spim_csn_pin_get(p_reg); in nrfy_spim_csn_pin_get()
637 NRFY_STATIC_INLINE void nrfy_spim_dcx_pin_set(NRF_SPIM_Type * p_reg, in nrfy_spim_dcx_pin_set() argument
640 nrf_spim_dcx_pin_set(p_reg, dcx_pin); in nrfy_spim_dcx_pin_set()
645 NRFY_STATIC_INLINE uint32_t nrfy_spim_dcx_pin_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_dcx_pin_get() argument
648 uint32_t pin = nrf_spim_dcx_pin_get(p_reg); in nrfy_spim_dcx_pin_get()
654 NRFY_STATIC_INLINE void nrfy_spim_dcx_cnt_set(NRF_SPIM_Type * p_reg, uint32_t count) in nrfy_spim_dcx_cnt_set() argument
656 nrf_spim_dcx_cnt_set(p_reg, count); in nrfy_spim_dcx_cnt_set()
663 NRFY_STATIC_INLINE void nrfy_spim_iftiming_set(NRF_SPIM_Type * p_reg, in nrfy_spim_iftiming_set() argument
666 nrf_spim_iftiming_set(p_reg, rxdelay); in nrfy_spim_iftiming_set()
673 NRFY_STATIC_INLINE void nrfy_spim_stallstat_rx_clear(NRF_SPIM_Type * p_reg) in nrfy_spim_stallstat_rx_clear() argument
675 nrf_spim_stallstat_rx_clear(p_reg); in nrfy_spim_stallstat_rx_clear()
680 NRFY_STATIC_INLINE bool nrfy_spim_stallstat_rx_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_stallstat_rx_get() argument
683 bool stallstat = nrf_spim_stallstat_rx_get(p_reg); in nrfy_spim_stallstat_rx_get()
689 NRFY_STATIC_INLINE void nrfy_spim_stallstat_tx_clear(NRF_SPIM_Type * p_reg) in nrfy_spim_stallstat_tx_clear() argument
691 nrf_spim_stallstat_tx_clear(p_reg); in nrfy_spim_stallstat_tx_clear()
696 NRFY_STATIC_INLINE bool nrfy_spim_stallstat_tx_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_stallstat_tx_get() argument
699 bool stallstat = nrf_spim_stallstat_tx_get(p_reg); in nrfy_spim_stallstat_tx_get()
707 NRFY_STATIC_INLINE void nrfy_spim_frequency_set(NRF_SPIM_Type * p_reg, in nrfy_spim_frequency_set() argument
710 nrf_spim_frequency_set(p_reg, frequency); in nrfy_spim_frequency_set()
717 NRFY_STATIC_INLINE void nrfy_spim_prescaler_set(NRF_SPIM_Type * p_reg, uint32_t prescaler) in nrfy_spim_prescaler_set() argument
719 nrf_spim_prescaler_set(p_reg, prescaler); in nrfy_spim_prescaler_set()
724 NRFY_STATIC_INLINE uint32_t nrfy_spim_prescaler_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_prescaler_get() argument
727 uint32_t prescaler = nrf_spim_prescaler_get(p_reg); in nrfy_spim_prescaler_get()
734 NRFY_STATIC_INLINE void nrfy_spim_tx_buffer_set(NRF_SPIM_Type * p_reg, in nrfy_spim_tx_buffer_set() argument
738 nrf_spim_tx_buffer_set(p_reg, p_buffer, length); in nrfy_spim_tx_buffer_set()
743 NRFY_STATIC_INLINE uint32_t nrfy_spim_tx_amount_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_tx_amount_get() argument
746 uint32_t amount = nrf_spim_tx_amount_get(p_reg); in nrfy_spim_tx_amount_get()
752 NRFY_STATIC_INLINE uint32_t nrfy_spim_tx_maxcnt_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_tx_maxcnt_get() argument
755 uint32_t maxcnt = nrf_spim_tx_maxcnt_get(p_reg); in nrfy_spim_tx_maxcnt_get()
761 NRFY_STATIC_INLINE void nrfy_spim_rx_buffer_set(NRF_SPIM_Type * p_reg, in nrfy_spim_rx_buffer_set() argument
765 nrf_spim_rx_buffer_set(p_reg, p_buffer, length); in nrfy_spim_rx_buffer_set()
770 NRFY_STATIC_INLINE uint32_t nrfy_spim_rx_amount_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_rx_amount_get() argument
773 uint32_t amount = nrf_spim_rx_amount_get(p_reg); in nrfy_spim_rx_amount_get()
779 NRFY_STATIC_INLINE uint32_t nrfy_spim_rx_maxcnt_get(NRF_SPIM_Type const * p_reg) in nrfy_spim_rx_maxcnt_get() argument
782 uint32_t maxcnt = nrf_spim_rx_maxcnt_get(p_reg); in nrfy_spim_rx_maxcnt_get()
788 NRFY_STATIC_INLINE void nrfy_spim_configure(NRF_SPIM_Type * p_reg, in nrfy_spim_configure() argument
792 nrf_spim_configure(p_reg, spi_mode, spi_bit_order); in nrfy_spim_configure()
797 NRFY_STATIC_INLINE void nrfy_spim_orc_set(NRF_SPIM_Type * p_reg, in nrfy_spim_orc_set() argument
800 nrf_spim_orc_set(p_reg, orc); in nrfy_spim_orc_set()
806 NRFY_STATIC_INLINE bool __nrfy_internal_spim_event_handle(NRF_SPIM_Type * p_reg, in __nrfy_internal_spim_event_handle() argument
811 if ((mask & NRFY_EVENT_TO_INT_BITMASK(event)) && nrf_spim_event_check(p_reg, event)) in __nrfy_internal_spim_event_handle()
813 nrf_spim_event_clear(p_reg, event); in __nrfy_internal_spim_event_handle()
824 uint32_t __nrfy_internal_spim_events_process(NRF_SPIM_Type * p_reg, in __nrfy_internal_spim_events_process() argument
831 (void)__nrfy_internal_spim_event_handle(p_reg, mask, NRF_SPIM_EVENT_STARTED, &evt_mask); in __nrfy_internal_spim_events_process()
833 bool stop = __nrfy_internal_spim_event_handle(p_reg, mask, NRF_SPIM_EVENT_STOPPED, &evt_mask); in __nrfy_internal_spim_events_process()
836 if (__nrfy_internal_spim_event_handle(p_reg, mask, NRF_SPIM_EVENT_END, &evt_mask) && p_xfer) in __nrfy_internal_spim_events_process()
838 size_t size = stop ? nrf_spim_rx_amount_get(p_reg) : p_xfer->rx_length; in __nrfy_internal_spim_events_process()
843 if (__nrfy_internal_spim_event_handle(p_reg, mask, NRF_SPIM_EVENT_ENDRX, &evt_mask) && in __nrfy_internal_spim_events_process()
846 size_t size = stop ? nrf_spim_rx_amount_get(p_reg) : p_xfer->rx_length; in __nrfy_internal_spim_events_process()
850 (void)__nrfy_internal_spim_event_handle(p_reg, mask, NRF_SPIM_EVENT_ENDTX, &evt_mask); in __nrfy_internal_spim_events_process()
855 NRFY_STATIC_INLINE void __nrfy_internal_spim_event_enabled_clear(NRF_SPIM_Type * p_reg, in __nrfy_internal_spim_event_enabled_clear() argument
861 nrf_spim_event_clear(p_reg, event); in __nrfy_internal_spim_event_enabled_clear()