aboutsummaryrefslogtreecommitdiffstats
path: root/host/usrp_e_utils
diff options
context:
space:
mode:
Diffstat (limited to 'host/usrp_e_utils')
-rw-r--r--host/usrp_e_utils/CMakeLists.txt5
-rw-r--r--host/usrp_e_utils/usrp-e-debug-pins.c30
-rw-r--r--host/usrp_e_utils/usrp-e-gpio.c22
-rw-r--r--host/usrp_e_utils/usrp-e-wb-test.cpp20
4 files changed, 38 insertions, 39 deletions
diff --git a/host/usrp_e_utils/CMakeLists.txt b/host/usrp_e_utils/CMakeLists.txt
index 5f244a216..ee3d9da65 100644
--- a/host/usrp_e_utils/CMakeLists.txt
+++ b/host/usrp_e_utils/CMakeLists.txt
@@ -23,9 +23,8 @@ LIBUHD_REGISTER_COMPONENT("USRP-E Utils" ENABLE_USRP_E_UTILS OFF "LINUX" OFF)
IF(ENABLE_USRP_E_UTILS)
ENABLE_LANGUAGE(C)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e100)
- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e100/include)
- INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/lib/ic_reg_maps)
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/usrp/e100)
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/usrp/e100/include)
SET(usrp_e_utils_sources
usrp-e-loopback.c
diff --git a/host/usrp_e_utils/usrp-e-debug-pins.c b/host/usrp_e_utils/usrp-e-debug-pins.c
index 94f898b67..570ae63d8 100644
--- a/host/usrp_e_utils/usrp-e-debug-pins.c
+++ b/host/usrp_e_utils/usrp-e-debug-pins.c
@@ -7,7 +7,7 @@
#include <sys/ioctl.h>
#include <linux/usrp_e.h>
-#include "usrp_e100_regs.hpp"
+#include "e100_regs.hpp"
// Usage: usrp_e_gpio <string>
@@ -54,24 +54,24 @@ int main(int argc, char *argv[])
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);
+ write_reg(E100_REG_GPIO_TX_DDR, 0xFFFF);
+ write_reg(E100_REG_GPIO_RX_DDR, 0xFFFF);
+ write_reg(E100_REG_GPIO_TX_SEL, 0x0);
+ write_reg(E100_REG_GPIO_RX_SEL, 0x0);
+ write_reg(E100_REG_GPIO_TX_DBG, 0xFFFF);
+ write_reg(E100_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);
+ write_reg(E100_REG_GPIO_TX_DDR, 0xFFFF);
+ write_reg(E100_REG_GPIO_RX_DDR, 0xFFFF);
+ write_reg(E100_REG_GPIO_TX_SEL, 0xFFFF);
+ write_reg(E100_REG_GPIO_RX_SEL, 0xFFFF);
+ write_reg(E100_REG_GPIO_TX_DBG, 0xFFFF);
+ write_reg(E100_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);
+ write_reg(E100_REG_GPIO_TX_DDR, 0x0);
+ write_reg(E100_REG_GPIO_RX_DDR, 0x0);
}
return 0;
diff --git a/host/usrp_e_utils/usrp-e-gpio.c b/host/usrp_e_utils/usrp-e-gpio.c
index 7e4bc4e13..4b788e945 100644
--- a/host/usrp_e_utils/usrp-e-gpio.c
+++ b/host/usrp_e_utils/usrp-e-gpio.c
@@ -7,7 +7,7 @@
#include <sys/ioctl.h>
#include "linux/usrp_e.h"
-#include "usrp_e100_regs.hpp"
+#include "e100_regs.hpp"
// Usage: usrp_e_gpio <string>
@@ -46,38 +46,38 @@ int main(int argc, char *argv[])
fp = open("/dev/usrp_e0", O_RDWR);
printf("fp = %d\n", fp);
- write_reg(UE_REG_GPIO_TX_DDR, 0x0);
- write_reg(UE_REG_GPIO_RX_DDR, 0xFFFF);
+ write_reg(E100_REG_GPIO_TX_DDR, 0x0);
+ write_reg(E100_REG_GPIO_RX_DDR, 0xFFFF);
for (i=0; i < 16; i++) {
- write_reg(UE_REG_GPIO_RX_IO, 1 << i);
+ write_reg(E100_REG_GPIO_RX_IO, 1 << i);
sleep(1);
if (test) {
- data_in = read_reg(UE_REG_GPIO_TX_IO);
+ data_in = read_reg(E100_REG_GPIO_TX_IO);
if (data_in != (1 << i))
printf("Read failed, wrote: %X read: %X\n", \
1 << i, data_in);
}
}
- write_reg(UE_REG_GPIO_RX_DDR, 0x0);
- write_reg(UE_REG_GPIO_TX_DDR, 0xFFFF);
+ write_reg(E100_REG_GPIO_RX_DDR, 0x0);
+ write_reg(E100_REG_GPIO_TX_DDR, 0xFFFF);
sleep(1);
for (i=0; i < 16; i++) {
- write_reg(UE_REG_GPIO_TX_IO, 1 << i);
+ write_reg(E100_REG_GPIO_TX_IO, 1 << i);
sleep(1);
if (test) {
- data_in = read_reg(UE_REG_GPIO_RX_IO);
+ data_in = read_reg(E100_REG_GPIO_RX_IO);
if (data_in != (1 << i))
printf("Read failed, wrote: %X read: %X\n", \
1 << i, data_in);
}
}
- write_reg(UE_REG_GPIO_RX_DDR, 0x0);
- write_reg(UE_REG_GPIO_TX_DDR, 0x0);
+ write_reg(E100_REG_GPIO_RX_DDR, 0x0);
+ write_reg(E100_REG_GPIO_TX_DDR, 0x0);
return 0;
}
diff --git a/host/usrp_e_utils/usrp-e-wb-test.cpp b/host/usrp_e_utils/usrp-e-wb-test.cpp
index 3d6a8d101..efd9312c1 100644
--- a/host/usrp_e_utils/usrp-e-wb-test.cpp
+++ b/host/usrp_e_utils/usrp-e-wb-test.cpp
@@ -24,7 +24,7 @@
#include <fcntl.h> //open, close
#include <linux/usrp_e.h>
-#include "usrp_e100_regs.hpp"
+#include "e100_regs.hpp"
static const size_t num_test_iters = 10000000;
@@ -91,18 +91,18 @@ int main(int, char *[]){
int random_secs = ::random();
//set a bunch of registers
- poke16(UE_REG_MISC_TEST, random_test16);
- poke32(UE_REG_SR_MISC_TEST32, random_test32);
- poke32(UE_REG_TIME64_TICKS, 0);
- poke32(UE_REG_TIME64_IMM, 1); //immediate
- poke32(UE_REG_TIME64_SECS, random_secs);
+ poke16(E100_REG_MISC_TEST, random_test16);
+ poke32(E100_REG_SR_MISC_TEST32, random_test32);
+ poke32(E100_REG_TIME64_TICKS, 0);
+ poke32(E100_REG_TIME64_IMM, 1); //immediate
+ poke32(E100_REG_TIME64_SECS, random_secs);
//read a bunch of registers
if (
- (peek16(UE_REG_MISC_TEST) == random_test16) and
- (peek32(UE_REG_RB_MISC_TEST32) == random_test32) and
- (peek32(UE_REG_RB_TIME_NOW_SECS) == random_secs) and
-// (peek32(UE_REG_RB_TIME_NOW_TICKS) < 1000000) and
+ (peek16(E100_REG_MISC_TEST) == random_test16) and
+ (peek32(E100_REG_RB_MISC_TEST32) == random_test32) and
+ (peek32(E100_REG_RB_TIME_NOW_SECS) == random_secs) and
+// (peek32(E100_REG_RB_TIME_NOW_TICKS) < 1000000) and
true) num_pass++;
else num_fail++;
}