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

Use DMA Transfer API in I2S module #209

Merged
merged 5 commits into from
Sep 4, 2020
Merged

Conversation

kalkyl
Copy link
Contributor

@kalkyl kalkyl commented Sep 2, 2020

I changed the I2S module to use a DMA Transfer API for TX and RX operations.
I also added support for full duplex transfers and the demos were updated according to the new API.

"Controller mode" demo (TX):
https://github.com/kalkyl/nrf-hal/blob/i2s-dma/examples/i2s-controller-demo/src/main.rs

"Peripheral mode" demo (RX):
https://github.com/kalkyl/nrf-hal/blob/i2s-dma/examples/i2s-peripheral-demo/src/main.rs

@jonas-schievink
Copy link
Contributor

Thanks!

I think Pin might not be the right thing to use for DMA APIs (see rust-embedded/embedonomicon#64). The embedded-dma crate provides traits for DMA APIs though, I wonder if we should just use those.

@kalkyl
Copy link
Contributor Author

kalkyl commented Sep 3, 2020

Thanks!

I think Pin might not be the right thing to use for DMA APIs (see rust-embedded/embedonomicon#64). The embedded-dma crate provides traits for DMA APIs though, I wonder if we should just use those.

Ahh i see... I can't really figure out how to implement them for this at the moment, i guess i haven't fully understood how they're supposted to be used... Any hints?

@jonas-schievink
Copy link
Contributor

I've also never used them so far, unfortunately.

@kalkyl
Copy link
Contributor Author

kalkyl commented Sep 3, 2020

I’ll do my homework ;)

@kalkyl
Copy link
Contributor Author

kalkyl commented Sep 4, 2020

Ok i have a working implementation using the embedded_dma traits. The only problem is embedded_dma doesn't implement Word for signed integer types, so we'd need upstream support for that to make it usable.
It works with my local patched version, so i submitted a PR to embedded-dma adding them in:
rust-embedded/embedded-dma#3

bors bot added a commit to rust-embedded/embedded-dma that referenced this pull request Sep 4, 2020
5: Prepare 0.1.1 release r=therealprof a=eldruin

A release with the signed integer implementations would be helpful for nrf-rs/nrf-hal#209

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
@eldruin
Copy link

eldruin commented Sep 4, 2020

FYI, I just published embedded-dma 0.1.1

Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jonas-schievink jonas-schievink merged commit c3d01a2 into nrf-rs:master Sep 4, 2020
@kalkyl kalkyl deleted the i2s-dma branch September 4, 2020 13:37
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

Successfully merging this pull request may close these issues.

3 participants