aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/usrp-e-spi.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-10 12:15:04 -0800
committerJosh Blum <josh@joshknows.com>2011-02-10 12:15:04 -0800
commit80be2ec57a0fada29d04bd5cd0c102c622fac7a6 (patch)
tree54bf666d4f1f1906116f9e7a39bbdc7c09fa1652 /host/utils/usrp-e-spi.c
parent1275c37b96953c04191e9a5dd8747766c723b7e1 (diff)
parent206a70cb823da9c338dcb83855a22ad251bb9cb7 (diff)
downloaduhd-80be2ec57a0fada29d04bd5cd0c102c622fac7a6.tar.gz
uhd-80be2ec57a0fada29d04bd5cd0c102c622fac7a6.tar.bz2
uhd-80be2ec57a0fada29d04bd5cd0c102c622fac7a6.zip
Merge branch 'usrp_e100_devel' into next
Conflicts: host/lib/usrp/usrp_e100/io_impl.cpp
Diffstat (limited to 'host/utils/usrp-e-spi.c')
-rw-r--r--host/utils/usrp-e-spi.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/host/utils/usrp-e-spi.c b/host/utils/usrp-e-spi.c
deleted file mode 100644
index 5203f56a8..000000000
--- a/host/utils/usrp-e-spi.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-
-#include <linux/usrp_e.h>
-
-// Usage: usrp_e_spi w|rb slave data
-
-int main(int argc, char *argv[])
-{
- int fp, slave, length, ret;
- unsigned int data;
- struct usrp_e_spi spi_dat;
-
- if (argc < 5) {
- printf("Usage: usrp_e_spi w|rb slave transfer_length data\n");
- exit(-1);
- }
-
- slave = atoi(argv[2]);
- length = atoi(argv[3]);
- data = atoll(argv[4]);
-
- printf("Data = %X\n", data);
-
- fp = open("/dev/usrp_e0", O_RDWR);
- printf("fp = %d\n", fp);
- if (fp < 0) {
- perror("Open failed");
- return -1;
- }
-
-// sleep(1);
-
-
- spi_dat.slave = slave;
- spi_dat.data = data;
- spi_dat.length = length;
- spi_dat.flags = UE_SPI_PUSH_FALL | UE_SPI_LATCH_RISE;
-
- if (*argv[1] == 'r') {
- spi_dat.readback = 1;
- ret = ioctl(fp, USRP_E_SPI, &spi_dat);
- printf("Ioctl returns: %d, Data returned = %d\n", ret, spi_dat.data);
- } else {
- spi_dat.readback = 0;
- ioctl(fp, USRP_E_SPI, &spi_dat);
- }
-
- return 0;
-}