GD32F10x User Manual
486
Table 18-2. NSS function in slave mode
Mode
Register configuration
Description
Slave hardware NSS mode
MSTMOD = 0
SWNSSEN = 0
SPI slave gets NSS level from NSS
pin.
Slave software NSS mode
MSTMOD = 0
SWNSSEN = 1
SPI slave NSS level is determined by
the SWNSS bit.
SWNSS = 0: NSS level is low
SWNSS = 1: NSS level is high
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 goes low after SPI is enabled.
The application may also use a general purpose IO as NSS pin to realize more flexible NSS.
Table 18-3. NSS function in master mode
Mode
Register configuration
Description
Master hardware NSS
output mode
MSTMOD = 1
SWNSSEN = 0
NSSDRV=1
Applicable to single-master mode. The
master uses the NSS pin to control the
SPI slave device. At this time, the NSS
is configured as the hardware output
mode. NSS goes low after enabling
SPI.
Master hardware NSS input
mode
MSTMOD = 1
SWNSSEN = 0
NSSDRV=0
Applicable to multi-master mode. At
this time, NSS is configured as
hardware input mode. Once the NSS
pin is pulled low, SPI will automatically
enter slave mode, and a master
configuration error will occur and the
CONFERR bit will be set to 1.
Master software NSS mode
MSTMOD = 1
SWNSSEN = 1
SWNSS = 0
NSSDRV:
Don’t care
Applicable to multi-master mode. Once
SWNSS = 0, SPI will automatically
enter slave mode, and a master
configuration error will occur and the
CONFERR bit will be 1.
MSTMOD = 1
The slave can use hardware or
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...