LS_I2C controller
RM0082
612/844
Doc ID 018672 Rev 1
continuously; that is, when the FIFO begins to fill, another DMA transfer is requested.
Otherwise, the FIFO will fill with data (overflow). To prevent this condition, the user
must correctly set the watermark level."
Choosing the receive watermark level
Similar to choosing the transmit watermark level described earlier, the receive watermark
level should be set to minimize the probability of overflow. It is a trade-off between the
number of DMA burst transactions required per block versus the probability of an overflow
occurring.
28.4 Operation
modes
The I
2
C interface protocol is setup with a master and a slave. The master is responsible for
generating the clock and controlling the transfer of data. The slave is responsible for either
transmitting or receiving data to/from the master. The acknowledgement of data is sent by
the device that is receiving data, which can be either the master or the slave. The protocol
also allows multiple masters to reside on the I
2
C bus, which requires the masters to arbitrate
for ownership.
According to this specification, the I
2
C controller provided by the device supports three
distinct operation modes, specifically:
●
Slave mode (
Section 28.4.1: Slave mode on page 612
●
Master mode (
).
●
Multi-master mode (
28.4.1 Slave
mode
This section provides information on the slave mode of operation.
Initial configuration
In order to use the I
2
C controller as a slave, the following steps have to be performed:
●
Disable the I
2
C controller by writing a ‘b0 to the IC_ENABLE register (
●
Write to the IC_SAR register (
) to set the slave address (only required if
the slave address to be programmed is other than 0x0055). This is the address to
which the I
2
C controller responds,
●
Write to the IC_CON register (
) to specify whether 10 bit addressing is
supported (through IC_10BITADDR_SLAVE bit) and whether the I
2
C controller is in
slave-only or master-slave mode. The master-only mode is not valid in slave mode,
●
Then, enable the I
2
C controller setting the IC_ENABLE register (
).