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

Support SPI DMA transfers #51

Closed
dflemstr opened this issue Mar 2, 2020 · 3 comments
Closed

Support SPI DMA transfers #51

dflemstr opened this issue Mar 2, 2020 · 3 comments

Comments

@dflemstr
Copy link
Contributor

dflemstr commented Mar 2, 2020

I love the recent development and buzz around SPI support. In my application, I want to transfer a lot of data, and it would hence be useful to support DMA transfers for SPI!

@mciantyre
Copy link
Owner

Happy to help out. Just want to note that we're re-implementing this repository's HAL on a different foundation. Check out the work in the imxrt-rs repository. #49 talks about the compilation speed improvements gained from using a different register access layer. If we want to implement DMA channels and abstractions, we'll want to add them over in that repo.

Any thoughts about what a DMA API might look like for your use-case? Haven't seen many DMA-based Rust drivers, though I haven't looked too hard.

@dflemstr
Copy link
Contributor Author

I have another side project where I've been trying to eek out the maximum amount of performance from SPI in a device independent manner. I defined the API to look like this: https://github.com/dflemstr/embedded-platform/blob/master/src/spi.rs

Of course, that introduces async as well, while this crate/embedded_hal is very focused on blocking APIs. However the main take-away from that API I think is:

  1. You initiate a transfer which takes ownership of the slice of memory you want to send
  2. You can poll that transfer to completion (and do that in a tight loop if you want a "blocking" API)

@mciantyre
Copy link
Owner

I moved this to imxrt-rs/imxrt-hal#43. Let's have follow-up discussions there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants