-
Notifications
You must be signed in to change notification settings - Fork 99
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
DMA traits proposition #486
Comments
Thanks! u64 should also get a Word impl, or is there a reason it’s not there? |
Yeah, I don't see a reason to not having it there, I just forgot about it since I usually only deal with 32bits, heh. In another note, I would like to bring attention to some subtleties of these traits that seem to be needed in order to be flexible for HAL implementors.
I'm okay with these points and I think they are valid, but if anyone has something against them I would like to hear their opinions. |
Maybe some of these explanations can be added to the documentation. It is probably helpful for implementers. |
Wouldn't the |
The HAL implementors will need to restrict what I don't think leaving the trait to be only implemented by HALs would work, in the end each HAL would have their own set of traits, unless I didn't understand what you mean exactly. |
You're right, I realize now that I didn't think this through. |
We have one open bike-shedding question left: How should we name those traits? @thalesfragoso and me have pretty much agreed to The argument for having the prefix is that it avoids ambiguity, the buffers are specific to use with DMA after all. If we just used The arguments against having the prefix are a) more succinct names are better and b) these traits will mostly be used in a DMA implementation context where the relation to DMA should be pretty clear anyway. Would be good to get a few more opinions on that and the naming in general. |
I think the shorter names are appropriate. Where more context is required, the user can do something like this: use embedded_dma as dma;
impl<Buffer> ...
where Buffer: dma::ReadBuffer Or even this: use embedded_dma::ReadBuffer as DmaReadBuffer; |
New concerns and suggestions should now be directed to the new repo https://github.com/rust-embedded/embedded-dma, closing this. |
After some discussing in the focus project for a safe DMA api, we came up with an initial proposition for the necessary buffers traits.
The traits can be found in this gist: https://gist.github.com/thalesfragoso/6279a186dd1f842ea08acdee1e889dba
The gist is a slightly upgraded version from the traits found in https://github.com/ra-kete/dma-poc where more information on the problem and decisions can be found.
I'm opening this issue to discuss the flexibility and soundness of these proposed traits. I'm not sure if this is a RFC matter, if it's I can create one.
Implementations using these traits can be found here stm32-rs/stm32f3xx-hal#86 and here stm32-rs/stm32f4xx-hal#186.
CC @ra-kete
The text was updated successfully, but these errors were encountered: