aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2021-07-13 10:16:28 +0200
committerJean Delvare <jdelvare@suse.de>2021-07-13 10:16:28 +0200
commitffa5241e2684d2ef49e1140043a558b5aa821f99 (patch)
tree71e94728689e75f89a3012320b046a3535272c95
parenta7ec4b6b2087bc5866d77c04765de6794a4bcfa9 (diff)
downloadi2c-tools-ffa5241e2684d2ef49e1140043a558b5aa821f99.tar.gz
i2cget: Document the support of I2C block read
Mention I2C block read support in the i2cget(8) manual page, together with an example. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
-rw-r--r--tools/i2cget.824
1 files changed, 19 insertions, 5 deletions
diff --git a/tools/i2cget.8 b/tools/i2cget.8
index da17ed4..e0b8644 100644
--- a/tools/i2cget.8
+++ b/tools/i2cget.8
@@ -1,4 +1,4 @@
-.TH I2CGET 8 "October 2017"
+.TH I2CGET 8 "July 2021"
.SH "NAME"
i2cget \- read from I2C/SMBus chip registers
@@ -9,7 +9,7 @@ i2cget \- read from I2C/SMBus chip registers
.RB [ -a ]
.I i2cbus
.I chip-address
-.RI [ "data-address " [ mode ]]
+.RI [ "data-address " [ "mode " [ length ]]]
.br
.B i2cget
.B -V
@@ -49,12 +49,18 @@ an integer between 0x00 and 0xFF. If omitted, the currently active register
will be read (if that makes sense for the considered chip).
.PP
The \fImode\fR parameter, if specified, is one of the letters \fBb\fP,
-\fBw\fP or \fBc\fP, corresponding to a read byte data, a read word data or a
-write byte/read byte transaction, respectively. A \fBp\fP can also be appended
-to the \fImode\fR parameter to enable PEC. If the \fImode\fR parameter is omitted,
+\fBw\fP, \fBc\fP, or \fBi\fP, corresponding to a read byte data, a read
+word data, a write byte/read byte, or an I2C block read transaction,
+respectively. A \fBp\fP can also be appended to the \fImode\fR parameter to
+enable PEC, except for I2C block transactions. If the \fImode\fR
+parameter is omitted,
i2cget defaults to a read byte data transaction, unless \fIdata-address\fR is
also omitted, in which case the default (and only valid) transaction is a
single read byte.
+.PP
+The \fIlength\fR parameter, if applicable and specified, sets the length
+of the block transaction. Valid values are between 1 and 32. Default value
+is 32.
.SH WARNING
i2cget can be extremely dangerous if used improperly. I2C and SMBus are designed
@@ -112,6 +118,14 @@ concerns raised above still stand, however in this case there is no SMBus
equivalent, so this is the only way to read data from a large EEPROM if your
master isn't fully I2C capable. With a fully I2C capable master, you would
use \fIi2ctransfer\fR to achieve the same in a safe and faster way.
+.PP
+Read the first 8 bytes of an EEPROM device at 7-bit address 0x50
+on bus 4 (i2c-4):
+.nf
+.RS
+# i2cget -y 4 0x50 0x00 i 8
+.RE
+.fi
.SH BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list