EasyManua.ls Logo

GigaDevice Semiconductor GD32F3x0 - Page 526

Default Icon
665 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
GD32F3x0 User Manual
526
20.3.8. SPI interrupts
Status flags
Transmission buffer empty flag (TBE)
This bit is set when the transmission buffer is empty, the software can write the next data to
the transmission buffer by writing the SPI_DATA register.
Reception buffer not empty flag (RBNE)
This bit is set when reception buffer is not empty, which means that one data is received and
stored in the reception buffer, and software can read the data by reading the SPI_DATA
register.
SPI transmitting ongoing flag (TRANS)
TRANS is a status flag to indicate whether the transfer is ongoing or not. It is set and cleared
by hardware and not controlled by software. This flag doesn’t generate any interrupt.
Error flags
Configuration fault error (CONFERR)
CONFERR is an error flag in master mode. In NSS hardware mode and the NSSDRV is not
enabled, the CONFERR is set when the NSS pin is pulled low. In NSS software mode, the
CONFERR is set when the SWNSS bit is 0. When the CONFERR is set, the SPIEN bit and
the MSTMOD bit are cleared by hardware, the SPI is disabled and the device is forced into
slave mode.
The SPIEN and MSTMOD bit are write protection until the CONFERR is cleared. The
CONFERR bit of the slave cannot be set. In a multi-master configuration, the device can be
in slave mode with CONFERR bit set, which means there might have been a multi-master
conflict for system control.
Rx overrun error (RXORERR)
The RXORERR bit is set if a data is received when the RBNE is set. That means the last
data has not been read out and the newly incoming data is received. The reception buffer
contents won’t be covered with the newly incoming data, so the newly incoming data is lost.
Format error (FERR)
In slave TI mode, the slave also monitors the NSS signal and set an error flag if it detects an
incorrect NSS behavior, for example: toggles at the middle bit of a byte.
CRC error (CRCERR)
When the CRCEN bit is set, the CRC calculation result of the received data in the
SPI_RCRC register is compared with the received CRC value after the last data, the

Table of Contents