SPI master starting transfer for ISR
Posted: Tue Apr 14, 2020 2:31 pm
Hi all,
For a project I need to start a SPI master transfer from a ISR. There are 2 devices on the bus and it is oke to wait for a transfer of the other device to complete. So spi_device_queue_trans should do the trick. Transfers to these devices are not synchronized and use a limited bandwidth of the spi bus.
A transfer to a device is a kind of trigger for doing a analog/digital conversion. And should be done with as liitle jitter as possible (but waiting for a transfer of the other device is oke).
And yes, it works with spi_device_queue_trans in a ISR (and transfer functions in IRAM).
But: spi_device_queue_trans is using the xQueueSend function from the FreeRTOS and this should not be called from an ISR.
So, it is asking for trouble.
Is there another way?
Best,
Erik Claij
For a project I need to start a SPI master transfer from a ISR. There are 2 devices on the bus and it is oke to wait for a transfer of the other device to complete. So spi_device_queue_trans should do the trick. Transfers to these devices are not synchronized and use a limited bandwidth of the spi bus.
A transfer to a device is a kind of trigger for doing a analog/digital conversion. And should be done with as liitle jitter as possible (but waiting for a transfer of the other device is oke).
And yes, it works with spi_device_queue_trans in a ISR (and transfer functions in IRAM).
But: spi_device_queue_trans is using the xQueueSend function from the FreeRTOS and this should not be called from an ISR.
So, it is asking for trouble.
Is there another way?
Best,
Erik Claij