From f60450529c0d6b7e36787493beec3f07af6fd007 Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Fri, 8 Jul 2011 13:02:34 -0700 Subject: E1X0 : Remove the spi and i2c test programs. These existed to test the spi and i2c ioctls that have been removed from the device driver. If we need these programs back, they will need to be rewritten with the user space spi and i2c code from uhd. --- host/usrp_e_utils/CMakeLists.txt | 2 - host/usrp_e_utils/usrp-e-i2c.c | 87 ---------------------------------------- host/usrp_e_utils/usrp-e-spi.c | 54 ------------------------- 3 files changed, 143 deletions(-) delete mode 100644 host/usrp_e_utils/usrp-e-i2c.c delete mode 100644 host/usrp_e_utils/usrp-e-spi.c (limited to 'host/usrp_e_utils') diff --git a/host/usrp_e_utils/CMakeLists.txt b/host/usrp_e_utils/CMakeLists.txt index ee3d9da65..9162a2099 100644 --- a/host/usrp_e_utils/CMakeLists.txt +++ b/host/usrp_e_utils/CMakeLists.txt @@ -32,8 +32,6 @@ IF(ENABLE_USRP_E_UTILS) usrp-e-wb-test.cpp usrp-e-debug-pins.c usrp-e-gpio.c - usrp-e-i2c.c - usrp-e-spi.c ) #for each source: build an executable and install diff --git a/host/usrp_e_utils/usrp-e-i2c.c b/host/usrp_e_utils/usrp-e-i2c.c deleted file mode 100644 index c6fd4c632..000000000 --- a/host/usrp_e_utils/usrp-e-i2c.c +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include - -// Usage: usrp_e_i2c w address data0 data1 data 2 .... -// Usage: usrp_e_i2c r address count - -int main(int argc, char *argv[]) -{ - int fp, ret, i, tmp; - struct usrp_e_i2c *i2c_msg; - int direction, address, count; - - if (argc < 3) { - printf("Usage: usrp-e-i2c w address data0 data1 data2 ...\n"); - printf("Usage: usrp-e-i2c r address count\n"); - printf("All addresses and data in hex.\n"); - exit(-1); - } - - if (strcmp(argv[1], "r") == 0) { - direction = 0; - } else if (strcmp(argv[1], "w") == 0) { - direction = 1; - } else { - return -1; - } - - sscanf(argv[2], "%X", &address); - printf("Address = %X\n", address); - - fp = open("/dev/usrp_e0", O_RDWR); - printf("fp = %d\n", fp); - if (fp < 0) { - perror("Open failed"); - return -1; - } - -// sleep(1); - - if (direction) { - count = argc - 3; - } else { - sscanf(argv[3], "%X", &count); - } - printf("Count = %X\n", count); - - i2c_msg = malloc(sizeof(i2c_msg) + count * sizeof(char)); - - i2c_msg->addr = address; - i2c_msg->len = count; - - for (i = 0; i < count; i++) { - i2c_msg->data[i] = i; - } - - if (direction) { - // Write - - for (i=0; idata[i] = tmp; - } - - ret = ioctl(fp, USRP_E_I2C_WRITE, i2c_msg); - printf("Return value from i2c_write ioctl: %d\n", ret); - } else { - // Read - - ret = ioctl(fp, USRP_E_I2C_READ, i2c_msg); - printf("Return value from i2c_read ioctl: %d\n", ret); - - printf("Ioctl: %d Data read :", ret); - for (i=0; idata[i]); - } - printf("\n"); - - } - return 0; -} diff --git a/host/usrp_e_utils/usrp-e-spi.c b/host/usrp_e_utils/usrp-e-spi.c deleted file mode 100644 index 5203f56a8..000000000 --- a/host/usrp_e_utils/usrp-e-spi.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include - -// 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; -} -- cgit v1.2.3