GD32W51x User Manual
674
NSS mode (SWNSSEN = 0) or from SWNSS bit in software NSS mode (SWNSSEN = 1), and
SPI transmits/receives data only when NSS level is low. In software NSS mode, NSS pin is
not used.
Master mode
In master mode (MSTMOD=1), if the application uses multi-master connection, NSS can be
configured to hardware input mode (SWNSSEN=0, NSSDRV=0) or software mode
(SWNSSEN=1). Then, once the NSS pin (in hardware NSS mode) or the SWNSS bit (in
software NSS mode) goes low, the SPI automatically enters slave mode and triggers a master
fault flag CONFERR.
If the application wants to use NSS line to control the SPI slave, NSS should be configured
to hardware output mode (SWNSSEN=0, NSSDRV=1). NSS stays high after SPI is enabled
and goes low when transmission or reception process begins. When SPI is disabled, the NSS
goes high.
The application may also use a general purpose IO as NSS pin to realize more flexible NSS.
20.5.3.
SPI operating modes
Table 20-3. SPI operating modes
Mode
Description
Register configuration
Data pin usage
MFD
Master full-duplex
MSTMOD = 1
RO = 0
BDEN = 0
BDOEN
: Don’t care
MOSI: Transmission
MISO: Reception
MTU
Master transmission w ith
unidirectional connection
MSTMOD = 1
RO = 0
BDEN = 0
BDOEN
: Don’t care
MOSI: Transmission
MISO: Not used
MRU
Master reception w ith
unidirectional connection
MSTMOD = 1
RO = 1
BDEN = 0
BDOEN
: Don’t care
MOSI: Not used
MISO: Reception
MTB
Master transmission w ith
bidirectional connection
MSTMOD = 1
RO = 0
BDEN = 1
BDOEN = 1
MOSI: Transmission
MISO: Not used
MRB
Master reception w ith
bidirectional connection
MSTMOD = 1
RO = 0
BDEN = 1
BDOEN = 0
MOSI: Reception
MISO: Not used