596
/
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
Data length is 16 bits, channel length is 32 bits (SPI_I2SCFG.TDATLEN = 00, SPI_I2SCFG.CHBITS = 1),
LSB alignment standard (SPI_I2SCFG.STDSEL = 10).
1.
Wait for the penultimate RNE flag (SPI_STS.RNE) bit to be set to' 1'.
2.
Software delay, waiting for 17 I
2
S clock cycles.
3.
Turn off I
2
S (SPI_I2SCFG.I2SEN = 0).
The data length is 16 bits, the channel length is 32 bits (SPI_I2SCFG.TDATLEN = 00 and
SPI_I2SCFG.CHBITS = 1), the MSB alignment standard (SPI_I2SCFG.STDSEL = 01), I
2
S Philips standard
(SPI_I2SCFG.STDSEL = 00) or PCM standard (SPI_I2SCFG.STDSEL = 11)
1.
Wait for the last RNE flag (SPI_STS.RNE) bit to be set to' 1'.
2.
Software delay, waiting for 1 I
2
S clock cycle.
3.
Turn off I
2
S (SPI_I2SCFG.I2SEN = 0).
Other combinations of SPI_I2SCFG.TDATLEN and SPI_I2SCFG.CHBITS and any audio mode selected by
SPI_I2SCFG.STDSEL:
1.
Wait for the penultimate RNE flag (SPI_STS.RNE) bit to be set to' 1'.
2.
Software delay, waiting for 1 I
2
S clock cycle.
3.
Turn off I
2
S (SPI_I2SCFG.I2SEN = 0).
Slave mode
The receiving process of the slave mode is similar to that of the master mode, with the following differences:
The CHSIDE flag (SPI_STS.CHSIDE) indicates which channel corresponds to the currently transmitted data.
Compared with the master mode receiving process, in the slave mode, SPI_STS.CHSIDE depends on the WS signal
of the external master device. When the I2S function is turned off, clear the SPI_I2SCFG.I2SEN bit to 0 when the
SPI_STS.RNE flag is 1.
21.4.4
Status flag
There are the following 4 flag bits in the SPI_STS register for monitoring the status of the I2S bus.
TX buffer empty flag (TE)
When the send buffer is empty, this flag is set to 1, indicating that new data can be written into the SPI_DAT register.
When the send buffer is not empty, this flag is cleared to 0.
RX buffer not empty flag (RNE)
When the receive buffer is not empty, this flag is set to 1, indicating that valid data has been received into the receive
buffer. When reading the SPI_DAT register, this flag is set to 0.
BUSY flag (BUSY)
When the transfer starts, the BUSY flag (SPI_STS.BUSY) is set to 1, and when the transfer ends, the BUSY flag
(SPI_STS.BUSY) is set to 0 by hardware (software operation is invalid).
In master receiving mode (SPI_I2SCFG.MODCFG = 11), the BUSY flag (SPI_STS.BUSY) is set to 0 during