logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

spi-config - set or query SPI configuration.

Author

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

Description

       Set or query the configuration of a SPI port.

       -d, --device=DEVICE
              use the given Linux spidev character device.

       -q, --query
              print the current configuration.

       -m, --mode=[0-3]
              set the spi mode (see SPI MODES below).

       -l, --lsb={0,1}
              set LSB first (1) or MSB first (0).

       -b, --bits=[7...]
              set the number of bits per word.

       -s, --speed=FREQUENCY
              set clock frequency (in Hz).

       -r, --spirdy={0,1}
              set the SPI READY mode flag.

       -s, --wait
              block, keeping the file descriptor open. See WAITOPTION below.

       -h, --help
              display the help screen and exit.

       -v, --version
              display the version number and exit.

   SPIMODES
       mode 0 low iddle level, sample on leading edge.

       mode 1 low iddle level, sample on trailing edge.

       mode 2 high iddle level, sample on leading edge.

       mode 3 high iddle level, sample on trailing edge.

   WAITOPTION
       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

       Get help:
              $ spi-config-h

       Query current configuration:
              $ spi-config--device=/dev/spidev0.0-q

       Change clock frequency to 1 MHz:
              $ spi-config--device=/dev/spidev0.0--speed=1000000

       Set a configuration and keep the device open:
              $ spi-config--wait--speed=1000000 & PID=$!

       Close device previously open:
              $ kill $PID

Name

       spi-config - set or query SPI configuration.

Reporting Bugs

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

Synopsis

spi-configoptions...

See Also