wire / wire-format / i2c-protocol
I2C is a two-wire serial bus (SDA data, SCL clock) for connecting low-speed peripherals. Communication: START condition (SDA high->low while SCL high), 7-bit (or 10-bit) address + R/W bit, ACK/NACK, data bytes, STOP condition (SDA low->high while SCL high). Clock stretching allows slaves to slow down the master.
aka: I2C (Inter-Integrated Circuit) protocol
spec: I2C specification (NXP)
I2C is a two-wire serial bus (SDA data, SCL clock) for connecting low-speed peripherals. Communication: START condition (SDA high->low while SCL high), 7-bit (or 10-bit) address + R/W bit, ACK/NACK, data bytes, STOP condition (SDA low->high while SCL high). Clock stretching allows slaves to slow down the master.
| field | size | meaning |
|---|---|---|
| START | 1 condition | SDA transitions high->low while SCL is high. Signals the beginning of a transaction. |
| Address + R/W | 1 byte (7-bit addr + 1 bit R/W) | 7-bit slave address (bits 7-1) + read/write bit (bit 0: 0=write, 1=read). |
| ACK | 1 bit | Receiver pulls SDA low during the 9th clock pulse to acknowledge. |
| NACK | 1 bit | Receiver leaves SDA high during the 9th clock pulse (no device at address, or end of read). |
| Data byte | 8 bits | Data byte, MSB first. Followed by ACK/NACK. |
| STOP | 1 condition | SDA transitions low->high while SCL is high. Signals the end of a transaction. |
| Repeated START | 1 condition | START without a preceding STOP. Used to change direction (write then read) without releasing the bus. |
| 10-bit address | 2 bytes | 10-bit addressing: first byte = 11110XX0 (where XX are the top 2 bits of the address), then the low 8 bits. |
example:
08 00 00
I2C: START, address 0x04 (write), ACK, STOP
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/i2c-protocol
or /wire-format/i2c-protocol.json