carta
spi-pipe(1)

spi-pipe1

Full-duplex spi communication tool.

Usage

spi-pipe options ...

Overview

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

History

  • Debian 13 (Trixie) to Debian 11 (Bullseye): the text shown here
  • Debian 10 (Buster)

--speed since Debian 11 (Bullseye); -s since Debian 11 (Bullseye).

Author

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

Reporting bugs

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

From spi-tools 0.8.4-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.