Hi, I just read SPI api-reference and looking for an example snippet of reading SPI data in DMA mode.
There is spi_master but it doesnt use DMA (doesnt it?) and just send, do not read any data. Things that are important for me:
- declaring memory for buffers (how, should I declare new buffer for each transaction?)
- cmd and addr variable length (should use only tx_buffer or change addr length dynamically?)
- what is length and rxlength? length is sum of rxlength and txlength?
SPI DMA Read/Write example
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: SPI DMA Read/Write example
The SPI master driver actually happily uses DMA as long as you tell it to. I think the SPI master example has some example code for reading (in this case, the LCD ID) as well.
Who is online
Users browsing this forum: MicroController and 115 guests