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

Add support for reading from USART using DMA #14

Merged
merged 6 commits into from Jun 19, 2019

Conversation

@hannobraun
Copy link
Member

commented Jun 18, 2019

This largely follow this guide from The Embedonomicon:
https://docs.rust-embedded.org/embedonomicon/dma.html

hannobraun added some commits Jun 17, 2019

Rename `dma::Tx` to `Target`
I originally thought I'd need a separate trait for receiving, i.e.
peripheral-to-memory transfers, but it looks like that's not going to be
necessary.
Add dependency on `as-slice`
We're going to need it to build a safe DMA API that is generic over the
specific buffer type used.
Make DMA generic over buffer
This will theoretically allow us to use other types than `&'static
[u8]`, like `Box<u8>` (I haven't checked, and given that a `Box` is hard
to come by, it doesn't seem immdetialy relevant).

What is immediately relevant, however, is that it allows us to use
`'static mut [u8]`, which is going to be required when I add support for
peripheral-to-memory transfers.
@mvertescher
Copy link
Member

left a comment

LGTM

@mvertescher

This comment has been minimized.

Copy link
Member

commented Jun 19, 2019

Great to see RX DMA implemented, thanks @hannobraun!

@mvertescher mvertescher merged commit fe29fcd into stm32-rs:master Jun 19, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@hannobraun hannobraun deleted the braun-embedded:usart-dma-read branch Jun 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.