AT32F425
Series Reference Manual
2022.03.30
Page 176
Ver 2.01
Figure 13-21 I
2
S master device reception
I2S master
CK
SD
WS
I2S slave
CK
SD
WS
13.3.4 Audio protocol selector
While being used as I
2
S, the SPI supports multiple audio protocols. The user can control the audio protol
selector through software configuration to select the desired audio protocol, with the data bits and
channel bits being controlled by the audio protocol selector. Besides, the user can also select the data
bits and channel bits through software configuration. Meanwhile, the audio protocol selector manages
the WS controller, output or detect the WS siganal that meets the protocol requirements.
Select audio protocol by seeting the STDSEL bit
STDSLE=00: Philips standard
STDSLE=01: MSB-aligned standard (left-aligned)
STDSLE=10: LSB-aligned standard (right-aligned)
STDSLE=11: PCM standard
Select PCM frame synchronization format: PCMFSSEL=1 for PCM long frame synchronization,
PCMFSSEL=0 for short frame synchronization (this step is required when selecting PCM protocol)
Select data bits by setting the I2SDBN bit
I2SDBN=00: 16 bit
I2SDBN =01: 24 bit
I2SDBN =10: 32 bit
Select channel bits by setting the I2SCBN bit
I2SDBN =0: 16 bit
I2SDBN =1: 32 bit
Note: Read/Write operation mode depends on the selected audio protocols, data bits and channel bits.
The following lists all possible configuration combinations and their respective read and write operation
mode.
Philips standard, PCM standard, MSB-aligned or LSB-aligned standard, 16-bit data and 16-bit
channel
The data bit is the same as the channel bit. Each channel requires one read/write operation from/ to
the SPI_DT register, and the number of DMA transfer is 1.
Philips standard, PCM standard or MSB-aligned standard, 16-bit data and 32-bit channel
The data bit is different from the channel bit. Each channel requires one read/write operation from/to
the SPI_DT register, and the number of DMA transfer is 1. The first 16 bits (MSB) are the significant
bits, and the 16-bit LSB is forced to 0 by hardware.
Philips standard, PCM standard or MSB-aligned standard, 24-bit data and 32-bit channel
The data bit is different from the channgle bit. Each channel requires two read/write operations
from/to the SPI_DT register, and the number of DMA transfer is 2. The 16-bit MSB transmits and
receives the first 16-bit data, the 16-bit LSB transmits and receives the 8-bit MSB data, with 8-bit LSB
data being forced to 0 by hardware.