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 #43

Closed
mciantyre opened this issue Apr 7, 2020 · 3 comments · Fixed by #49
Closed

Support SPI DMA transfers #43

mciantyre opened this issue Apr 7, 2020 · 3 comments · Fixed by #49
Assignees
Labels
imxrt-hal HAL related issue

Comments

@mciantyre
Copy link
Member

From @dflemstr:

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!

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:

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

Manually migrating this from mciantyre/teensy4-rs#51

@mciantyre mciantyre added the imxrt-hal HAL related issue label Apr 7, 2020
@mciantyre mciantyre self-assigned this Apr 21, 2020
@mciantyre
Copy link
Member Author

Anyone mind if I take this on? I've been playing around with the DMA controller, and I have a working DMA-based UART driver in another project. My second pass should be better than my first 😛

@mciantyre
Copy link
Member Author

@dflemstr, if you have the time, I'd love your thoughts on #49. I've demonstrated full-duplex SPI transfers using DMA in the teensy4-rs repo, and it'd be good to see if this could satisfy your use-case.

@dflemstr
Copy link
Contributor

This is looking fantastic! Due to covid and other things I have had to postpone making progress, but I will make an attempt to port over the code for my use-case on top of your feature branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imxrt-hal HAL related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants