spi-pipe - Man Page

full-duplex SPI communication tool.

Synopsis

spi-pipe options...

Description

This program allows full-duplex communications, sending data from its standard input to the SPI slave, and displaying on its standard output the data received from the SPI port.

-d,  --device=DEVICE

use the given Linux spidev character device.

-s,  --speed=<int>

set the target SPI speed for transfer.

-b,  --blocksize=<int>

set the block size (in bytes) for transfer.

-n,  --number=<int>

set the number of blocks to transmit (-1 for continuous transfert).

-h,  --help

display the help screen and exit.

-v,  --version

display the version number and exit.

Examples

Get help:

$ spi-pipe -h

Send and receive at the same time

$ command-1 | spi-pipe --device=/dev/spidev0.0 | command-2
Note that command-1, command-2 and spi-pipe run simultaneously in three different processes.

Send data to the SPI link

$ command-1 | spi-pipe --device=/dev/spidev0.0

Receive data from the SPI link

$ spi-pipe --device=/dev/spidev0.0 < /dev/zero | command-2
You can also use command-2 < /dev/spidev0.0 but with spi-pipe you can control what is sent to the device (always `0` here).

Read 40 blocks of 4 bytes from the SPI link

$  spi-pipe --device=/dev/spidev0.0 -b 4 -n 40 < /dev/zero | command-2

Author

Written by Christophe BLAESS <http://www.blaess.fr/christophe>.

Reporting Bugs

Github home page: <https://github.com/cpb-/spi-tools.git>

Info

August 2014 SPI-tools