Skip to content

Add check for I2S buffer pointer alignment#225

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

Add check for I2S buffer pointer alignment#225
jonas-schievink merged 5 commits intonrf-rs:masterfrom
kalkyl:i2s-dma2

Conversation

@kalkyl
Copy link
Copy Markdown
Contributor

@kalkyl kalkyl commented Sep 17, 2020

Buffer pointer addresses need to be 4 byte aligned to be used with the I2S DMA.
This PR adds a check in the rx, transfer and tx Transfer constructors and returns an Error::BufferMisaligned if this is not fulfilled.

Added trait bounds for supported word sizes (<=4 byte words)

Controller and peripheral demos were updated to utilize Aligned to ensure correct alignment.
Tested and verified to be working correctly on hardware.

Copy link
Copy Markdown
Contributor

@thalesfragoso thalesfragoso left a comment

Choose a reason for hiding this comment

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

Thanks again for this PR, I left some suggestions.

Comment thread examples/i2s-peripheral-demo/src/main.rs Outdated
Comment thread nrf-hal-common/src/i2s.rs
Comment thread examples/i2s-controller-demo/Cargo.toml Outdated
Comment thread examples/i2s-peripheral-demo/src/main.rs Outdated
@jonas-schievink jonas-schievink merged commit 2913282 into nrf-rs:master Sep 18, 2020
@kalkyl kalkyl deleted the i2s-dma2 branch September 18, 2020 11:15
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