-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unidirectional SPI DMA #104
Conversation
Can you rebase on master and use AsSlice instead of AsRef? |
Oops, I guess I forgot to compile after rebasing yesterday 😅 |
That took a bit longer than a day, but I have finally got around to testing it. Looks like it works which means that this should be ready to merge unless there are any other issues |
src/spi.rs
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Excess newlines
src/spi.rs
Outdated
use core::sync::atomic::{self, Ordering}; | ||
|
||
use as_slice::AsSlice; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please move module-wide imports to the top
@TheZoq2 Mind rebasing? Otherwise looks good to go for me. |
Sure, thanks for the review |
This adds basic support for transmitting data over SPI using DMA.
Since this is a basic implementation, only non-circular buffers are supported. However, at the moment I don't have a need for that, and I think we might have to restructure some DMA stuff for simultaneous TX and RX support so I don't want to put too much effort into this until we get around to that.
I think RX support might be fairly easy, but it would require reconfiguring the SPI device as reads happen on writes in bidirectional mode.
Note: I have yet to test DMA over SPI2, I'll do that tomorrow but the code probably shouldn't change