Artifact 65d5ccaa53d1f77f55a8147c4732352eaf9c521d:
Wiki page
[
twowire] by
schelte
2014-03-19 21:00:58.
D 2014-03-19T21:00:58.935
L twowire
P 4ed78dd8d02cfc9fea55b0e85aa899b134279f5a
U schelte
W 1643
<h1>The twowire command</h1>
<hr>
<h2>Synopsis</h2>
<b>twowire</b> <i>subcommand</i> ?<i>arg ...</i>?
<hr>
<h2>Description</h2>
The <b>twowire</b> command provides access to the i2c busses of the Raspberry Pi. The legal values of <i>subcommand</i> are listed below. Note that you can abbreviate the <i>subcommand</i>s.
<dl>
<dt><b>twowire readbyte</b> <i>handle</i>
<dd>Read a single byte from the device addressed by the <i>handle</i>.
<dt><b>twowire readregbyte</b> <i>handle</i> <i>register</i>
<dd>Read a byte from the specified <i>register</i> of the device addressed by the <i>handle</i>.
<dt><b>twowire readregword</b> <i>handle</i> <i>register</i>
<dd>Read a 2-byte word (LSB, MSB) from the specified <i>register</i> of the device addressed by the <i>handle</i>.
<dt><b>twowire twowire</b> <i>bus</i> <i>address</i>
<dd>Create a <i>handle</i> for the i2c device with the specified <i>address</i> on the specified i2c <i>bus</i>. This <i>handle</i> can be used with the other subcommands to exchange data with the device. The regular Tcl <b>close</b> or <b>chan close</b> commands can be used to release the handle.
<dt><b>twowire writebyte</b> <i>handle</i> <i>data</i>
<dd>Write a single byte to the device addressed by the <i>handle</i>.
<dt><b>twowire writeregbyte</b> <i>handle</i> <i>register</i> <i>data</i>
<dd>Write a byte to the specified <i>register</i> of the device addressed by the <i>handle</i>.
<dt><b>twowire writeregword</b> <i>handle</i> <i>register</i> <i>data</i>
<dd>Write a 2-byte word (LSB, MSB) to the specified <i>register</i> of the device addressed by the <i>handle</i>.
</dl>
Z 8368a94962d9105b939cfa27359af17b