summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-10-25 19:26:11 -0700
committerJosh Blum <josh@joshknows.com>2011-11-03 20:37:14 -0700
commitdedfa65256470f31a20c99a210457937d3f36056 (patch)
treefff9e4f7d2d1e602343dfe7bbf6400a5e5a48797 /host/lib
parent7f815e124f217f37eb5e612a34ec84c33043aa87 (diff)
downloaduhd-dedfa65256470f31a20c99a210457937d3f36056.tar.gz
uhd-dedfa65256470f31a20c99a210457937d3f36056.tar.bz2
uhd-dedfa65256470f31a20c99a210457937d3f36056.zip
usrp: reorganize frontend paths in tree for correction stuff
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp13
-rw-r--r--host/lib/usrp/e100/e100_impl.cpp13
-rw-r--r--host/lib/usrp/multi_usrp.cpp22
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp5
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp13
5 files changed, 44 insertions, 22 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 0edaac914..944b669b2 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -282,19 +282,22 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
.subscribe(boost::bind(&b100_impl::update_tx_subdev_spec, this, _1));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "rx_frontends" / "dc_offset" / "value")
+ const fs_path rx_fe_path = mb_path / "rx_frontends" / "A";
+ const fs_path tx_fe_path = mb_path / "rx_frontends" / "A";
+
+ _tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&rx_frontend_core_200::set_dc_offset, _rx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<bool>(mb_path / "dboards" / "A" / "rx_frontends" / "dc_offset" / "enable")
+ _tree->create<bool>(rx_fe_path / "dc_offset" / "enable")
.subscribe(boost::bind(&rx_frontend_core_200::set_dc_offset_auto, _rx_fe, _1))
.set(true);
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "rx_frontends" / "iq_balance" / "value")
+ _tree->create<std::complex<double> >(rx_fe_path / "iq_balance" / "value")
.subscribe(boost::bind(&rx_frontend_core_200::set_iq_balance, _rx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "tx_frontends" / "dc_offset" / "value")
+ _tree->create<std::complex<double> >(tx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&tx_frontend_core_200::set_dc_offset, _tx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "tx_frontends" / "iq_balance" / "value")
+ _tree->create<std::complex<double> >(tx_fe_path / "iq_balance" / "value")
.subscribe(boost::bind(&tx_frontend_core_200::set_iq_balance, _tx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp
index 4c5f5f066..064686dd2 100644
--- a/host/lib/usrp/e100/e100_impl.cpp
+++ b/host/lib/usrp/e100/e100_impl.cpp
@@ -256,19 +256,22 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
.subscribe(boost::bind(&e100_impl::update_tx_subdev_spec, this, _1));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "rx_frontends" / "dc_offset" / "value")
+ const fs_path rx_fe_path = mb_path / "rx_frontends" / "A";
+ const fs_path tx_fe_path = mb_path / "rx_frontends" / "A";
+
+ _tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&rx_frontend_core_200::set_dc_offset, _rx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<bool>(mb_path / "dboards" / "A" / "rx_frontends" / "dc_offset" / "enable")
+ _tree->create<bool>(rx_fe_path / "dc_offset" / "enable")
.subscribe(boost::bind(&rx_frontend_core_200::set_dc_offset_auto, _rx_fe, _1))
.set(true);
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "rx_frontends" / "iq_balance" / "value")
+ _tree->create<std::complex<double> >(rx_fe_path / "iq_balance" / "value")
.subscribe(boost::bind(&rx_frontend_core_200::set_iq_balance, _rx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "tx_frontends" / "dc_offset" / "value")
+ _tree->create<std::complex<double> >(tx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&tx_frontend_core_200::set_dc_offset, _tx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "tx_frontends" / "iq_balance" / "value")
+ _tree->create<std::complex<double> >(tx_fe_path / "iq_balance" / "value")
.subscribe(boost::bind(&tx_frontend_core_200::set_iq_balance, _tx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 2e7c76a06..43534ff37 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -548,7 +548,7 @@ public:
void set_rx_dc_offset(const bool enb, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<bool>(rx_rf_fe_root(chan).branch_path() / "dc_offset" / "enable").set(enb);
+ _tree->access<bool>(rx_fe_root(chan) / "dc_offset" / "enable").set(enb);
return;
}
for (size_t c = 0; c < get_rx_num_channels(); c++){
@@ -558,7 +558,7 @@ public:
void set_rx_dc_offset(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(rx_rf_fe_root(chan).branch_path() / "dc_offset" / "value").set(offset);
+ _tree->access<std::complex<double> >(rx_fe_root(chan) / "dc_offset" / "value").set(offset);
return;
}
for (size_t c = 0; c < get_rx_num_channels(); c++){
@@ -568,7 +568,7 @@ public:
void set_rx_iq_balance(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(rx_rf_fe_root(chan).branch_path() / "iq_balance" / "value").set(offset);
+ _tree->access<std::complex<double> >(rx_fe_root(chan) / "iq_balance" / "value").set(offset);
return;
}
for (size_t c = 0; c < get_rx_num_channels(); c++){
@@ -692,7 +692,7 @@ public:
void set_tx_dc_offset(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(tx_rf_fe_root(chan).branch_path() / "dc_offset" / "value").set(offset);
+ _tree->access<std::complex<double> >(tx_fe_root(chan) / "dc_offset" / "value").set(offset);
return;
}
for (size_t c = 0; c < get_tx_num_channels(); c++){
@@ -702,7 +702,7 @@ public:
void set_tx_iq_balance(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(tx_rf_fe_root(chan).branch_path() / "iq_balance" / "value").set(offset);
+ _tree->access<std::complex<double> >(tx_fe_root(chan) / "iq_balance" / "value").set(offset);
return;
}
for (size_t c = 0; c < get_tx_num_channels(); c++){
@@ -758,6 +758,18 @@ private:
return mb_root(mcp.mboard) / "tx_dsps" / name;
}
+ fs_path rx_fe_root(const size_t chan){
+ mboard_chan_pair mcp = rx_chan_to_mcp(chan);
+ const subdev_spec_pair_t spec = get_rx_subdev_spec(mcp.mboard).at(mcp.chan);
+ return mb_root(mcp.mboard) / "rx_frontends" / spec.db_name;
+ }
+
+ fs_path tx_fe_root(const size_t chan){
+ mboard_chan_pair mcp = tx_chan_to_mcp(chan);
+ const subdev_spec_pair_t spec = get_tx_subdev_spec(mcp.mboard).at(mcp.chan);
+ return mb_root(mcp.mboard) / "tx_frontends" / spec.db_name;
+ }
+
fs_path rx_rf_fe_root(const size_t chan){
mboard_chan_pair mcp = rx_chan_to_mcp(chan);
const subdev_spec_pair_t spec = get_rx_subdev_spec(mcp.mboard).at(mcp.chan);
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index fcc4f36ae..6634b43da 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -272,10 +272,11 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
.subscribe(boost::bind(&usrp1_impl::update_tx_subdev_spec, this, _1));
BOOST_FOREACH(const std::string &db, _dbc.keys()){
- _tree->create<std::complex<double> >(mb_path / "dboards" / db / "rx_frontends" / "dc_offset" / "value")
+ const fs_path rx_fe_path = mb_path / "rx_frontends" / db;
+ _tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&usrp1_impl::set_rx_dc_offset, this, db, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<bool>(mb_path / "dboards" / db / "rx_frontends" / "dc_offset" / "enable")
+ _tree->create<bool>(rx_fe_path / "dc_offset" / "enable")
.subscribe(boost::bind(&usrp1_impl::set_enb_rx_dc_offset, this, db, _1))
.set(true);
}
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 50916fb37..db707b6af 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -462,19 +462,22 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){
_tree->create<subdev_spec_t>(mb_path / "tx_subdev_spec")
.subscribe(boost::bind(&usrp2_impl::update_tx_subdev_spec, this, mb, _1));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "rx_frontends" / "dc_offset" / "value")
+ const fs_path rx_fe_path = mb_path / "rx_frontends" / "A";
+ const fs_path tx_fe_path = mb_path / "rx_frontends" / "A";
+
+ _tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&rx_frontend_core_200::set_dc_offset, _mbc[mb].rx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<bool>(mb_path / "dboards" / "A" / "rx_frontends" / "dc_offset" / "enable")
+ _tree->create<bool>(rx_fe_path / "dc_offset" / "enable")
.subscribe(boost::bind(&rx_frontend_core_200::set_dc_offset_auto, _mbc[mb].rx_fe, _1))
.set(true);
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "rx_frontends" / "iq_balance" / "value")
+ _tree->create<std::complex<double> >(rx_fe_path / "iq_balance" / "value")
.subscribe(boost::bind(&rx_frontend_core_200::set_iq_balance, _mbc[mb].rx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "tx_frontends" / "dc_offset" / "value")
+ _tree->create<std::complex<double> >(tx_fe_path / "dc_offset" / "value")
.coerce(boost::bind(&tx_frontend_core_200::set_dc_offset, _mbc[mb].tx_fe, _1))
.set(std::complex<double>(0.0, 0.0));
- _tree->create<std::complex<double> >(mb_path / "dboards" / "A" / "tx_frontends" / "iq_balance" / "value")
+ _tree->create<std::complex<double> >(tx_fe_path / "iq_balance" / "value")
.subscribe(boost::bind(&tx_frontend_core_200::set_iq_balance, _mbc[mb].tx_fe, _1))
.set(std::complex<double>(0.0, 0.0));