597
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
receiving. When the I2S module is turned off or the transmission is completed, this flag is set to 0.
In the slave continuous communication mode, between each data item transmission, the BUSY flag (SPI_STS.BUSY)
goes low in 1 I2S clock cycle. Therefore, do not use the BUSY flag(SPI_STS.BUSY) to handle the sending and
receiving of each data item.
Channel Side flag (CHSIDE)
The CHSIDE (SPI_STS.CHSIDE) bit is used to indicate the channel where the data currently sent and received is
located. Under the PCM standard, this flag has no meaning.
In send mode, the flag is updated when the TE flag (SPI_STS.TE) is set; in receive mode, the flag is updated when
the RNE flag (SPI_STS.RNE) is set. In the process of sending and receiving, if an overflow (SPI_STS.OVER) or
underflow (SPI_STS.UNDER) error occurs, this flag is meaningless, and the I2S needs to be turned off and then
turned on again.
21.4.5
Error flag
The SPI_STS register has 2 error flag bits.
Overflow flag (OVER)
When the RNE flag (SPI_STS.RNE) is set to 1, but there is still data sent to the receive buffer, an overflow error will
occur. At this time, the OVER flag (SPI_STS.OVER) is set to 1. An interrupt will be generated if the user enables
the corresponding interrupt. All data received after this time will be lost, and the SPI_DAT register only retains the
previously unread data.Reading the SPI_DAT register and the SPI_STS register in turn to clear the SPI_STS.OVER
bit.
Underflow flag (UNDER)
In slave send mode, when the first clock edge of sending data arrives, if the send buffer is still empty, the UNDER
flag (SPI_STS.UNDER) is set to 1. An interrupt will be generated if the user enables the corresponding interrupt.
Reading the SPI_STS register to clears the SPI_STS.UNDER bit.
21.4.6
I
2
S interrupt
The following table lists all I
2
S interrupts.
Table 21-3 I
2
S interrupt request
Interrupt event
Event flag bit
Enable control bit
Send buffer empty flag
TE
TEINTEN
Receive buffer non empty flag
RNE
RNEINTEN
Underflow flag bit
UNDER
ERRINTEN
Overflow flag bit
OVER
21.4.7
DMA function
Working in I2S mode, it does not need data transmission protection function, so it does not need to support CRC,
other DMA functions are the same as SPI mode.