Reference Manual
I2C - Inter-Integrated Circuit Interface
17.3.6.2 Receive Buffer and Shift Register
2
The I
C receiver uses a 2-level FIFO receive buffer and a receive shift register as shown in
Figure 17.14 I2C Receive Buffer Operation
on page
486. When a byte has been fully received by the receive shift register, it is loaded into the receive buffer if there is room for it,
making the shift register empty to receive another byte. Otherwise, the byte waits in the shift register until space becomes available in
the buffer.
Peripheral bus
RXDATA
RX buffer element 0
RXDOUBLE
RX buffer element 1
Shift register
Figure 17.14. I2C Receive Buffer Operation
When a byte becomes available in the receive buffer, the RXDATAV in I2Cn_STATUS and RXDATAV interrupt flag in I2Cn_IF are set.
When the buffer becomes full, RXFULL in the I2Cn_STATUS and I2Cn_IF are set. The status flags RXDATAV and RXFULL are auto-
matically cleared by hardware when their condition is no longer true. This also goes for the RXDATAV interrupt flag, but the RXFULL
interrupt flag must be cleared by software. When the RXFULL flag is set, notifying that the buffer is full, space is still available in the
receive shift register for one more byte.
The data can be fetched from the buffer in two ways. I2Cn_RXDATA gives access to the received byte (if two bytes are received then
the one received first is fetched first). I2Cn_RXDOUBLE makes it possible to read the two received bytes simultaneously. If an attempt
is made to read more bytes from the buffer than available, the RXUF interrupt flag in I2Cn_IF is set to signal the underflow, and the data
read from the buffer is undefined.
When using I2Cn_RXDOUBLE to pick data, AUTOACK in I2Cn_CTRL should be set to 1. This ensures that an ACK is automatically
sent out after the first byte is received so that the reception of the next byte can begin. In order to stop receiving data bytes, a NACK
must be sent out through the I2Cn_CMD register.
I2Cn_RXDATAP and I2Cn_RXDOUBLEP can be used to read data from the receive buffer without removing it from the buffer. The
RXUF interrupt flag in I2Cn_IF will never be set as a result of reading from I2Cn_RXDATAP and I2Cn_RXDOUBLEP, but the data read
through I2Cn_RXDATAP when the receive buffer is empty is still undefined.
Once a transaction is complete (STOP sent or received), the receive buffer needs to be flushed (all received data must be read) before
starting a new transaction.
silabs.com | Building a more connected world.
Rev. 1.1 | 486
Need help?
Do you have a question about the EFR32xG14 Wireless Gecko and is the answer not in the manual?