|
PebbleOS v4.47.0-1075-g013613c8a
|
DAI on a sub-block of an STM32 serial audio interface. More...
Data Structures | |
| struct | pbl_audio_stm32_sai |
| STM32 SAI sub-block. More... | |
Macros | |
| #define | PBL_AUDIO_STM32_SAI_DEFINE(sym, _name, _base, _common, _clk, _tx, _rx, _dir, _pinctrl, _ring, _ring_size) |
| Define a SAI sub-block as a DAI. | |
DAI on a sub-block of an STM32 serial audio interface.
For playback, the sub-block is the master of an I2S link: two 32-bit slots of 16-bit samples, a bit clock of 64 times the rate, and a master clock of 256 times the rate for the codec, divided from its kernel clock. A mono stream is sent on both slots.
For capture, sub-block A takes a pair of PDM microphones on its PDM interface, of a card of format pdm: the left one samples on the rising edge of the clock, the right one on the falling edge, and a mono stream takes the left one. The clock runs at 64 times the rate, 128 times at 8 kHz, and PDM to PCM decimates the stream to the rate in software, with a gain of 0 to 42 dB. The first 100 ms, while the microphones settle, are silence. The DMA controller fills a ring of raw samples, which must be in memory it reaches: the memory region of the sub-block, as the SRAM4 for the BDMA of SAI4, or else the heap.
| struct pbl_audio_stm32_sai |
STM32 SAI sub-block.
| Data Fields | ||
|---|---|---|
| uintptr_t | base | Registers of the sub-block. |
| struct pbl_clk | clk | Kernel clock. |
| uintptr_t | common | Common registers of the SAI. |
| struct pbl_audio_dai | dai | DAI. |
| const struct pbl_dma_chan * | dma | DMA channel. |
| const struct pbl_pinctrl * | pinctrl | Pins. |
| uintptr_t | ring | Memory for the raw capture ring, or 0 to take it from the heap. |
| size_t | ring_size | Size of ring, in bytes. |
| struct pbl_audio_stm32_sai_state * | state | Runtime state. |
| #define PBL_AUDIO_STM32_SAI_DEFINE | ( | sym, | |
| _name, | |||
| _base, | |||
| _common, | |||
| _clk, | |||
| _tx, | |||
| _rx, | |||
| _dir, | |||
| _pinctrl, | |||
| _ring, | |||
| _ring_size | |||
| ) |
Define a SAI sub-block as a DAI.
| sym | Symbol of the DAI. |
| _name | Device name. |
| _base | Registers of the sub-block. |
| _common | Common registers of the SAI. |
| _clk | Kernel clock, from PBL_CLK(). |
| _tx | Playback DMA channel, or NULL. |
| _rx | Capture DMA channel, or NULL. |
| _dir | Direction, one of pbl_audio_dir. |
| _pinctrl | Default state of the pins. |
| _ring | Memory for the raw capture ring, or 0 to take it from the heap. |
| _ring_size | Size of _ring, in bytes. |