<h1>The jeeio command</h1>

<hr>

<h2>Synopsis</h2>
<b>package require jeeio</b>

<b>jeeio</b> <i>subcommand</i> ?<i>arg ...</i>?

<hr>

<h2>Description</h2>

The <b>jeeio</b> command lets you interact with MCP23008 based devices, like the jeelabs expander plug and output plug. The legal values of <i>subcommand</i> are listed below. Note that you can abbreviate the <i>subcommand</i>s.

<dl>
<dt><b>jeeio expanderplug</b> <i>bus</i> ?<i>number</i>?
<dd>Open a channel to a jeelabs expander plug. There can be up to four expander plugs on the same i2c bus. The <i>number</i> argument selects which of the four devices to access. The command returns the channel handle.
<dt><b>jeeio outputplug</b> <i>bus</i> ?<i>number</i>?
<dd>Open a channel to a jeelabs output plug. There can be a maximum of two expander plugs on the same i2c bus. The <i>number</i> argument selects which of the two devices to access. The command returns the channel handle.
<dt><b>jeeio readgpio</b> <i>handle</i>
<dd>Read the current state of all 8 gpio pins as a single byte.
<dt><b>jeeio readpin</b> <i>handle</i> <i>pin</i>
<dd>Read the state of the specified gpio pin.
<dt><b>jeeio setinput</b> <i>handle</i> <i>pin</i>
<dd>Configure the specified gpio pin as input.
<dt><b>jeeio setoutput</b> <i>handle</i> <i>pin</i>
<dd>Configure the specified gpio pin as output.
<dt><b>jeeio writeddr</b> <i>handle</i> <i>data</i>
<dd>Configure the function for all 8 gpio pins. Each bit in the <i>data</i> value matches a gpio pin. If the bit is 0, the corresponding pin is configured as output. If the bit is 1, the pin is configured as input.
<dt><b>jeeio writegpio</b> <i>handle</i> <i>data</i>
<dd>Set the state of all output pins. The output pins are set low or high, depending on the value of the bit in the matching position in the <i>data</i> value. Bits matching input pins are ignored.
<dt><b>jeeio writepin</b> <i>handle</i> <i>pin</i> <i>value</i>
<dd>Set the state of the specified output pin.
</dl>