| Main index | Section 8 | Options |
Each spigen(4) device is associated with a specific "chip select" (cs) pin on the spibus, and therefore needs to be specified. If no device name is specified on the command line, spi assumes "spigen0.0".
For more information on the spigen device, see spigen(4).
The options are as follows:
| |
Specifies ASCII mode.
Both read and write data is input and output as
2-character hexadecimal values, optionally separated by white space,
such as 00 01 02 etc.
When combined with the
|
| |
Binary
(output)
mode.
Only has an effect when
|
| | |
|
Sends one or more command bytes,
skipping any bytes read-in during the transfer.
The byte values should be specified as a quoted parameter, similar to the
format for data on stdin for
| |
| | |
| The total number of bytes to transfer as a decimal integer. If a write or a read/write transaction is being performed, and fewer than this number of bytes are read in from stdin, the remaining bytes will be sent with a value of "0". If the length can be determined from the input file size, you can use a count value of "-1" to base the transfer on the input file's size. | |
| | |
| Transfer direction: Use r for read, w for write, and rw for simultaneous read and write. | |
| | |
| SPI device to use (default is /dev/spigen0). | |
| | Print help text to stderr, explaining the command line options. |
| | Displays information about the SPI device to stderr. Whenever this flag is specified, no data is read or written, and the mode and clock speed are not changed. |
| |
LSB bit order.
The default is MSB, i.e., the highest order bit is
transmitted first.
Specifying
|
| | |
| SPI mode, 0 through 3. This defines the clock phase and timing with respect to reading and writing data, as per the SPI specification. | |
| | |
| Specify the maximum speed, in Hz, for the SPI clock. The bus will operate at its highest available speed which does not exceed this maximum. | |
| |
Specifies Verbose mode.
Diagnostics and information are written to stderr.
You can specify
|
spi -i
spi -f spigen0.1 -s 200000 -m 3
spi -d r -C "00 01" -c 2
echo "05" | spi -A -d rw -m 2 -s 500000 -c 2
spi -d rw -c -1 <input_file.bin | od -An -t x1
echo "00 01" | spi -A -b -d rw -c 4 | od -t x2
spi -f spigen0.0 -m 0 -s 1000000 -d r -c 3 -A -C 9f
| SPI (8) | August 21, 2020 |
| Main index | Section 8 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
