I am working with SPIS on nRF5340. Since my RX and TX buffers will not change, is it possible to call nrfx_spis_buffers_set only once, during initialization?
I tried to do this during setup of the SPIS, but the transmission stops after one transfer. I guess the problem is in the fact that the function nrfx_spis_buffers_set is not doing only what is saying to be doing, ie. setting buffers, but it also changes the state of SPIS which is necessary for proper functioning of SPIS.
If I change spis_irq_handler in modules\hal\nordic\nrfx\drivers\src\nrfx_spis.c by adding nrf_spis_task_trigger(p_spis, NRF_SPIS_TASK_RELEASE) in "default" section of "switch" statement like this:
if (nrf_spis_event_check(p_spis, NRF_SPIS_EVENT_ACQUIRED))
{
nrf_spis_event_clear(p_spis, NRF_SPIS_EVENT_ACQUIRED);
NRFX_LOG_DEBUG("SPIS: Event: %s.", EVT_TO_STR(NRF_SPIS_EVENT_ACQUIRED));
switch (p_cb->spi_state)
{
case SPIS_BUFFER_RESOURCE_REQUESTED:
nrf_spis_tx_buffer_set(p_spis, (uint8_t *)p_cb->tx_buffer, p_cb->tx_buffer_size);
nrf_spis_rx_buffer_set(p_spis, (uint8_t *)p_cb->rx_buffer, p_cb->rx_buffer_size);
nrf_spis_task_trigger(p_spis, NRF_SPIS_TASK_RELEASE);
spis_state_change(p_spis, p_cb, SPIS_BUFFER_RESOURCE_CONFIGURED);
break;
default:
// No implementation required.
nrf_spis_task_trigger(p_spis, NRF_SPIS_TASK_RELEASE);
break;
}
}
everything is working fine.
Is there a proper way to do this, ie. without changes in nrfx_spis.c?