Commit 9f02fba8 authored by Wolfram Sang's avatar Wolfram Sang

Documentation: i2c: improve section about flags mangling the protocol

Sort the entries alphabetically. Make the introductory paragraph more
precise. Skip useless 'Flag' introduction from the entries. Remove
trailing white spaces from the file. Add missing I2C_M_STOP entry.
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent cf23e335
...@@ -6,8 +6,8 @@ Key to symbols ...@@ -6,8 +6,8 @@ Key to symbols
S (1 bit) : Start bit S (1 bit) : Start bit
P (1 bit) : Stop bit P (1 bit) : Stop bit
Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0.
A, NA (1 bit) : Accept and reverse accept bit. A, NA (1 bit) : Accept and reverse accept bit.
Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to
get a 10 bit I2C address. get a 10 bit I2C address.
Comm (8 bits): Command byte, a data byte which often selects a register on Comm (8 bits): Command byte, a data byte which often selects a register on
the device. the device.
...@@ -49,11 +49,20 @@ a byte read, followed by a byte write: ...@@ -49,11 +49,20 @@ a byte read, followed by a byte write:
Modified transactions Modified transactions
===================== =====================
The following modifications to the I2C protocol can also be generated, The following modifications to the I2C protocol can also be generated by
with the exception of I2C_M_NOSTART these are usually only needed to setting these flags for i2c messages. With the exception of I2C_M_NOSTART, they
work around device issues: are usually only needed to work around device issues:
Flag I2C_M_NOSTART: I2C_M_IGNORE_NAK:
Normally message is interrupted immediately if there is [NA] from the
client. Setting this flag treats any [NA] as [A], and all of
message is sent.
These messages may still fail to SCL lo->hi timeout.
I2C_M_NO_RD_ACK:
In a read message, master A/NA bit is skipped.
I2C_M_NOSTART:
In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some
point. For example, setting I2C_M_NOSTART on the second partial message point. For example, setting I2C_M_NOSTART on the second partial message
generates something like: generates something like:
...@@ -67,17 +76,13 @@ work around device issues: ...@@ -67,17 +76,13 @@ work around device issues:
I2C device but may also be used between direction changes by some I2C device but may also be used between direction changes by some
rare devices. rare devices.
Flags I2C_M_REV_DIR_ADDR I2C_M_REV_DIR_ADDR:
This toggles the Rd/Wr flag. That is, if you want to do a write, but This toggles the Rd/Wr flag. That is, if you want to do a write, but
need to emit an Rd instead of a Wr, or vice versa, you set this need to emit an Rd instead of a Wr, or vice versa, you set this
flag. For example: flag. For example:
S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P
Flags I2C_M_IGNORE_NAK I2C_M_STOP:
Normally message is interrupted immediately if there is [NA] from the Force a stop condition (P) after the message. Some I2C related protocols
client. Setting this flag treats any [NA] as [A], and all of like SCCB require that. Normally, you really don't want to get interrupted
message is sent. between the messages of one transfer.
These messages may still fail to SCL lo->hi timeout.
Flags I2C_M_NO_RD_ACK
In a read message, master A/NA bit is skipped.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment