
AT32F413
Series Reference Manual
2022.06.27
Page 178
Rev 2.00
This bit is valid only when the SWCSEN is set. It
determines the level on the CS pin.
In master mode, this bit must be set.
0: Low level
1: High level
Bit 7
LTF
0x0
rw
LSB transmit first
This bit is used to select for MST transfer first or LSB
transfer first.
0: MSB
1: LSB
Bit 6
SPIEN
0x0
rw
SPI enable
0: Disabled
1: Enabled
Bit 5: 3
MDIV
0x0
rw
Master clock frequency division
In master mode, the peripheral clock divided by the
prescaler is used as SPI clock. The MDIV[3] bit is in the
SPI_CTRL2 register, MDIV[3: 0]:
0000: Divided by 2
0001: Divided by 4
0010: Divided by 8
0011: Divided by 16
0100: Divided by 32
0101: Divided by 64
0110: Divided by 128
0111: Divided by 256
1000: Divided by 512
1001: Divided by 1024
Bit 2
MSTEN
0x0
rw
Master enable
0: Disabled (Slave)
1: Enabled (Master)
Bit 1
CLKPOL
0x0
rw
Clock polarity
Indicates the polarity of clock output in idle state.
0: Low level
1: High level
Bit 0
CLKPHA
0x0
rw
Clock phase
0: Data capture starts from the first clock edge
1: Data capture starts from the second clock edge
Note: The SPI_CTRL1 register must be 0 in I
2
S mode.
13.4.2 SPI control register2 (SPI_CTRL2)
Bit
Register
Reset value
Type
Description
Bit 15: 9
Reserved
0x00
resd
Forced to be 0 by hardware.
Bit 8
MDIV
0x0
rw
Master clock frequency division
Refer to the MDIV[2: 0] of the SPI_CTRL1 register.
Bit 7
TDBEIE
0x0
rw
Transmit data buffer empty interrupt enable
0: Disabled
1: Enabled
Bit 6
RDBFIE
0x0
rw
Receive data buffer full interrupt enable
0: Disabled
1: Enabled
Bit 5
ERRIE
0x0
rw
Error interrupt enable
This bit controls interrupt generation when errors occur
(CCERR, MMERR, ROERR, TUERR and CSPAS)
0: Disabled