root/i2c-tools/trunk/tools/i2cset.8

Revision 5393, 3.4 kB (checked in by khali, 2 weeks ago)

Make reading back the written value optional.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 .TH I2CSET 8 "November 2008"
2 .SH "NAME"
3 i2cset \- set I2C registers
4
5 .SH SYNOPSIS
6 .B i2cset
7 .RB [ -f ]
8 .RB [ -y ]
9 .RB [ "-m mask" ]
10 .RB [ -r ]
11 .I i2cbus
12 .I chip-address
13 .I data-address
14 .RI [ "value " [ "mode" ]]
15 .br
16 .B i2cset
17 .B -V
18
19 .SH DESCRIPTION
20 i2cset is a small helper program to set registers visible through the I2C
21 bus.
22
23 .SH OPTIONS
24 .TP
25 .B -V
26 Display the version and exit.
27 .TP
28 .B -f
29 Force access to the device even if it is already busy. By default, i2cset
30 will refuse to access a device which is already under the control of a
31 kernel driver. Using this flag is dangerous, it can seriously confuse the
32 kernel driver in question. It can also cause i2cset to silently write to
33 the wrong register. So use at your own risk and only if you know what
34 you're doing.
35 .TP
36 .B -y
37 Disable interactive mode. By default, i2cset will wait for a confirmation
38 from the user before messing with the I2C bus. When this flag is used, it
39 will perform the operation directly. This is mainly meant to be used in
40 scripts.
41 .TP
42 .B -m mask
43 The \fImask\fR parameter, if specified, describes which bits of \fIvalue\fR
44 will be actually written to \fIdata-address\fR. Bits set to 1 in the mask
45 are taken from \fIvalue\fR, while bits set to 0 will be read from
46 \fIdata-address\fR and thus preserved by the operation. Please note that
47 this parameter assumes that the read and write operations for the specified
48 mode are symmetrical for the device you are accessing. This may or may not
49 be the case, as neither I2C nor SMBus guarantees this.
50 .TP
51 .B -r
52 Read back the value right after writing it, and compare the result with the
53 value written. This used to be the default behavior. The same limitations
54 apply as those of option \fB-m\fR.
55 .PP
56 There are three required options to i2cset. \fIi2cbus\fR indicates the number
57 or name of the I2C bus to be scanned.  This number should correspond to one of
58 the busses listed by \fIi2cdetect -l\fR. \fIchip-address\fR specifies the
59 address of the chip on that bus, and is an integer between 0x03 and 0x77.
60 \fIdata-address\fR specifies the address on that chip to write to, and is an
61 integer between 0x00 and 0xFF.
62 .PP
63 The \fIvalue\fR parameter, if specified, is the value to write to that
64 location on the chip. If this parameter is omited, then a short write is
65 issued. For most chips, it simply sets an internal pointer to the target
66 location, but doesn't actually write to that location. For a few chips
67 though, in particular simple ones with a single register, this short write
68 is an actual write.
69 .PP
70 The \fImode\fR parameter, if specified, is one of the letters \fBb\fP or
71 \fBw\fP, corresponding to a write size of a single byte or a 16-bit word,
72 respectively. A \fBp\fP can also be appended to the \fImode\fR parameter to
73 enable PEC. If the \fImode\fR parameter is omitted, i2cset defaults to byte
74 mode without PEC. The \fIvalue\fR provided must be within range for the
75 specified data type (0x00-0xFF for bytes, 0x0000-0xFFFF for words).
76
77 .SH WARNING
78 i2cset can be extremely dangerous if used improperly. It can confuse your
79 I2C bus, cause data loss, or have more serious side effects. Writing to
80 a serial EEPROM on a memory DIMM (chip addresses between 0x50 and 0x57) may
81 DESTROY your memory, leaving your system unbootable!  Be extremely careful
82 using this program.
83
84 .SH SEE ALSO
85 i2cdump(8), isaset(8)
86
87 .SH AUTHOR
88 Frodo Looijaard, Mark D. Studebaker and Jean Delvare
89
90 This manual page was originally written by David Z Maze <dmaze@debian.org> for
91 the Debian GNU/Linux system.
Note: See TracBrowser for help on using the browser.