Tcl Raspberry Pi I/O

Artifact [d01ef14bf3]
Login

Artifact d01ef14bf31b42c178664a9fef5c5823a3261cd9:

Wiki page [spi] by schelte 2017-04-13 09:36:19.
D 2017-04-13T09:36:19.187
L spi
U schelte
W 1226
<h1>The spi command</h1>

<hr>

<h2>Synopsis</h2>

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

<hr>

<h2>Description</h2>

The <b>spi</b> command lets you manipulate the Raspberry Pi spi interfaces. The legal values of <i>subcommand</i> are listed below. Note that you can abbreviate the <i>subcommand</i>s.

<dl>
<dt><b>spi open</b> <i>device</i>
<dd>Open the spi port. This command returns a channel identifier that may be used in future invocations of the standard Tcl I/O commands like <b>read</b>, <b>puts</b>, and <b>close</b>.
<dt><b>spi transfer</b> <i>channelId</i> <i>data</i>
<dd>Perform full duplex communication. This command transmits the specified data. At the same time it receives an equal amount of data, which is returned to the caller.
</dl>

<h2>Configuration options</h2>
The <b>chan configure</b> command can be used to query and set several configuration options for spi channels:
<dl>
<dt><b>-bpw</b> <i>bits</i>
<dd>Set the number of bits per word.
<dt><b>-delay</b> <i>usecs</i>
<dd>Specify the delay between two words.
<dt><b>-mode</b> <i>mode</i>
<dd>Control the clock polarity and phase.
<dt><b>-speed</b> <i>speed</i>
<dd>Modify the connection speed.
</dl>


Z da81bc9ec59d60284848177b04ff173b