Skip to content

Commit f45dac0

Browse files
committed
described i2c split transactions better
1 parent e5c911b commit f45dac0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mdbook/src/12-i2c/the-general-protocol.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ Many I2C targets are organized internally as having "device registers", each wit
3939
and 8-bit contents. Typically, device registers are written with a two-byte write: the first byte is
4040
the register address and the second the new register value.
4141

42-
A so-called "combined" or "split" transaction might consist of a write to the target followed by an
43-
immediate read back from the target, as shown in the diagram above. Typically, device registers are
44-
read in this way: the device register address is written and then the current device register value
45-
is immediately read back.
42+
A so-called "combined" or "split" transaction consists of a write to the target followed by an
43+
immediate read back from the target. The write and read-back can be done as a single thing without
44+
releasing the bus: instead of sending a STOP at the end of the write, the read is just started
45+
directly. Typically, device registers are read in this way: the device register address is written
46+
and then the current device register value is immediately read back.
4647

4748
Some I2C targets can read and write multiple device registers with adjacent addresses through some
4849
form of "address auto-increment", which permits sending just the first device register address and
49-
then relying on the device to increment the address for subsequent reads or writes.
50+
then relying on the device to increment the address for subsequent reads or writes. This is common
51+
in the case where adjacent byte registers are to be treated as a 16-bit value.
5052

5153
I2C is a complex protocol, and there are many variations and special features out there. Read the
5254
manual for your target carefully to see what needs to be done to talk to it.

0 commit comments

Comments
 (0)