AT32F425
Series Reference Manual
2022.03.30
Page 179
Ver 2.01
13.3.7 Transmitter/Receiver
Whether being used as SPI or I2S, there is no difference for CPU. The SPI (in whatever mode) shares
the same base address, the same SPI_DT register, the same transmitter and receiver. The SPI
transmitter and receiver is responsible fore sending and receiving the desired data frame according to
the configuration of the communication controller. Thus their status flags such as TDBE, RDBF and
ROERR, and their interrupt enable bits including TDBEIE, RDBFIE and ERRIE are identifical.
Special attention must be paid to:
CRC check is not available on the I
2
S. Any operation linked to CRC, including CCERR flag and
the corresponding interrupts, is not supported.
I
2
S protocol needs decode the current channel status. The ACS bit is used to judge whether the
current transfer occurs on the left channel (ACS=0) or the right channel (ACS=1).
TUERR bit indicates whether an underrun occurs. TUERR=1 means an underrun error occurs on
the transmitter. An interrupt is generated when the ERRIE is set.
Read/write operation to the SPI_DT register is different under different audio protocols, data bits
and channel bits. Refer to the audio protocol selector section for more information.
Pay more attention to the I
2
S disable operation under different configurations, shown as follows:
─
I2SDBN=00, I2SCBN=1, STDSLE=10: wait for the second-to-last RDBF=1 and 17 CK periods
before disabling the I
2
S.
─
I2SDBN=00, I2SCBN=1, STDSLE=00 or STDSLE=01 or STDSLE=11: wait for the last
RDBF=1 and one CK period before the I
2
S.
─
I2SDBN, I2SCBN,STDSLE combination: wait for the second-to-last RDBF=1 and one CK
period before disabling the I
2
S.
I
2
S transmitter configuration procedure:
Configure operation mode selector
Configure audio protocol selector
Configure I2S_SCK controller
Configure DMA transfer (if necessary)
Set the I2SEN bit to enable I
2
S
Follow above steps to configure the I
2
SxEXT (For I
2
S full-duplex mode )
I
2
S receiver configuration procedure:
Configure operation mode selector
Configure audio protocol selector
Configure I2S_SCK controller
Configure DMA transfer (if necessary)
Set the I2SEN bit to enable I
2
S
Follow above steps to configure the I
2
SxEXT (For I
2
S full-duplex mode )
13.3.8 I2S communication timings
I2S can address four different audio standards: Philips standard, the most significant byte (left-aligned)
and the least significant byte (right-aligned) standards, and the PCM standard.
their respective timgins.