From 5bd58bc309e959537e3e820abfa39ee629b140a5 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 7 Oct 2014 09:39:25 +0200 Subject: Reorganized firmware/ subdirectory (x300->usrp3, zpu->usrp2) --- firmware/usrp3/include/wb_utils.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 firmware/usrp3/include/wb_utils.h (limited to 'firmware/usrp3/include/wb_utils.h') 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 + +#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 */ -- cgit v1.2.3