<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>