-
Notifications
You must be signed in to change notification settings - Fork 209
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
wip: Serial audio interface (SAI) #248
Draft
mgottschlag
wants to merge
5
commits into
stm32-rs:master
Choose a base branch
from
mgottschlag:sai
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bors bot
added a commit
that referenced
this pull request
Apr 15, 2021
265: Add I2S communication using SPI peripherals r=therealprof a=samcrow # Introduction Welcome to my first large pull request, which adds support for I2S audio communication using supported SPI peripherals. Like the way we support CAN with the bxcan library, I am proposing to support I2S using my [stm32_i2s_v12x](https://crates.io/crates/stm32_i2s_v12x) library. Although stm32_i2s_v12x is in a separate repository, we can also talk about it here. # Notes * The I2S module is available if the `i2s` feature is enabled, in order to not increase compile time for applications that don't use I2S. * All four modes are supported: master transmit, master receive, slave transmit, and slave receive. * Basic support for DMA, interrupts, and error detection is provided. * All STM32F4 models are supported. * I added two examples that run on the STM32F411E-DISCO board and send audio to the on-board DAC. One of them uses DMA. These changes are not perfect, so criticism and suggestions are welcome. # Limitations * No support for full-duplex communication * I have tested master transmit mode fairly thoroughly, but have not tested the other modes. * No support for embedded-hal I2S traits * [The I2S pull request](rust-embedded/embedded-hal#204) is still under review. The proposed traits look compatible with this driver code. Until that pull request gets merged and released, people can still use this driver code directly. # Related work * SAI driver pull request in this repository: #248 * Another, less complete, pull request for I2S in this repository: #212 * also #145 * embedded-hal pull request for I2S traits: rust-embedded/embedded-hal#204 Co-authored-by: Sam Crow <scrow@eng.ucsd.edu> Co-authored-by: Sam Crow <samcrow@users.noreply.github.com>
Any progress on this? |
… now). Some bits are still missing: - Support for DMA - Implementation of the new embedded-hal I2S traits - Documentation about how to set the intermediate SAI clock - Support for other MCUs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains some preliminary code for the SAI. In the stm32f7xx-hal a driver already exists iirc, but that driver is limited to duplex I2S. This API is slightly more flexible, yet similarly easy to use.
Usage example:
Bits still missing: