Lines Matching refs:p_cb

176     spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx];  in spis_configure()  local
180 if (p_cb->csn_pin != NRF_SPIS_PIN_NOT_CONNECTED) in spis_configure()
183 nrfx_gpiote_pin_uninit(&gpiote, p_cb->csn_pin); in spis_configure()
185 nrfx_gpiote_pin_uninit(p_cb->csn_pin); in spis_configure()
187 p_cb->csn_pin = NRF_SPIS_PIN_NOT_CONNECTED; in spis_configure()
200 .p_in_channel = &p_cb->gpiote_ch in spis_configure()
230 p_cb->csn_pin = csn_pin; in spis_configure()
261 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_init() local
266 if (p_cb->state != NRFX_DRV_STATE_UNINITIALIZED) in nrfx_spis_init()
294 p_cb->handler = event_handler; in nrfx_spis_init()
295 p_cb->p_context = p_context; in nrfx_spis_init()
298 p_cb->csn_pin = NRF_SPIS_PIN_NOT_CONNECTED; in nrfx_spis_init()
306 err_code = nrfx_gpiote_channel_alloc(&gpiote, &p_cb->gpiote_ch); in nrfx_spis_init()
309 err_code = nrfx_gpiote_channel_alloc(&p_cb->gpiote_ch); in nrfx_spis_init()
327 p_cb->skip_gpio_cfg = p_config->skip_gpio_cfg; in nrfx_spis_init()
333 nrfx_gpiote_channel_free(&gpiote, p_cb->gpiote_ch); in nrfx_spis_init()
335 nrfx_gpiote_channel_free(p_cb->gpiote_ch); in nrfx_spis_init()
352 p_cb->spi_state = SPIS_STATE_INIT; in nrfx_spis_init()
357 p_cb->state = NRFX_DRV_STATE_INITIALIZED; in nrfx_spis_init()
372 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_reconfigure() local
374 if (p_cb->state == NRFX_DRV_STATE_UNINITIALIZED) in nrfx_spis_reconfigure()
393 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_uninit() local
395 NRFX_ASSERT(p_cb->state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_spis_uninit()
400 if (p_cb->csn_pin != NRF_SPIS_PIN_NOT_CONNECTED) in nrfx_spis_uninit()
403 nrfx_gpiote_pin_uninit(&gpiote, p_cb->csn_pin); in nrfx_spis_uninit()
405 nrfx_gpiote_pin_uninit(p_cb->csn_pin); in nrfx_spis_uninit()
409 nrfx_gpiote_channel_free(&gpiote, p_cb->gpiote_ch); in nrfx_spis_uninit()
411 nrfx_gpiote_channel_free(p_cb->gpiote_ch); in nrfx_spis_uninit()
421 if (!p_cb->skip_gpio_cfg) in nrfx_spis_uninit()
443 p_cb->state = NRFX_DRV_STATE_UNINITIALIZED; in nrfx_spis_uninit()
449 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_init_check() local
451 return (p_cb->state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_spis_init_check()
456 spis_cb_t * p_cb) in spis_state_entry_action_execute() argument
460 switch (p_cb->spi_state) in spis_state_entry_action_execute()
471 NRFX_ASSERT(p_cb->handler != NULL); in spis_state_entry_action_execute()
472 p_cb->handler(&event, p_cb->p_context); in spis_state_entry_action_execute()
484 event.p_tx_buf = (void *)p_cb->tx_buffer; in spis_state_entry_action_execute()
485 event.p_rx_buf = (void *)p_cb->rx_buffer; in spis_state_entry_action_execute()
490 event.tx_buf_size = p_cb->tx_buffer_size; in spis_state_entry_action_execute()
491 event.rx_buf_size = p_cb->rx_buffer_size; in spis_state_entry_action_execute()
495 NRFX_LOG_HEXDUMP_DEBUG((uint8_t const *)p_cb->rx_buffer, in spis_state_entry_action_execute()
496 event.rx_amount * sizeof(p_cb->rx_buffer[0])); in spis_state_entry_action_execute()
497 NRFX_ASSERT(p_cb->handler != NULL); in spis_state_entry_action_execute()
498 p_cb->handler(&event, p_cb->p_context); in spis_state_entry_action_execute()
514 spis_cb_t * p_cb, in spis_state_change() argument
517 p_cb->spi_state = new_state; in spis_state_change()
518 spis_state_entry_action_execute(p_spis, p_cb); in spis_state_change()
527 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_buffers_set() local
530 NRFX_ASSERT(p_cb->state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_spis_buffers_set()
553 switch (p_cb->spi_state) in nrfx_spis_buffers_set()
558 p_cb->tx_buffer = p_tx_buffer; in nrfx_spis_buffers_set()
559 p_cb->rx_buffer = p_rx_buffer; in nrfx_spis_buffers_set()
560 p_cb->tx_buffer_size = tx_buffer_length; in nrfx_spis_buffers_set()
561 p_cb->rx_buffer_size = rx_buffer_length; in nrfx_spis_buffers_set()
564 spis_state_change(p_instance->p_reg, p_cb, SPIS_BUFFER_RESOURCE_REQUESTED); in nrfx_spis_buffers_set()
581 static void irq_handler(NRF_SPIS_Type * p_spis, spis_cb_t * p_cb) in irq_handler() argument
594 switch (p_cb->spi_state) in irq_handler()
603 nrf_spis_tx_buffer_set(p_spis, (uint8_t *)p_cb->tx_buffer, p_cb->tx_buffer_size); in irq_handler()
604 nrf_spis_rx_buffer_set(p_spis, (uint8_t *)p_cb->rx_buffer, p_cb->rx_buffer_size); in irq_handler()
612 spis_state_change(p_spis, p_cb, SPIS_BUFFER_RESOURCE_CONFIGURED); in irq_handler()
627 switch (p_cb->spi_state) in irq_handler()
630 spis_state_change(p_spis, p_cb, SPIS_XFER_COMPLETED); in irq_handler()