Tcl Raspberry Pi I/O

Artifact [8977341221]
Login

Artifact 89773412212b3eb2a7be363a4597ea46c7439f4e:

Wiki page [jeeio] by schelte 2014-03-19 22:34:29.
D 2014-03-19T22:34:29.752
L jeeio
U schelte
W 2015
<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>

Z d017ff2671ab0f0e4c1ac788c6b1f005