Comments (10)
FYI: I'm (slowly) working on a reference/POC implementation of I2S for the STM32 F4xx (https://github.com/maxekman/stm32f4xx-hal/tree/i2s) with a running demo for the 407G Discovery (https://github.com/maxekman/stm32f407g-disc/tree/dac-support-with-cs43l22). I'll definitely be interested in having/adding support for I2S and SAI for this platform eventually, as that is what I plan to use in a project later on.
from stm32h7xx-hal.
So far I've gotten an I2S passthru working (sans DMA) and added a split for the DMA channels. Doing a proper safe DMA implementation is beyond what I'm able to do in Rust currently so I'm thinking I just hack something together that works in my daisy library for now and see if I can get anything DMA working.
https://github.com/mtthw-meyer/stm32h7xx-hal/tree/sai-i2s-v0.2.x-1
from stm32h7xx-hal.
Great! There are a number of different pins that can be used for I2S, I think this is the full list:
pins! {
SAI1:
MCLK_A: [
PE2<Alternate<AF6>>,
PG7<Alternate<AF6>>
]
SCK_A: [
PE5<Alternate<AF6>>
]
FS_A: [
PE4<Alternate<AF6>>
]
SD_A: [
PB2<Alternate<AF6>>,
PC1<Alternate<AF6>>,
PD6<Alternate<AF6>>,
PE6<Alternate<AF6>>
]
MCLK_B: [
PF7<Alternate<AF6>>
]
SCK_B: [
PF8<Alternate<AF6>>
]
FS_B: [
PF9<Alternate<AF6>>
]
SD_B: [
PE3<Alternate<AF6>>,
PF6<Alternate<AF6>>
]
SAI2:
MCLK_A: [
PE0<Alternate<AF10>>,
PI4<Alternate<AF10>>
]
SCK_A: [
PD13<Alternate<AF10>>,
PI5<Alternate<AF10>>
]
FS_A: [
PD12<Alternate<AF10>>,
PI7<Alternate<AF10>>
]
SD_A: [
PD11<Alternate<AF10>>,
PI6<Alternate<AF10>>
]
MCLK_B: [
PA1<Alternate<AF10>>,
PE6<Alternate<AF10>>,
PE14<Alternate<AF10>>,
PH3<Alternate<AF10>>
]
SCK_B: [
PA2<Alternate<AF8>>,
PE12<Alternate<AF10>>,
PH2<Alternate<AF10>>
]
FS_B: [
PA12<Alternate<AF8>>,
PC0<Alternate<AF8>>,
PE13<Alternate<AF10>>,
PG9<Alternate<AF10>>
]
SD_B: [
PA0<Alternate<AF10>>,
PE11<Alternate<AF10>>,
PF11<Alternate<AF10>>,
PG10<Alternate<AF10>>
]
SAI3:
MCLK_A: [
PD15<Alternate<AF6>>
]
SCK_A: [
PD0<Alternate<AF6>>
]
FS_A: [
PD4<Alternate<AF6>>
]
SD_A: [
PD1<Alternate<AF6>>
]
MCLK_B: [
PD14<Alternate<AF6>>
]
SCK_B: [
PD8<Alternate<AF6>>
]
FS_B: [
PD10<Alternate<AF6>>
]
SD_B: [
PD9<Alternate<AF6>>
]
SAI4:
MCLK_A: [
PE2<Alternate<AF8>>
]
SCK_A: [
PE5<Alternate<AF8>>
]
FS_A: [
PE4<Alternate<AF8>>
]
SD_A: [
PB2<Alternate<AF8>>,
PC1<Alternate<AF8>>,
PD6<Alternate<AF8>>,
PE6<Alternate<AF8>>
]
MCLK_B: [
PF7<Alternate<AF8>>
]
SCK_B: [
PF8<Alternate<AF8>>
]
FS_B: [
PF9<Alternate<AF8>>
]
SD_B: [
PE3<Alternate<AF8>>,
PF6<Alternate<AF8>>
]
}
from stm32h7xx-hal.
Yes that's correct. A I2S implementation would be great, and I'd be happy to review it. mod/sai.rs
contains some functions that are common across all interfaces supported by the SAI, so those should be useful.
There are I2S traits proposed to embedded-hal by @eldruin. They are somewhat similar to the SPI traits, so you can looks at those for reference. A final implementation of those traits will require upgrading to embedded-hal v1.0, but for a prototype I would avoid that.
from stm32h7xx-hal.
There is also a branch of the i2s traits based on embedded-hal 0.2.x which you could use for now so that you do not need to deal with all the 1.0 breakage: i2s-v0.2.x
from stm32h7xx-hal.
Ok. I'll start there. I'm sure I'll have more questions once I figure out what to ask.
from stm32h7xx-hal.
@mtthw-meyer I'd be up for having a sans-DMA I2S implementation PR now. What do you think? I agree that DMA will take several attempts / be complex as you say, so I think makes sense to get basic I2S in the HAL separately.
from stm32h7xx-hal.
Yes, that seems like a good plan. I'll fill ot the I2S a bit more and macro the rest of the SAI2-4.
from stm32h7xx-hal.
Draft up at #99.
from stm32h7xx-hal.
Currently this is implementing the trait FullDuplex with a Word type of u32. Would i32 be more appropriate for sound data? I know the codec chip on the daisy board uses S24.
from stm32h7xx-hal.
Related Issues (20)
- WindowWatchdogReset isn't matched by ResetReason properly despite valid RCC_RSR HOT 4
- i2c can lock up MCU HOT 2
- i2c.clear_irq should also clear rxie interrupts
- USB Host example HOT 2
- regression in ethernet DMA initialization for H743 chips HOT 4
- SDMMC - enable multiple block writes HOT 1
- FAT32 adapters HOT 1
- FDCAN driver lacks implementation of free()
- Reading internal flash triggers HardFault HOT 7
- fdcan not building HOT 1
- nukleo-h723zg usb building problem HOT 2
- How to perform SPI write before starting DMA transfer? HOT 3
- Update to embedded-hal v1.0.0 HOT 7
- SPI-W25Q128 use standard SPI HOT 1
- Ethernet examples not working for H755ZI HOT 1
- Problems with timer clocks
- 480MHz and vos0 unstable on stm32h747XI (Arduino GIGA R1 WiFi) HOT 5
- DSI video mode examples not working on STM32H747I-DISCO
- Support STM32H7R3/7S3 HOT 1
- STM32H725 can't run at 550MHz HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stm32h7xx-hal.