twowire

The twowire command


Synopsis

twowire subcommand ?arg ...?


Description

The twowire command provides access to the i2c busses of the Raspberry Pi. The legal values of subcommand are listed below. Note that you can abbreviate the subcommands.

twowire readbyte handle
Read a single byte from the device addressed by the handle.
twowire readregbyte handle register
Read a byte from the specified register of the device addressed by the handle.
twowire readregword handle register
Read a 2-byte word (LSB, MSB) from the specified register of the device addressed by the handle.
twowire twowire bus address
Create a handle for the i2c device with the specified address on the specified i2c bus. This handle can be used with the other subcommands to exchange data with the device. The regular Tcl close or chan close commands can be used to release the handle.
twowire writebyte handle data
Write a single byte to the device addressed by the handle.
twowire writeregbyte handle register data
Write a byte to the specified register of the device addressed by the handle.
twowire writeregword handle register data
Write a 2-byte word (LSB, MSB) to the specified register of the device addressed by the handle.