-
Notifications
You must be signed in to change notification settings - Fork 232
WIP: Attempt at DMA traits #26
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
Conversation
I have implemented DMA for Spi in nikhilkalige/stm32f411-bsp I have then tried to use the Spi in a driver for TLC5955 in nikhilkalige/tlc5955 Note: I created all the 3 Dma traits and later somewhat modified the DmaWrite trait, as that was one I needed first to get stuff going.. |
Hmm.. May be it would make sense to use something like a |
☔ The latest upstream changes (presumably #27) made this pull request unmergeable. Please resolve the merge conflicts. |
//! DMA Interface | ||
|
||
/// Static alias for DMA | ||
pub type Static<T> = &'static mut T; |
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.
I don't see this alias being used anywhere
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.
Thank you for your initial submission.
type Transfer: dma::Transfer + ?Sized; | ||
|
||
/// Recieve `words` from the slave. | ||
fn recieve_dma<Buffer, Payload>(self, words: &'static mut Buffer) -> Self::Transfer |
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.
Spelling: receive_dma
Buffer: Unsize<[Word]>; | ||
} | ||
|
||
/// DMA Write mode |
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.
Documentation needs to be updated
type Payload; | ||
|
||
/// Get buffer | ||
fn deref(&self) -> &Self::Item; |
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.
Does it make sense to allow access to the data while the transfer is still ongoing?
pub trait Transfer { | ||
/// Return type | ||
type Item; | ||
/// Return type |
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.
Documentation could be more helpful. What's the difference between Item
and Payload
?
I'm trying to implement DMA for the STM32F429. As my use-case is (gapless) audio, I'm interested in using it in a continuous (double-buffered/circular), not one-shot mode. |
Thanks for the PR @nikhilkalige. I think we should first design an API that meets all the requirements in #37 (comment) and then test it out of tree for a bit before landing any new struct / trait in this crate so I'm going to close this PR until we have a better idea of what pieces we want to land in this crate. |
26: Transactional WriteRead r=ryankurte a=eldruin This fixes rust-embedded#25 by implementing a transactional write-read without STOP in the middle. It also fixes a type cast which was the only warning present. Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
27: Release 0.3.0 preparation r=ryankurte a=eldruin I updated the changelog with everything that happened since the 0.2.2 release and bumped the minor version because of the digital::v2. I also fixed setting the embedded-hal version to 0.2.3 because that is when the digital::v2 traits were released. This branch sits on top of rust-embedded#26 with the hopeful date of today :) Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
This does not work in any manner.
I am working on a Persistence of vision project of mine. I somehow need DMA to get the data rate high. This is my attempt at getting it to work.
I have tried to replicate the DMA design from the bluepill crate. I liked the move semantics used there. However I am not sure to get it working when you have
serial
stored in a structure.Hopefully someone who is better than me at rust, can give some ideas and suggestions.. :)