I have been able to write code that sends out SPI data using DMA... however I can not figure out how to get it to interrupt me to tell me its done with the transfer, right now it waits for completion.....
I used this code for my example https://github.com/natanaeljr/esp32-SPIbus
RichardS.
SPI DMA and interrupts...
Re: SPI DMA and interrupts...
There is an example of pre-transfer callback in \esp-idf\examples\peripherals\spi_master
There is also a post-transfer callback as well that you can setup to tell you when the transfer is complete.
http://esp-idf.readthedocs.io/en/latest ... aster.html
There is also a post-transfer callback as well that you can setup to tell you when the transfer is complete.
http://esp-idf.readthedocs.io/en/latest ... aster.html
-
- Posts: 65
- Joined: Mon Mar 26, 2018 7:57 pm
Re: SPI DMA and interrupts...
Thanks for the reply.mikemoy wrote:There is an example of pre-transfer callback in \esp-idf\examples\peripherals\spi_master
There is also a post-transfer callback as well that you can setup to tell you when the transfer is complete.
http://esp-idf.readthedocs.io/en/latest ... aster.html
I added a callback on the post-transfer and it still waits till completion and then calls the callback
RichardS
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: SPI DMA and interrupts...
You're using 'done with the transfer' and 'completion' here as if there's a difference between them; I'm not sure we all are getting what you mean there. Could you elaborate a bit on what you're trying to do, to make us understand what you want a bit better?
Re: SPI DMA and interrupts...
https://esp-idf.readthedocs.io/en/lates ... nsaction_t
Send a SPI transaction, wait for it to complete, and return the result.
This function is the equivalent of calling spi_device_queue_trans() followed by spi_device_get_trans_result()
Who is online
Users browsing this forum: jtroncin21, MicroController and 98 guests