AT32WB415
Series Reference Manual
2022.04.13
Page 159
Ver 2.00
1: Receive-only mode
Bit 9
SWCSEN
0x0
rw
Software CS enable
When this bit is set, the CS pin level is determined by the
SWCSIL bit. The status of I/O level on the CK pin is invalid.
0: Disabled
1: Enabled
Bit 8
SWCSIL
0x0
rw
Software CS internal level
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
13.3.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 and TUERR)
0: Disabled
1: Enabled
Bit 4: 3
Reserved
0x0
resd
Kept at its default value
Bit 2
HWCSOE
0x0
rw
Hardware CS output enable
This bit is valid only in master mode. When this bit is set,