AT32WB415
Series Reference Manual
2022.04.13
Page 158
Ver 2.00
13.2.11 IO pin control
Usually, the SPI is connected to external devices through four pins.
MISO: Master In/Slave Out. The pin receives data in master mode, and transmits data in slave
mode.
MOSI: Master Out/Slave In. The pin transmits data in master mode, and receives data in slave
mode.
SCK: SPI communication clock. The pin serves as output in master mode, and input in slave
mode.
CS: Chip Select. This is an optional pin which selects master/slave mode.
13.2.12 Precautions
CRC value is obtained by software reading DT register at the end of CRC reception
13.3 SPI registers
These peripheral registers must be accessed by half-word (16 bits) or word (32 bits).
Table 13-1
SPI register map and reset value
Register
Offset
Reset value
SPI_CTRL1
0x00
0x0000
SPI_CTRL2
0x04
0x0000
SPI_STS
0x08
0x0002
SPI_DT
0x0C
0x0000
SPI_CPOLY
0x10
0x0007
SPI_RCRC
0x14
0x0000
SPI_TCRC
0x18
0x0000
13.3.1 SPI control register1 (SPI_CTRL1)
Bit
Register
Reset value
Type
Description
Bit 15
SLBEN
0x0
rw
Single line bidirectional half-duplex enable
0: Disabled
1: Enabled
Bit 14
SLBTD
0x0
rw
Single line bidirectional half-duplex transmission direction
This bit and the SLBEN bit together determine the data
output direction in “Single line bidirectional half-duplex”
mode.
0: Receive-only mode
1: Transmit-only mode
Bit 13
CCEN
0x0
rw
RC calculation enable
0: Disabled
1: Enabled
Bit 12
NTC
0x0
rw
Transmit CRC next
When this bit is set, it indicates that the next data
transferred is CRC value.
0: Next transmitted data is the normal value
1: Next transmitted data is CRC value
Bit 11
FBN
0x0
rw
Frame bit num
This bit is used to configure the number of data frame bit
for transmission/reception.
0: 8-bit data frame
1: 16-bit data frame
Bit 10
ORA
0x0
rw
Receive-only active
In two-wire unidirectional mode, when this bit is set, it
indicates that Receive-only is active, but the transmit is not
allowed.
0: Transmission and reception