![ARTERY AT32F435 Series Reference Manual Download Page 235](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592235.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 235
Rev 2.03
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
protocol 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 signal that meets the protocol requirements.
Select audio protocol by setting 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
I2SCBN =0: 16 bit
I2SCBN =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 channel 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.
Philips standard, PCM standard, MSB-aligned or LSB-aligned standard, 32-bit data and 32-bit
channel
The data bit is the same as the channel bit. Each channel requires two read/write operations from/to
the SPI_DT register, and the number of DMA transfer is 2. These 32-bit data are proceeded in two
times, with 16-bit data each time.
LSB-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 16 bits (LSB) are the significant bits
while the first 16-bit data (MSB) are forced to 0 by hardware.
LSB-aligned standard, 24-bit data and 32-bit channel
The data bit is different from the channel bit. Each channel requires two read/write operations from/to
the SPI_DT register, and the number of DMA transfer is 2. For the first 16-bit data, its 8-bit LSB are
the significant bits, with the 8-bit MSB forced to 0 by hardware; the subsequent 16 bits transmit and
receive the second 16-bit data.