diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-02-04 11:04:07 -0800 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-02-04 11:04:07 -0800 |
commit | 178ac3f1c9950d383c8f64b3df464c0f943c4a23 (patch) | |
tree | 318ed621a7b59b7d34d4ce6e4a92f73f0bcef509 /firmware/x300/include/wb_utils.h | |
parent | 2718ac110fa931cc29daf7cb3dc5ab6230ee02ab (diff) | |
download | uhd-178ac3f1c9950d383c8f64b3df464c0f943c4a23.tar.gz uhd-178ac3f1c9950d383c8f64b3df464c0f943c4a23.tar.bz2 uhd-178ac3f1c9950d383c8f64b3df464c0f943c4a23.zip |
Merging USRP X300 and X310 support!!
Diffstat (limited to 'firmware/x300/include/wb_utils.h')
-rw-r--r-- | firmware/x300/include/wb_utils.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/x300/include/wb_utils.h b/firmware/x300/include/wb_utils.h new file mode 100644 index 000000000..34be51b8f --- /dev/null +++ b/firmware/x300/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 */ |