aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/usrp3/include/wb_utils.h
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2014-10-07 09:39:25 +0200
committerMartin Braun <martin.braun@ettus.com>2014-10-07 09:39:25 +0200
commit5bd58bc309e959537e3e820abfa39ee629b140a5 (patch)
tree81e3a611134e02d9118f0aa846b7146234849fe8 /firmware/usrp3/include/wb_utils.h
parent9f6a11173aef5e661100268bd746963d713adb91 (diff)
downloaduhd-5bd58bc309e959537e3e820abfa39ee629b140a5.tar.gz
uhd-5bd58bc309e959537e3e820abfa39ee629b140a5.tar.bz2
uhd-5bd58bc309e959537e3e820abfa39ee629b140a5.zip
Reorganized firmware/ subdirectory (x300->usrp3, zpu->usrp2)
Diffstat (limited to 'firmware/usrp3/include/wb_utils.h')
-rw-r--r--firmware/usrp3/include/wb_utils.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/usrp3/include/wb_utils.h b/firmware/usrp3/include/wb_utils.h
new file mode 100644
index 000000000..34be51b8f
--- /dev/null
+++ b/firmware/usrp3/include/wb_utils.h
@@ -0,0 +1,24 @@
+
+// Copyright 2012 Ettus Research LLC
+
+#ifndef INCLUDED_WB_UTILS_H
+#define INCLUDED_WB_UTILS_H
+
+#include <stdint.h>
+
+#define localparam static const int
+
+static inline void wb_poke32(const uint32_t addr, const uint32_t data)
+{
+ *((volatile uint32_t *)addr) = data;
+}
+
+static inline uint32_t wb_peek32(const uint32_t addr)
+{
+ const uint32_t data = *((volatile uint32_t *)addr);
+ return data;
+}
+
+#define SR_ADDR(base, offset) ((base) + (offset)*4)
+
+#endif /* INCLUDED_WB_UTILS_H */