Scroll to navigation

SPI-CONFIG(1) User Commands SPI-CONFIG(1)

NAME

spi-config - set or query SPI configuration.

SYNOPSIS

spi-config options...

DESCRIPTION

Set or query the configuration of a SPI port.

use the given Linux spidev character device.
print the current configuration.
set the spi mode (see SPI MODES below).
set LSB first (1) or MSB first (0).
set the number of bits per word.
set clock frequency (in Hz).
set the SPI READY mode flag.
block, keeping the file descriptor open. See WAIT OPTION below.
display the help screen and exit.
display the version number and exit.

SPI MODES

low iddle level, sample on leading edge.
low iddle level, sample on trailing edge.
high iddle level, sample on leading edge.
high iddle level, sample on trailing edge.

WAIT OPTION

On some platforms, the speed is reset to a default value when the file descriptor is closed. To avoid this, one can use the -w option that keeps the file descriptor open. See also last example below.

EXAMPLES

$ spi-config -h
$ spi-config --device=/dev/spidev0.0 -q
$ spi-config --device=/dev/spidev0.0 --speed=1000000
$ spi-config --wait --speed=1000000 & PID=$!
$ kill $PID

AUTHOR

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

REPORTING BUGS

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

COPYRIGHT

Copyright © 2014 Christophe Blaess.
Licensed under GPLv2 <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

August 2014 SPI-tools