Lines Matching refs:p_cb
170 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in spis_configure() local
174 if (p_cb->csn_pin != NRF_SPIS_PIN_NOT_CONNECTED) in spis_configure()
176 nrfx_gpiote_pin_uninit(p_cb->csn_pin); in spis_configure()
177 p_cb->csn_pin = NRF_SPIS_PIN_NOT_CONNECTED; in spis_configure()
190 .p_in_channel = &p_cb->gpiote_ch in spis_configure()
209 p_cb->csn_pin = csn_pin; in spis_configure()
239 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_init() local
244 if (p_cb->state != NRFX_DRV_STATE_UNINITIALIZED) in nrfx_spis_init()
268 p_cb->handler = event_handler; in nrfx_spis_init()
269 p_cb->p_context = p_context; in nrfx_spis_init()
272 p_cb->csn_pin = NRF_SPIS_PIN_NOT_CONNECTED; in nrfx_spis_init()
280 err_code = nrfx_gpiote_channel_alloc(&p_cb->gpiote_ch); in nrfx_spis_init()
293 p_cb->skip_gpio_cfg = p_config->skip_gpio_cfg; in nrfx_spis_init()
298 nrfx_gpiote_channel_free(p_cb->gpiote_ch); in nrfx_spis_init()
311 p_cb->spi_state = SPIS_STATE_INIT; in nrfx_spis_init()
316 p_cb->state = NRFX_DRV_STATE_INITIALIZED; in nrfx_spis_init()
330 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_reconfigure() local
332 if (p_cb->state == NRFX_DRV_STATE_UNINITIALIZED) in nrfx_spis_reconfigure()
351 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_uninit() local
352 NRFX_ASSERT(p_cb->state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_spis_uninit()
357 if (p_cb->csn_pin != NRF_SPIS_PIN_NOT_CONNECTED) in nrfx_spis_uninit()
359 nrfx_gpiote_pin_uninit(p_cb->csn_pin); in nrfx_spis_uninit()
361 nrfx_gpiote_channel_free(p_cb->gpiote_ch); in nrfx_spis_uninit()
370 if (!p_cb->skip_gpio_cfg) in nrfx_spis_uninit()
392 p_cb->state = NRFX_DRV_STATE_UNINITIALIZED; in nrfx_spis_uninit()
399 spis_cb_t * p_cb) in spis_state_entry_action_execute() argument
403 switch (p_cb->spi_state) in spis_state_entry_action_execute()
414 NRFX_ASSERT(p_cb->handler != NULL); in spis_state_entry_action_execute()
415 p_cb->handler(&event, p_cb->p_context); in spis_state_entry_action_execute()
424 NRFX_LOG_HEXDUMP_DEBUG((uint8_t const *)p_cb->rx_buffer, in spis_state_entry_action_execute()
425 event.rx_amount * sizeof(p_cb->rx_buffer[0])); in spis_state_entry_action_execute()
426 NRFX_ASSERT(p_cb->handler != NULL); in spis_state_entry_action_execute()
427 p_cb->handler(&event, p_cb->p_context); in spis_state_entry_action_execute()
443 spis_cb_t * p_cb, in spis_state_change() argument
446 p_cb->spi_state = new_state; in spis_state_change()
447 spis_state_entry_action_execute(p_spis, p_cb); in spis_state_change()
459 spis_cb_t * p_cb = &m_cb[p_instance->drv_inst_idx]; in nrfx_spis_buffers_set() local
481 switch (p_cb->spi_state) in nrfx_spis_buffers_set()
486 p_cb->tx_buffer = p_tx_buffer; in nrfx_spis_buffers_set()
487 p_cb->rx_buffer = p_rx_buffer; in nrfx_spis_buffers_set()
488 p_cb->tx_buffer_size = tx_buffer_length; in nrfx_spis_buffers_set()
489 p_cb->rx_buffer_size = rx_buffer_length; in nrfx_spis_buffers_set()
492 spis_state_change(p_instance->p_reg, p_cb, SPIS_BUFFER_RESOURCE_REQUESTED); in nrfx_spis_buffers_set()
509 static void irq_handler(NRF_SPIS_Type * p_spis, spis_cb_t * p_cb) in irq_handler() argument
522 switch (p_cb->spi_state) in irq_handler()
525 nrf_spis_tx_buffer_set(p_spis, (uint8_t *)p_cb->tx_buffer, p_cb->tx_buffer_size); in irq_handler()
526 nrf_spis_rx_buffer_set(p_spis, (uint8_t *)p_cb->rx_buffer, p_cb->rx_buffer_size); in irq_handler()
530 spis_state_change(p_spis, p_cb, SPIS_BUFFER_RESOURCE_CONFIGURED); in irq_handler()
545 switch (p_cb->spi_state) in irq_handler()
548 spis_state_change(p_spis, p_cb, SPIS_XFER_COMPLETED); in irq_handler()