aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_regs.hpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-08-10 23:14:20 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-08-10 23:14:20 -0700
commitb5c81677078f56b3e671ebeaca1e3b803c2f4ef9 (patch)
treea1b17b4be203331de7e146e94051f26be5a20102 /host/lib/usrp/x300/x300_regs.hpp
parent16e149fe6fcc1bc18adea3eeeefad2c7ee93b2e0 (diff)
parent28327c8e8a810b19da126116d0dc4c26b643baed (diff)
downloaduhd-b5c81677078f56b3e671ebeaca1e3b803c2f4ef9.tar.gz
uhd-b5c81677078f56b3e671ebeaca1e3b803c2f4ef9.tar.bz2
uhd-b5c81677078f56b3e671ebeaca1e3b803c2f4ef9.zip
Merge branch 'master' into ashish/register_api
Diffstat (limited to 'host/lib/usrp/x300/x300_regs.hpp')
-rw-r--r--host/lib/usrp/x300/x300_regs.hpp67
1 files changed, 37 insertions, 30 deletions
diff --git a/host/lib/usrp/x300/x300_regs.hpp b/host/lib/usrp/x300/x300_regs.hpp
index 350845f28..eba30abb5 100644
--- a/host/lib/usrp/x300/x300_regs.hpp
+++ b/host/lib/usrp/x300/x300_regs.hpp
@@ -18,40 +18,47 @@
#ifndef INCLUDED_X300_REGS_HPP
#define INCLUDED_X300_REGS_HPP
+#include <uhd/config.hpp>
#include <stdint.h>
-#include <boost/cstdint.hpp>
#include <uhd/utils/soft_register.hpp>
-#define TOREG(x) ((x)*4)
+namespace uhd { namespace usrp { namespace radio {
+
+static UHD_INLINE uint32_t sr_addr(const uint32_t offset)
+{
+ return offset * 4;
+}
+
+static const uint32_t DACSYNC = 5;
+static const uint32_t LOOPBACK = 6;
+static const uint32_t TEST = 7;
+static const uint32_t SPI = 8;
+static const uint32_t GPIO = 16;
+static const uint32_t MISC_OUTS = 24;
+static const uint32_t READBACK = 32;
+static const uint32_t TX_CTRL = 64;
+static const uint32_t RX_CTRL = 96;
+static const uint32_t TIME = 128;
+static const uint32_t RX_DSP = 144;
+static const uint32_t TX_DSP = 184;
+static const uint32_t LEDS = 195;
+static const uint32_t FP_GPIO = 200;
+static const uint32_t RX_FRONT = 208;
+static const uint32_t TX_FRONT = 216;
+
+static const uint32_t RB32_GPIO = 0;
+static const uint32_t RB32_SPI = 4;
+static const uint32_t RB64_TIME_NOW = 8;
+static const uint32_t RB64_TIME_PPS = 16;
+static const uint32_t RB32_TEST = 24;
+static const uint32_t RB32_RX = 28;
+static const uint32_t RB32_FP_GPIO = 32;
+static const uint32_t RB32_MISC_INS = 36;
+
+}}} // namespace
#define localparam static const int
-localparam SR_DACSYNC = 5;
-localparam SR_LOOPBACK = 6;
-localparam SR_TEST = 7;
-localparam SR_SPI = 8;
-localparam SR_GPIO = 16;
-localparam SR_MISC_OUTS = 24;
-localparam SR_READBACK = 32;
-localparam SR_TX_CTRL = 64;
-localparam SR_RX_CTRL = 96;
-localparam SR_TIME = 128;
-localparam SR_RX_DSP = 144;
-localparam SR_TX_DSP = 184;
-localparam SR_LEDS = 195;
-localparam SR_FP_GPIO = 200;
-localparam SR_RX_FRONT = 208;
-localparam SR_TX_FRONT = 216;
-
-localparam RB32_GPIO = 0;
-localparam RB32_SPI = 4;
-localparam RB64_TIME_NOW = 8;
-localparam RB64_TIME_PPS = 16;
-localparam RB32_TEST = 24;
-localparam RB32_RX = 28;
-localparam RB32_FP_GPIO = 32;
-localparam RB32_MISC_INS = 36;
-
localparam BL_ADDRESS = 0;
localparam BL_DATA = 1;
@@ -247,7 +254,7 @@ namespace uhd { namespace usrp { namespace x300 {
UHD_DEFINE_SOFT_REG_FIELD(ADC_DATA_DLY_VAL, /*width*/ 5, /*shift*/ 4); //[8:4]
UHD_DEFINE_SOFT_REG_FIELD(ADC_CHECKER_ENABLED, /*width*/ 1, /*shift*/ 9); //[9]
- misc_outs_reg_t(): uhd::soft_reg32_wo_t(TOREG(SR_MISC_OUTS)) {
+ misc_outs_reg_t(): uhd::soft_reg32_wo_t(uhd::usrp::radio::sr_addr(uhd::usrp::radio::MISC_OUTS)) {
//Initial values
set(DAC_ENABLED, 0);
set(DAC_RESET_N, 0);
@@ -269,7 +276,7 @@ namespace uhd { namespace usrp { namespace x300 {
UHD_DEFINE_SOFT_REG_FIELD(ADC_CHECKER1_Q_ERROR, /*width*/ 1, /*shift*/ 6); //[6]
UHD_DEFINE_SOFT_REG_FIELD(ADC_CHECKER1_I_ERROR, /*width*/ 1, /*shift*/ 7); //[7]
- misc_ins_reg_t(): uhd::soft_reg32_ro_t(RB32_MISC_INS) { }
+ misc_ins_reg_t(): uhd::soft_reg32_ro_t(uhd::usrp::radio::RB32_MISC_INS) { }
} misc_ins_reg;
radio_regmap_t(int radio_num) : soft_regmap_t("radio" + boost::lexical_cast<std::string>(radio_num) + "_regmap") {