Skip to content

Use DMA Transfer API in I2S module#209

Merged
jonas-schievink merged 5 commits intonrf-rs:masterfrom
kalkyl:i2s-dma
Sep 4, 2020
Merged

Use DMA Transfer API in I2S module#209
jonas-schievink merged 5 commits intonrf-rs:masterfrom
kalkyl:i2s-dma

Conversation

@kalkyl
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@kalkyl
Copy link
Copy Markdown
Contributor Author

kalkyl commented Sep 3, 2020

I’ll do my homework ;)

@kalkyl
Copy link
Copy Markdown
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
Copy Markdown

eldruin commented Sep 4, 2020

FYI, I just published embedded-dma 0.1.1

Comment thread nrf-hal-common/src/i2s.rs
Copy link
Copy Markdown
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