
GD32F403xx User Manual
485
I2S slave reception sequence
The reception sequence in slave mode is similar to that in master mode. The difference
between them is described below.
In slave mode, the slave has to be enabled before the external master starts the
communication. The reception sequence begins when the external master sends the clock
and when the I2S_WS signal indicates a start of the data transfer. In slave mode, I 2SCH is
sensitive to the I2S_WS signal coming from the external master.
In order to switch off I2S, it is mandatory to clear the I2SEN bit immediately after receiving
the last RBNE.
19.4.6.
DMA function
DMA function is the same as SPI mode. The only difference is that the CRC function is not
available in I2S mode.
19.4.7.
I2S interrupts
Status flags
There are four status flags implemented in the SPI_STAT register, including TBE, RBNE,
TRANS and I2SCH. The user can use them to fully monitor the state of the I2S bus.
◼
Transmit buffer empty flag (TBE)
This bit is set when the transmit buffer is empty, the software can write the next data to the
transmit buffer by writing the SPI_DATA register.
◼
Receive buffer not empty flag (RBNE)
This bit is set when receive buffer is not empty, which means that one data is received and
stored in the receive buffer, and software can read the data by reading the SPI_DATA register.
◼
I2S Transmitting On-Going flag (TRANS)
TRANS is a status flag to indicate whether the transfer is on-going or not. It is set and cleared
by internal hardware and not controlled by software. This flag doesn’t generate any interrupt.
◼
I2S channel side flag (I2SCH)
This flag indicates the channel side information of the current transfer and has no meaning in
PCM mode. It is updated when TBE rises in transmission mode or RBNE rises in reception
mode. This flag doesn’t generate any interrupt.
Error conditions
There are three error conditions:
◼
Transmission Underrun Error Flag (TXURERR)