一、spidev_test

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/tools/spi/
spidev_test --help
spidev_test: unrecognized option `--help'
Usage: spidev_test [-DsbdlHOLC3]
  -D --device   device to use (default /dev/spidev1.1)
  -s --speed    max speed (Hz)
  -d --delay    delay (usec)
  -b --bpw      bits per word
  -i --input    input data from a file (e.g. "test.bin")
  -o --output   output data to a file (e.g. "results.bin")
  -l --loop     loopback
  -H --cpha     clock phase
  -O --cpol     clock polarity
  -L --lsb      least significant bit first
  -C --cs-high  chip select active high
  -3 --3wire    SI/SO signals shared
  -v --verbose  Verbose (show tx buffer)
  -p            Send data (e.g. "1234\xde\xad")
  -N --no-cs    no chip select
  -R --ready    slave pulls low to pause
  -2 --dual     dual transfer
  -4 --quad     quad transfer

二、spi-tools

https://github.com/cpb-/spi-tools
spi-config usage
options
-d --device=<dev> use the given spi-dev character device.
-q --query print the current configuration.
-m --mode=[0-3] use the selected spi mode.
-l --lsb={0,1} LSB first (1) or MSB first (0).
-b --bits=[7...] bits per word.
-s --speed=<int> set the speed in Hz.
-r --spirdy={0,1} set the SPI_READY spi mode flag.
-w --wait block, keeping the file descriptor open.
-h --help help screen.
-v --version display the version number.

spi-pipe usage
Options
-d --device=<dev> use the given spi-dev character device.
-m --mode=[0-3] use the selected spi mode.
-s --speed=<speed> Maximum SPI clock rate (in Hz).
-l --lsb={0,1} LSB first (1) or MSB first (0).
-B --bits=[7...] bits per word.
-r --spirdy={0,1} set the SPI_READY spi mode flag.
-b --blocksize=<int> transfer block size in byte.
-n --number=<int> number of blocks to transfer.
-h --help help screen.
-v --version display the version number.
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐