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

Add check for I2S buffer pointer alignment #225

Merged
merged 5 commits into from
Sep 18, 2020

Conversation

kalkyl
Copy link
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
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.

examples/i2s-peripheral-demo/src/main.rs Outdated Show resolved Hide resolved
nrf-hal-common/src/i2s.rs Show resolved Hide resolved
@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