Lines Matching +full:speed +full:- +full:bin

1 // SPDX-License-Identifier: GPL-2.0-only
8 * Cross-compile with cross-gcc -I/path/to/cross-kernel/include
43 static uint32_t speed = 500000; variable
71 while (length-- > 0) { in hex_dump()
91 * Unescape - process hexadecimal escape character
92 * converts shell input "\x23" -> 0x23
127 .speed_hz = speed, in transfer()
175 printf("Usage: %s [-2348CDFHILMNORSZbdilopsv]\n", prog); in print_usage()
177 " -D --device device to use (default /dev/spidev1.1)\n" in print_usage()
178 " -s --speed max speed (Hz)\n" in print_usage()
179 " -d --delay delay (usec)\n" in print_usage()
180 " -l --loop loopback\n" in print_usage()
182 " -H --cpha clock phase\n" in print_usage()
183 " -O --cpol clock polarity\n" in print_usage()
184 " -F --rx-cpha-flip flip CPHA on Rx only xfer\n" in print_usage()
186 " -2 --dual dual transfer\n" in print_usage()
187 " -4 --quad quad transfer\n" in print_usage()
188 " -8 --octal octal transfer\n" in print_usage()
189 " -3 --3wire SI/SO signals shared\n" in print_usage()
190 " -Z --3wire-hiz high impedance turnaround\n" in print_usage()
192 " -i --input input data from a file (e.g. \"test.bin\")\n" in print_usage()
193 " -o --output output data to a file (e.g. \"results.bin\")\n" in print_usage()
194 " -p Send data (e.g. \"1234\\xde\\xad\")\n" in print_usage()
195 " -S --size transfer size\n" in print_usage()
196 " -I --iter iterations\n" in print_usage()
198 " -b --bpw bits per word\n" in print_usage()
199 " -L --lsb least significant bit first\n" in print_usage()
200 " -C --cs-high chip select active high\n" in print_usage()
201 " -N --no-cs no chip select\n" in print_usage()
202 " -R --ready slave pulls low to pause\n" in print_usage()
203 " -M --mosi-idle-low leave mosi line low when idle\n" in print_usage()
205 " -v --verbose Verbose (show tx buffer)\n"); in print_usage()
214 { "speed", 1, 0, 's' }, in parse_opts()
219 { "rx-cpha-flip", 0, 0, 'F' }, in parse_opts()
224 { "3wire-hiz", 0, 0, 'Z' }, in parse_opts()
231 { "cs-high", 0, 0, 'C' }, in parse_opts()
232 { "no-cs", 0, 0, 'N' }, in parse_opts()
234 { "mosi-idle-low", 0, 0, 'M' }, in parse_opts()
243 if (c == -1) in parse_opts()
251 speed = atoi(optarg); in parse_opts()
361 if (stat(filename, &sb) == -1) in transfer_file()
394 rx_rate = ((_read_count - prev_read_count) * 8) / (interval*1000.0); in show_transfer_rate()
395 tx_rate = ((_write_count - prev_write_count) * 8) / (interval*1000.0); in show_transfer_rate()
446 pabort("only one of -p and --input may be selected"); in main()
458 if (ret == -1) in main()
463 if (ret == -1) in main()
477 if (ret == -1) in main()
481 if (ret == -1) in main()
485 * max speed hz in main()
487 ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); in main()
488 if (ret == -1) in main()
489 pabort("can't set max speed hz"); in main()
491 ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed); in main()
492 if (ret == -1) in main()
493 pabort("can't get max speed hz"); in main()
497 printf("max speed: %u Hz (%u kHz)\n", speed, speed/1000); in main()
508 while (iterations-- > 0) { in main()
514 if (current.tv_sec - last_stat.tv_sec > interval) { in main()