Browse Source

Make reading back the written value optional.

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5393 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.2
Jean Delvare 17 years ago
parent
commit
35a929de32
  1. 1
      CHANGES
  2. 6
      tools/i2cset.8
  3. 8
      tools/i2cset.c

1
CHANGES

@ -23,6 +23,7 @@ SVN
Add support for short writes (SMBus send byte)
Better error message on missing adapter functionality
Set the data value mask with -m
Make reading back the written value optional
i2c-stub-from-dump: Add support for partial dumps
Report if only garbage is found in dump file
Behave properly when i2c-stub is already loaded

6
tools/i2cset.8

@ -7,6 +7,7 @@ i2cset \- set I2C registers
.RB [ -f ]
.RB [ -y ]
.RB [ "-m mask" ]
.RB [ -r ]
.I i2cbus
.I chip-address
.I data-address
@ -46,6 +47,11 @@ are taken from \fIvalue\fR, while bits set to 0 will be read from
this parameter assumes that the read and write operations for the specified
mode are symmetrical for the device you are accessing. This may or may not
be the case, as neither I2C nor SMBus guarantees this.
.TP
.B -r
Read back the value right after writing it, and compare the result with the
value written. This used to be the default behavior. The same limitations
apply as those of option \fB-m\fR.
.PP
There are three required options to i2cset. \fIi2cbus\fR indicates the number
or name of the I2C bus to be scanned. This number should correspond to one of

8
tools/i2cset.c

@ -134,7 +134,7 @@ int main(int argc, char *argv[])
char filename[20];
int pec = 0;
int flags = 0;
int force = 0, yes = 0, version = 0;
int force = 0, yes = 0, version = 0, readback = 0;
/* handle (optional) flags first */
while (1+flags < argc && argv[1+flags][0] == '-') {
@ -147,6 +147,7 @@ int main(int argc, char *argv[])
maskp = argv[2+flags];
flags++;
break;
case 'r': readback = 1; break;
default:
fprintf(stderr, "Error: Unsupported option "
"\"%s\"!\n", argv[1+flags]);
@ -308,6 +309,11 @@ int main(int argc, char *argv[])
}
}
if (!readback) { /* We're done */
close(file);
exit(0);
}
switch (size) {
case I2C_SMBUS_BYTE:
/* No readback */

Loading…
Cancel
Save