18.2.4 Transactions

The I2C standard defines three fundamental transaction formats:
  • Master Write
    • The master transmits data packets to the slave after addressing it

  • Master Read
    • The slave transmits data packets to the master after being addressed

  • Combined Read/Write
    • A combined transaction consists of several write and read transactions

A data transfer starts with the master issuing a Start condition on the bus, followed by the address of the slave together with a bit to indicate whether the master wants to read from or write to the slave. The addressed slave must respond to this by sending an ACK back to the master.

After this, data packets are sent from the master or slave, according to the read/write bit. Each packet must be acknowledged (ACK) or not acknowledged (NACK) by the receiver.

If a slave responds with a NACK, the master must assume that the slave cannot receive any more data and cancel the write operation.

The master completes a transaction by issuing a Stop condition.

A master can issue multiple Start conditions during a transaction; this is then called a Repeated Start condition.