Changeset View
Standalone View
usr.sbin/i2c/i2c.8
.\" | .\" | ||||
.\" Copyright (C) 2008-2009 Semihalf, Michal Hajduk and Bartlomiej Sieka | .\" Copyright (C) 2008-2009 Semihalf, Michal Hajduk and Bartlomiej Sieka | ||||
.\" Copyright (C) 2015-2016 Emmanuel Vadot <manu@bidouilliste.com> | |||||
.\" All rights reserved. | .\" All rights reserved. | ||||
.\" | .\" | ||||
.\" Redistribution and use in source and binary forms, with or without | .\" Redistribution and use in source and binary forms, with or without | ||||
.\" modification, are permitted provided that the following conditions | .\" modification, are permitted provided that the following conditions | ||||
.\" are met: | .\" are met: | ||||
.\" 1. Redistributions of source code must retain the above copyright | .\" 1. Redistributions of source code must retain the above copyright | ||||
.\" notice, this list of conditions and the following disclaimer. | .\" notice, this list of conditions and the following disclaimer. | ||||
.\" 2. Redistributions in binary form must reproduce the above copyright | .\" 2. Redistributions in binary form must reproduce the above copyright | ||||
Show All 9 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd January 23, 2009 | .Dd March 18, 2016 | ||||
wblock: Please bump this. | |||||
.Dt I2C 8 | .Dt I2C 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm i2c | .Nm i2c | ||||
.Nd test I2C bus and slave devices | .Nd test I2C bus and slave devices | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Cm -a Ar address | .Cm -a|-A Ar address | ||||
.Op Fl f Ar device | .Op Fl f Ar device | ||||
.Op Fl d Ar r|w | .Op Fl d Ar r|w | ||||
.Op Fl w Ar 0|8|16 | .Op Fl w Ar 0|8|16 | ||||
.Op Fl o Ar offset | .Op Fl o Ar offset | ||||
.Op Fl c Ar count | .Op Fl c Ar count | ||||
.Op Fl m Ar ss|rs|no | .Op Fl m Ar ss|rs|no | ||||
.Op Fl b | .Op Fl b | ||||
.Op Fl x | |||||
.Op Fl v | .Op Fl v | ||||
.Nm | .Nm | ||||
.Cm -s | .Cm -s | ||||
.Op Fl f Ar device | .Op Fl f Ar device | ||||
.Op Fl n Ar skip_addr | .Op Fl n Ar skip_addr | ||||
.Op Fl v | .Op Fl v | ||||
.Nm | .Nm | ||||
.Cm -r | .Cm -r | ||||
.Op Fl f Ar device | .Op Fl f Ar device | ||||
.Op Fl v | .Op Fl v | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility can be used to perform raw data transfers (read or write) with devices | utility can be used to perform raw data transfers (read or write) with devices | ||||
on the I2C bus. It can also scan the bus for available devices and reset the | on the I2C bus. It can also scan the bus for available devices and reset the | ||||
I2C controller. | I2C controller. | ||||
.Pp | .Pp | ||||
The options are as follows: | The options are as follows: | ||||
.Bl -tag -width ".Fl d Ar direction" | .Bl -tag -width ".Fl d Ar direction" | ||||
.It Fl a Ar address | .It Fl a Ar address | ||||
7-bit address on the I2C device to operate on (hex). | 7-bit hex address of the I2C device. | ||||
.It Fl A Ar address | |||||
8-bit hex address of the I2C device. | |||||
Done Inline ActionsKind of confusingly worded. How about: 8-bit hex address of the I2C device on which to operate. wblock: Kind of confusingly worded. How about:
```8-bit hex address of the I2C device on which to… | |||||
Done Inline ActionsMissed a couple of things: 8-bit hex address of the I2C device on which to operate. I'm actually not sure the last part of that is needed at all. How about: 8-bit hex address of the I2C device. wblock: Missed a couple of things:
8-bit hex address **of** the I2C device on which to operate.
I'm… | |||||
Done Inline ActionsAs below, how about: 7-bit hex address of the I2C device. wblock: As below, how about:
```7-bit hex address of the I2C device.``` | |||||
Done Inline Actionss/on/of/ wblock: s/on/of/ | |||||
Done Inline Actionss/on/of/ wblock: s/on/of/ | |||||
.It Fl b | .It Fl b | ||||
binary mode - when performing a read operation, the data read from the device | binary mode - when performing a read operation, the data read from the device | ||||
is output in binary format on stdout; when doing a write, the binary data to | is output in binary format on stdout; when doing a write, the binary data to | ||||
be written to the device is read from stdin. | be written to the device is read from stdin. | ||||
.It Fl c Ar count | .It Fl c Ar count | ||||
number of bytes to transfer (dec). | number of bytes to transfer (dec). | ||||
.It Fl d Ar r|w | .It Fl d Ar r|w | ||||
transfer direction: r - read, w - write. | transfer direction: r - read, w - write. | ||||
.It Fl f Ar device | .It Fl f Ar device | ||||
I2C bus to use (default is /dev/iic0). | I2C bus to use (default is /dev/iic0). | ||||
.It Fl m Ar ss|rs|no | .It Fl m Ar ss|rs|no | ||||
addressing mode, i.e., I2C bus operations performed after the offset for the | addressing mode, i.e., I2C bus operations performed after the offset for the | ||||
transfer has been written to the device and before the actual read/write | transfer has been written to the device and before the actual read/write | ||||
operation. rs - repeated start; ss - stop start; no - none. | operation. rs - repeated start; ss - stop start; no - none. | ||||
.It Fl n Ar skip_addr | .It Fl n Ar skip_addr | ||||
skip address - address(es) to be skipped during bus scan. | skip address - address(es) to be skipped during bus scan. | ||||
There are two ways to specify addresses to ignore: by range 'a..b' or | There are two ways to specify addresses to ignore: by range 'a..b' or | ||||
using selected addresses 'a:b:c'. This option is available only when "-s" is | using selected addresses 'a:b:c'. This option is available only when "-s" is | ||||
used. | used. | ||||
.It Fl o Ar offset | .It Fl o Ar offset | ||||
offset within the device for data transfer (hex). | offset within the device for data transfer (hex). | ||||
.It Fl r | .It Fl r | ||||
reset the controller. | reset the controller. | ||||
.It Fl s | .It Fl s | ||||
scan the bus for devices. | scan the bus for devices and print a table of all addresses. | ||||
The content of each cell can have these meanings: | |||||
Done Inline ActionsThe first sentence can be added to the end of the previous sentence: scan the bus for devices and print a table of all addresses. Then start the second sentence on a new line and s/those/these/ The content of each cell can have these meanings: wblock: The first sentence can be added to the end of the previous sentence:
```scan the bus for… | |||||
Done Inline Actionss/those/these/ wblock: s/those/these/ | |||||
.Bl -bullet | |||||
.It | |||||
"--" No chip answered | |||||
.It | |||||
"UU" Chip is in use by a driver | |||||
.It | |||||
"XX" The address was skipped (see -n) | |||||
wblockUnsubmitted Not Done Inline ActionsThis should be (Untested, but I think that is correct.) wblock: This should be
"XX" The address was skipped
.Pq see Fl n
(Untested, but I think that is… | |||||
.It | |||||
A 7-bit address of a chip. | |||||
Done Inline Actionss/An/A/ Should that really be "if", or is it meant to be "of"? wblock: s/An/A/
Should that really be "if", or is it meant to be "of"? | |||||
Done Inline ActionsBoth are correct for me but english isn't my native language so it might be better otherway. manu_bidouilliste.com: Both are correct for me but english isn't my native language so it might be better otherway. | |||||
Done Inline ActionsLooks good now, thanks! wblock: Looks good now, thanks! | |||||
.El | |||||
.It Fl x | |||||
Use the I2CRDRW ioctl instead of I2CREAD/I2CWRITE. | |||||
Done Inline Actions"the" and "ones" are not needed: Use the I2CRDRW ioctl instead of I2CREAD/I2CWRITE. wblock: "the" and "ones" are not needed:
```Use the I2CRDRW ioctl instead of I2CREAD/I2CWRITE.``` | |||||
Done Inline ActionsSorry, it needs the first "the": Use **the** I2CRDRW ioctl instead of I2CREAD/I2CWRITE. wblock: Sorry, it needs the first "the":
```Use **the** I2CRDRW ioctl instead of I2CREAD/I2CWRITE.``` | |||||
Some newer drivers only support this method. | |||||
Done Inline Actionss/address/addresses/ wblock: s/address/addresses/ | |||||
.It Fl v | .It Fl v | ||||
be verbose. | be verbose. | ||||
.It Fl w Ar 0|8|16 | .It Fl w Ar 0|8|16 | ||||
device addressing width (in bits). | device addressing width (in bits). | ||||
.El | .El | ||||
.Sh WARNINGS | .Sh WARNINGS | ||||
Great care must be taken when manipulating slave I2C devices with the | Great care must be taken when manipulating slave I2C devices with the | ||||
.Nm | .Nm | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
Please bump this.