aboutsummaryrefslogtreecommitdiffstats
path: root/host/apps/omap_debug/usrp-e-debug-pins.c
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-03-17 13:52:29 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-03-17 13:52:29 -0700
commit6a34824ad10eaa2d2b642b959f278f6c4e326d6d (patch)
tree1aa582ee8e5cef716b59ec4deb3a8e5f4f532929 /host/apps/omap_debug/usrp-e-debug-pins.c
parent5682321efa26bb97f5d0c37d8e9921fc11a9b923 (diff)
parent306b5243e12af0db493856ad8397abac9835db0c (diff)
downloaduhd-6a34824ad10eaa2d2b642b959f278f6c4e326d6d.tar.gz
uhd-6a34824ad10eaa2d2b642b959f278f6c4e326d6d.tar.bz2
uhd-6a34824ad10eaa2d2b642b959f278f6c4e326d6d.zip
Merge branch 'master' into ashish/vivado
Diffstat (limited to 'host/apps/omap_debug/usrp-e-debug-pins.c')
-rw-r--r--host/apps/omap_debug/usrp-e-debug-pins.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/host/apps/omap_debug/usrp-e-debug-pins.c b/host/apps/omap_debug/usrp-e-debug-pins.c
deleted file mode 100644
index d18bbf990..000000000
--- a/host/apps/omap_debug/usrp-e-debug-pins.c
+++ /dev/null
@@ -1,77 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/ioctl.h>
-
-#include "usrp_e.h"
-#include "usrp_e_regs.hpp"
-
-// Usage: usrp_e_gpio <string>
-
-static int fp;
-
-static int read_reg(__u16 reg)
-{
- int ret;
- struct usrp_e_ctl16 d;
-
- d.offset = reg;
- d.count = 1;
- ret = ioctl(fp, USRP_E_READ_CTL16, &d);
- return d.buf[0];
-}
-
-static void write_reg(__u16 reg, __u16 val)
-{
- int ret;
- struct usrp_e_ctl16 d;
-
- d.offset = reg;
- d.count = 1;
- d.buf[0] = val;
- ret = ioctl(fp, USRP_E_WRITE_CTL16, &d);
-}
-
-int main(int argc, char *argv[])
-{
- int test;
-
- test = 0;
- if (argc < 2) {
- printf("%s 0|1|off\n", argv[0]);
- }
-
- fp = open("/dev/usrp_e0", O_RDWR);
- printf("fp = %d\n", fp);
- if (fp < 0) {
- perror("Open failed");
- return -1;
- }
-
- if (strcmp(argv[1], "0") == 0) {
- printf("Selected 0 based on %s\n", argv[1]);
- write_reg(UE_REG_GPIO_TX_DDR, 0xFFFF);
- write_reg(UE_REG_GPIO_RX_DDR, 0xFFFF);
- write_reg(UE_REG_GPIO_TX_SEL, 0x0);
- write_reg(UE_REG_GPIO_RX_SEL, 0x0);
- write_reg(UE_REG_GPIO_TX_DBG, 0xFFFF);
- write_reg(UE_REG_GPIO_RX_DBG, 0xFFFF);
- } else if (strcmp(argv[1], "1") == 0) {
- printf("Selected 1 based on %s\n", argv[1]);
- write_reg(UE_REG_GPIO_TX_DDR, 0xFFFF);
- write_reg(UE_REG_GPIO_RX_DDR, 0xFFFF);
- write_reg(UE_REG_GPIO_TX_SEL, 0xFFFF);
- write_reg(UE_REG_GPIO_RX_SEL, 0xFFFF);
- write_reg(UE_REG_GPIO_TX_DBG, 0xFFFF);
- write_reg(UE_REG_GPIO_RX_DBG, 0xFFFF);
- } else {
- printf("Selected off based on %s\n", argv[1]);
- write_reg(UE_REG_GPIO_TX_DDR, 0x0);
- write_reg(UE_REG_GPIO_RX_DDR, 0x0);
- }
-
- return 0;
-}