SPI DMA and interrupts...

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

SPI DMA and interrupts...

Postby themindfactory » Thu May 10, 2018 3:58 pm

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.

mikemoy
Posts: 627
Joined: Fri Jan 12, 2018 9:10 pm

Re: SPI DMA and interrupts...

Postby mikemoy » Thu May 10, 2018 4:17 pm

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

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

Re: SPI DMA and interrupts...

Postby themindfactory » Thu May 10, 2018 5:05 pm

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
Thanks for the reply.

I added a callback on the post-transfer and it still waits till completion and then calls the callback :-(

RichardS

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI DMA and interrupts...

Postby ESP_Sprite » Fri May 11, 2018 3:37 am

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?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: SPI DMA and interrupts...

Postby WiFive » Fri May 11, 2018 4:15 am

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: Bing [Bot] and 97 guests