-
Notifications
You must be signed in to change notification settings - Fork 120
Sai i2s v0.2.x 1 #99
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
Sai i2s v0.2.x 1 #99
Conversation
|
I'm done with this if you think it's ready for review. |
richardeoin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for contributing this @mtthw-meyer! I don't have any comments on the DMA impl, it looks fine for what it is but there's likely more to be learnt by using it.
Don't forget to add yourself to the authors list
|
I'll look into those changes. There are ALOT of settings and it's not clear which ones are useful to be accessible. |
|
Thanks for those updates! Indeed managing all the configuration options is difficult, it's really only by experimenting that you get an idea of which ones are useful. A nice method of managing all the configuration options is the 'builder pattern', there's a good example in the spi config @ryan-summers added recently. The new function can still take arguments, but things that have obvious defaults / are optional can configured by a builder method instead. |
|
Builder is in place now with most of the configuration exposed. I cleaned up the listen/unlisten methods to work by channel since they were locked into channel A and exposed some more controls at the sai level. |
richardeoin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements, thanks!
What do you think of allowing the user to specify the frame size? It can be implemented with an Option<T> in the I2SChanConfig with default None; then in i2s_config_channel you can use unwrap_or to use the calculated value if it was never set by the user.
|
I can expose that as well, I'm not sure anyone will need it but might as well. |
|
Closes #90 |
richardeoin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Now this is only waiting on rust-embedded/embedded-hal#204 for the traits.
|
Alright, I'll mark this implementation as finished in the issue. Thank you for all your work! |
|
I'd like to see this merged for the next stm32h7xx-hal release. Until embedded-hal catches up, we can do by copying the required traits into the traits directory. @mtthw-meyer does that sound like a reasonable plan to you? |
|
Sounds fine to me. |
Updated FullDuplex to be implemented for all channels and mux between Rx/Tx
Updated sai module methods
Addressed review comments
5aca105 to
fbf195d
Compare
|
Done and rebased onto master |
fbf195d to
4f55963
Compare
|
bors r+ |

Implemented I2S for SAI1-4.
Added traits to split DMA channels.
Example runs on daisy seed board successfully.
Closes #90