| 1 | .TH I2CSET 8 "June 2007" |
|---|
| 2 | .SH "NAME" |
|---|
| 3 | i2cset \- set I2C registers |
|---|
| 4 | |
|---|
| 5 | .SH SYNOPSIS |
|---|
| 6 | .B i2cset |
|---|
| 7 | .RB [ -f ] |
|---|
| 8 | .RB [ -y ] |
|---|
| 9 | .I i2cbus |
|---|
| 10 | .I chip-address |
|---|
| 11 | .I data-address |
|---|
| 12 | .I value |
|---|
| 13 | .RI [ mode ] |
|---|
| 14 | .RI [ mask ] |
|---|
| 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 | .PP |
|---|
| 42 | There are four required options to i2cset. \fIi2cbus\fR indicates the number |
|---|
| 43 | of the I2C bus to be scanned. This number should correspond to one of |
|---|
| 44 | the busses listed by \fIi2cdetect -l\fR. \fIchip-address\fR specifies the |
|---|
| 45 | address of the chip on that bus, and is an integer between 0x00 and 0x7F. |
|---|
| 46 | \fIdata-address\fR specifies the address on that chip to write to, and is an |
|---|
| 47 | integer between 0x00 and 0xFF. \fIvalue\fR is the value to write to that |
|---|
| 48 | location on the chip. |
|---|
| 49 | .PP |
|---|
| 50 | The \fImode\fR parameter, if specified, is one of the letters \fBb\fP or |
|---|
| 51 | \fBw\fP, corresponding to a write size of a single byte or a 16-bit word, |
|---|
| 52 | respectively. A \fBp\fP can also be appended to the \fImode\fR parameter to |
|---|
| 53 | enable PEC. If the \fImode\fR parameter is omitted, i2cset defaults to byte |
|---|
| 54 | mode without PEC. The \fIvalue\fR provided must be within range for the |
|---|
| 55 | specified data type (0x00-0xFF for bytes, 0x0000-0xFFFF for words). |
|---|
| 56 | .PP |
|---|
| 57 | The \fImask\fR parameter, if specified, describes which bits of \fIvalue\fR |
|---|
| 58 | will be actually written to \fIdata-address\fR. Bits set to 1 in the mask |
|---|
| 59 | are taken from \fIvalue\fR, while bits set to 0 will be read from |
|---|
| 60 | \fIdata-address\fR and thus preserved by the operation. |
|---|
| 61 | |
|---|
| 62 | .SH WARNING |
|---|
| 63 | i2cset can be extremely dangerous if used improperly. It can confuse your |
|---|
| 64 | I2C bus, cause data loss, or have more serious side effects. Writing to |
|---|
| 65 | a serial EEPROM on a memory DIMM (chip addresses between 0x50 and 0x57) may |
|---|
| 66 | DESTROY your memory, leaving your system unbootable! Be extremely careful |
|---|
| 67 | using this program. |
|---|
| 68 | |
|---|
| 69 | .SH SEE ALSO |
|---|
| 70 | i2cdump(8), isaset(8) |
|---|
| 71 | |
|---|
| 72 | .SH AUTHOR |
|---|
| 73 | Frodo Looijaard, Mark D. Studebaker, and the lm_sensors group |
|---|
| 74 | http://www.lm-sensors.org/ |
|---|
| 75 | This manual page was originally written by David Z Maze <dmaze@debian.org> for |
|---|
| 76 | the Debian GNU/Linux system. It was then reviewed by the lm_sensors team and |
|---|
| 77 | is now part of the lm_sensors source distribution. |
|---|