Lines Matching +full:spi +full:- +full:lsb +full:- +full:first

28 .Nm spi
29 .Nd communicate on SPI bus with slave devices
36 .Op Fl C Ar command-bytes
41 .Op Fl s Ar max-speed
53 with devices on the SPI bus, via the
72 .Bl -tag -width "-f device"
76 2-character hexadecimal values, optionally separated by white space,
91 while leaving the input format as-is.
96 to pass hexadecimal values to the SPI device, but output the received data
98 .It Fl C Ar command-bytes
100 skipping any bytes read-in during the transfer.
105 An SPI device will typically require that a command be sent, followed by
118 .Dq -1
134 Displays information about the SPI device to stderr.
140 transmitted first.
143 caused the LSB to be transmitted and read first.
147 data, as per the SPI specification.
149 Specify the maximum speed, in Hz, for the SPI clock.
160 Here are a few examples of using the spi utility:
161 .Bl -bullet
163 Get information about the default SPI device
164 .Bd -literal
165 spi -i
170 .Bd -literal
171 spi -f spigen0.1 -s 200000 -m 3
175 from the SPI device, using the current mode and speed on the default device
176 .Bd -literal
177 spi -d r -C "00 01" -c 2
181 2-byte ASCII hexadecimal, with mode 2, and a maximum clock speed of 500khz.
182 .Bd -literal
183 echo "05" | spi -A -d rw -m 2 -s 500000 -c 2
186 Send a binary file, and output the SPI result through
188 as hexadecimal bytes, using the current maximum clock speed and SPI mode.
189 .Bd -literal
190 spi -d rw -c -1 <input_file.bin | od -An -t x1
193 Send 2 bytes of data, receive a total of 4 bytes, and output the SPI result
197 .Bd -literal
198 echo "00 01" | spi -A -b -d rw -c 4 | od -t x2
202 sending the command byte 0x9f and displaying the 3-byte reply in ASCII hex.
203 .Bd -literal
204 spi -f spigen0.0 -m 0 -s 1000000 -d r -c 3 -A -C 9f