GD32W51x User Manual
698
20.10.
I2S interrupts
20.10.1.
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 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 will not 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 will not generate any interrupt.
20.10.2.
Error flags
There are three error flags:
Transmission underrun error flag (TXURERR)
This situation occurs when the transmit buffer is empty if the valid SCK signal starts in slave
transmission mode.
Reception overrun error flag (RXORERR)
This situation occurs when the receive buffer is full and a newly incoming data has been
completely received. When overrun occurs, the data in receive buffer is not updated and the
newly incoming data is lost.
Format Error (FERR)
In slave I2S mode, the I2S monitors the I2S_WS signal and an error flag will be set if I2S_WS
toggles at an unexpected position.
I2S interrupt events and corresponding enable bits are summed up in the