
AT32F421
Series Reference Manual
2022.11.11
Page 158
Rev 2.02
13.2.11 IO pin control
When used as SPI, the SPI interface is connected to peripherals through up to four pins. Refer to Section
13.2.2 and Section 13.2.3 for more information on the usage of pins.
MISO: Master In/Slave Out. The pin receives data in SPI master mode, and transmits data in SPI
slave mode.
MOSI: Master Out/Slave In. The pin transmits data in SPI master mode, and receives data in SPI
slave mode.
SCK: SPI communication clock pin. In SPI master mode, the pin outputs the communication
clock to peripherals. In SPI slave mode, the pin inputs the communication clock to SPI interface.
CS: Chip Select. This is an optional pin which selects master/slave device. Refer to 13.2.3 for
more information.
Note: PA13/14 can be used SWDI and SWCK, or as SPI2 MISO/MOSI. Therefore, when one wants to
use PA13/14 as SPI2, it is necessary to insert a delay for code download prior to GPIO remap.
13.2.12 Precautions
CRC value is obtained by software reading DT register at the end of CRC reception
13.3 I2S functional description
13.3.1 I
2
S introduction
The I
2
S can be configured by software as master reception/transmission, and slave
reception/transmission, supporting four kinds of audio protocols including Philips standard, MSB-aligned
standard, LSB-aligned standard and PCM standard, respectively. The DMA transfer is also supported.
Figure 13-13 I
2
S block diagram
I2S_CLK controller
SPI_STS
BF
ROE
RR
MME
RR
CCE
RR
TUER
R
ACS
TDBE RDBF
Communication controller
WS
controller
I2SCLKPOL
I2SDIV[9:0]
I2SMCLKOE
I2SODD
Transmitter logic
SD
CK
WS
Receiver logic
Receive & transmit date
shift logic
Interrupt generator
ERRIE TEIE RNEIE
MCK
Audio
protocol
selector
PCMFSSEL
STDSEL
I2SDBN
I2SCBN
Operation selector
OPERSEL[1:0]
Main features when the SPI is used as I
2
S:
Programmable operation mode
─
Slave device transmission
─
Slave device reception