Module stm32_hal2::sai[][src]

Expand description

Serial audio interface (SAI) support. Used for I2S, PCM/DSP, TDM, AC’97 etc. See L443 Reference Manual, section 41. H743 FM, section 51.

Structs

Represents the Serial Audio Interface (SAI) peripheral, used for digital audio input and output.

Configuration for the SAI peripheral. Mainly affects the ACR and BCR registers. Used for either channel. For details, see documentation of individual structs and fields. You may be forced into certain settings based on the device used.

Enums

Select Stereo or Mono mode.Sets xCR1 register, MONO field.

Select the data size to use. xCR1 register, DS field.

FIFO threshold. Affects xCR2 reg, FTH field. Affects when SAI interrupts, and DMA transfers occur.

Set which bit is transmitted first: Least significant, or Most significant. You may have to choose the one used by your SAI device. Sets xCR1 register, LSBFIRST field.

Frame synchronization offset. Depending on the audio protocol targeted in the application, the Frame synchronization signal can be asserted when transmitting the last bit or the first bit of the audio frame (this is the case in I2S standard protocol and in MSB-justified protocol, respectively). Sets FRCR register, FSOFF field.

This bit is set and cleared by software. It is used to configure the level of the start of frame on the FS signal. It is meaningless and is not used in AC’97 or SPDIF audio block configuration. This bit must be configured when the audio block is disabled. Sets FRCR register, FSPOL field.

Set Where the signal is in the frame. Sets FRCR register, FDEF field.

Select wheather the master clock is generated. xDR1 register, NOMCK field on H7. on other variants such as WB, affects the MCKEN and NODIV fields (?).

Select Stereo or Mono mode.Sets xCR1 register, MONO field.

Select the number of connected PDM mics. It is possible to select between 2,4,6 or 8 microphones. For example, if the application is using 3 microphones, the user has to select 4. Sets PDMCR register, MICNBR field.

Oversampling ratio for master clock. You may have to choose the one used by your SAI device. Sets xCR1 register, OSR field.

Select the audio protocol to use. xCR1 register, PRTCFG field.

The type of SAI interrupt to configure. Reference Section 41.5 of the L4 RM. Enabled in xIM register, yIE fields. See H743 RM, section 51.5: SAI interrupts.

Select Master or Slave mode. Sets xCR1 register, MODE field.

Specify wheather sub-clocks A and B are synchronized. Sets xCR1 register, SYNCEN field.