Hello!
So I've looked through the testhal and example code and maybe I just missed it but I am not seeing an example of how to send data with DMA over SPI. In the STORM example it looks like it's just doing a mem to mem copy.
What doesn't make sense to me is do I need 2 buffers? I see in the init code for SPI that it is in fact setting up the DMA stream associated with SPI2 as I would expect, I am just not sure how to send the data. My code I wrote doesn't do anything and I suspect it's because the destination is not setup right. With the DMA copy, do you still use 2 buffers (source and destination).
Any help appreciated!
Thanks!
Rick
SPI over DMA example?
Moderators: RoccoMarco, lbednarz, tfAteba
-
Rick Burnett
- Posts: 150
- Joined: Tue Jan 08, 2013 2:20 pm
Re: SPI over DMA example?
Turns out, you do this already so there is nothing I needed to do but send a bigger chunk with spiSend instead of sending one byte at a time. Works fantastic!
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: SPI over DMA example?
Exactly, the DMA is used transparently into the various drivers where applicable.
Giovanni
Giovanni
-
Rick Burnett
- Posts: 150
- Joined: Tue Jan 08, 2013 2:20 pm
Re: SPI over DMA example?
Excellent work. I really didn't understand that at first. I guess the only thing I will really need to use the DMA transfer functions you've created is on my second project where I want to hang an LCD of the SMC and I can setup the DMA to write to it that way.