Skip to content
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

Improve DMA ergonomics when working with generics #239

Closed
wants to merge 3 commits into from

Conversation

TheZoq2
Copy link
Member

@TheZoq2 TheZoq2 commented Jun 27, 2020

I found our current DMA API to be quite difficult to work with in external crates because of the A, B thingy. This replaces the buffer types with the ones used in the embeddonomicon https://docs.rust-embedded.org/embedonomicon/dma.html

As far as I can tell, this is safe, but I may very well be missing something.

Because of the way that Transfer is implemented, I found no way to specify a generic TxDma which has a wait method. To fix that, I added the Transferable trait.

Example usage of all of this can be found at https://gitlab.com/TheZoq2/ws2812-spi-dma/-/blob/master/src/lib.rs

DNM because the same treatment has to be given to RxDma, but I just want to make sure I don't do anything stupid before going through with that.

@thalesfragoso
Copy link
Member

You might want to wait on the resolution of rust-embedded/embedonomicon#64

@TheZoq2
Copy link
Member Author

TheZoq2 commented Jun 27, 2020

Oh, hadn't seen that. I'll have a look at that tomorrow, thanks for the heads up!

@TheZoq2
Copy link
Member Author

TheZoq2 commented Jun 28, 2020

I added StableDeref now, hopefully I did that correctly 😅

@TheZoq2
Copy link
Member Author

TheZoq2 commented Oct 5, 2020

Closing this in favor of #274

@TheZoq2 TheZoq2 closed this Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants