SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
The protocol of the I2C bus defines two states to begin and end a transaction: Start and Stop. A high-to-low transition on the SDA line while the SCL is high is defined as a Start condition, and a low-to-high transition on the SDA line while the SCL line is high is defined as a Stop condition. The bus is considered busy after a Start condition and free after a Stop condition (see Figure 21-3).
The STOP bit determines if the cycle stops at the end of the data cycle or continues on to a Repeated Start condition. To generate a single transmit cycle, the I2C Controller Target Address I2C.CSA register is written with the desired address, the R/S bit is cleared, and the control register, I2C.CCTL, is written with ACK = X (0 or 1), STOP = 1, START = 1, and RUN = 1 to perform the operation and stop. When the operation is completed (or aborted due an error), the interrupt becomes active and the data is readable from the I2C Controller Data I2C.CDR register. When the I2C module operates in controller receiver mode, the ACK bit is normally set, causing the I2C bus controller to transmit an acknowledge automatically after each byte. When the I2C bus controller requires no further data transmission from the target transmitter, the ACK bit must be cleared.
When operating in target mode, two bits in the I2C Target Raw Interrupt Status I2C:TRIS register indicate detection of Start and Stop conditions on the bus, while two bits in the I2C Target Masked Interrupt Status I2C:TMIS register allow promotion of Start and Stop conditions to controller interrupts (when interrupts are enabled).