From fa35b710c09d7cb4a410313fd24d0ea2aa4172a3 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Feb 2010 02:06:59 +0000 Subject: Initial checkin of u1e testing code. Some of these may not be really useful anymore. --- host/apps/omap_debug/usrp1-e-ram.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 host/apps/omap_debug/usrp1-e-ram.c (limited to 'host/apps/omap_debug/usrp1-e-ram.c') diff --git a/host/apps/omap_debug/usrp1-e-ram.c b/host/apps/omap_debug/usrp1-e-ram.c new file mode 100644 index 000000000..d548f7ccd --- /dev/null +++ b/host/apps/omap_debug/usrp1-e-ram.c @@ -0,0 +1,25 @@ +#include +#include +#include + +int main(int rgc, char *argv[]) +{ + int fp, i, cnt; + unsigned short buf[1024]; + unsigned short buf_rb[1024]; + + fp = open("/dev/usrp1_e0", O_RDWR); + printf("fp = %d\n", fp); + + for (i=0; i<1024; i++) + buf[i] = i*256; + write(fp, buf, 2048); + read(fp, buf_rb, 2048); + + printf("Read back %hX %hX\n", buf_rb[0], buf_rb[1]); + + for (i=0; i<1024; i++) { + if (buf[i] != buf_rb[i]) + printf("Read - %hX, expected - %hX\n", buf_rb[i], buf[i]); + } +} -- cgit v1.2.3