esp32-s3 polling for SPI transfer done
esp32-s3 polling for SPI transfer done
At the moment I'm initializing SPI slave to use a callback function when SPI transfer is finished and it works fine, except for the fact that it sometimes occurres in inconvenient times. Because of that, I would prefer to check myself if the transfer is finished and then do the appropriate tasks. My question is if this is possible, and if it is, how is it done?
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: esp32-s3 polling for SPI transfer done
A common pattern is to have the callback function send a 'message' to a task, which the task can then receive and process when it is 'convenient'.
For this 'messaging', you can use a FreeRTOS queue, semaphore, or direct-to-task notification.
For this 'messaging', you can use a FreeRTOS queue, semaphore, or direct-to-task notification.
Re: esp32-s3 polling for SPI transfer done
Thank you for your reply. The thing is that I don't want interrupt on any of the cores. I was hoping that it's possible to check if there is a flag indicating that SPI message is received. Then I would clear the "flag", process the received message and initiate another SPI transfer manually.
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: esp32-s3 polling for SPI transfer done
Are you using DMA?
Which interrupts do you want to 'pause'? All of them or just SPI?
Which interrupts do you want to 'pause'? All of them or just SPI?
Re: esp32-s3 polling for SPI transfer done
Only SPI. I don't want to pause DMA, it should do the transfer when requested, but not generate interrupt on completion. The thing is I'm using LCD interrupts as well, and I don't know how to change interrupt priorities of any of them, so I guess that increasing priority of LCD interrupt would also do the trick. I could only find changing priority levels of interrupts on pins.
Who is online
Users browsing this forum: No registered users and 419 guests