RM0090
Whatever the data length or the channel length, the audio data are received by 16-bit
packets. This means that each time the RX buffer is full, the RXNE flag in the SPI_SR
register is set and an interrupt is generated if the RXNEIE bit is set in the SPI_CR2 register.
Depending on the data length and channel length configuration, the audio value received for
a right or left channel may result from one or two receptions into the RX buffer.
The CHSIDE flag is updated each time data are received to be read from SPI_DR. It is
sensitive to the external WS line managed by the external master component.
Clearing the RXNE bit is performed by reading the SPI_DR register.
For more details about the read operations depending the I
to
Section 28.4.3: Supported audio
If data are received while the precedent received data have not yet been read, an overrun is
generated and the OVR flag is set. If the bit ERRIE is set in the SPI_CR2 register, an
interrupt is generated to indicate the error.
To switch off the I
the last RXNE = 1.
Note:
The external master components should have the capability of sending/receiving data in 16-
bit or 32-bit packets via an audio channel.
28.4.7
Status flags
Three status flags are provided for the application to fully monitor the state of the I
Busy flag (BSY)
The BSY flag is set and cleared by hardware (writing to this flag has no effect). It indicates
the state of the communication layer of the I
When BSY is set, it indicates that the I
master receive mode (I2SCFG = 11) where the BSY flag is kept low during reception.
The BSY flag is useful to detect the end of a transfer if the software needs to disable the I
This avoids corrupting the last transfer. For this, the procedure described below must be
strictly respected.
The BSY flag is set when a transfer starts, except when the I
The BSY flag is cleared:
•
when a transfer completes (except in master transmit mode, in which the
communication is supposed to be continuous)
•
when the I
When communication is continuous:
•
In master transmit mode, the BSY flag is kept high during all the transfers
•
In slave mode, the BSY flag goes low for one I
Note:
Do not use the BSY flag to handle each data transmission or reception. It is better to use the
TXE and RXNE flags instead.
protocols.
2
S in reception mode, I2SE has to be cleared immediately after receiving
2
S is disabled
RM0090 Rev 18
Serial peripheral interface (SPI)
2
S standard mode selected, refer
2
S.
2
S is busy communicating. There is one exception in
2
S clock cycle between each transfer
2
2
S is in master receiver mode.
S bus.
2
S.
913/1749
925
Need help?
Do you have a question about the STM32F405 and is the answer not in the manual?
Questions and answers