aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/e100
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-16 10:36:59 -0800
committerJosh Blum <josh@joshknows.com>2011-11-16 10:36:59 -0800
commit65b6acc1ac877849eb6cbe1a654562ca22e42c07 (patch)
treebeca09db5794eb5a797c1c94e6ed4ad523a17f84 /host/lib/usrp/e100
parenteb11b05298dde8df750e903fe7d791050666278d (diff)
parent95568c8b30490f630a72b665b135c46549ee5882 (diff)
downloaduhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.gz
uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.bz2
uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.zip
Merge branch 'calibration'
Diffstat (limited to 'host/lib/usrp/e100')
-rw-r--r--host/lib/usrp/e100/e100_impl.cpp25
-rw-r--r--host/lib/usrp/e100/e100_impl.hpp2
2 files changed, 25 insertions, 2 deletions
diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp
index c0a8f46f3..8b7756461 100644
--- a/host/lib/usrp/e100/e100_impl.cpp
+++ b/host/lib/usrp/e100/e100_impl.cpp
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include "apply_corrections.hpp"
#include "e100_impl.hpp"
#include "e100_regs.hpp"
#include <uhd/utils/msg.hpp>
@@ -259,13 +260,13 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
.set(true);
_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));
+ .set(std::polar<double>(1.0, 0.0));
_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> >(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));
+ .set(std::polar<double>(1.0, 0.0));
////////////////////////////////////////////////////////////////////
// create rx dsp control objects
@@ -374,6 +375,18 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
_dboard_iface, _tree->subtree(mb_path / "dboards/A")
);
+ //bind frontend corrections to the dboard freq props
+ const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends";
+ BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)){
+ _tree->access<double>(db_tx_fe_path / name / "freq" / "value")
+ .subscribe(boost::bind(&e100_impl::set_tx_fe_corrections, this, _1));
+ }
+ const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends";
+ BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)){
+ _tree->access<double>(db_rx_fe_path / name / "freq" / "value")
+ .subscribe(boost::bind(&e100_impl::set_rx_fe_corrections, this, _1));
+ }
+
//initialize io handling
this->io_init();
@@ -450,3 +463,11 @@ void e100_impl::check_fpga_compat(void){
}
_tree->create<std::string>("/mboards/0/fpga_version").set(str(boost::format("%u.%u") % fpga_major % fpga_minor));
}
+
+void e100_impl::set_rx_fe_corrections(const double lo_freq){
+ apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+}
+
+void e100_impl::set_tx_fe_corrections(const double lo_freq){
+ apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+}
diff --git a/host/lib/usrp/e100/e100_impl.hpp b/host/lib/usrp/e100/e100_impl.hpp
index f3e481b93..2ea890375 100644
--- a/host/lib/usrp/e100/e100_impl.hpp
+++ b/host/lib/usrp/e100/e100_impl.hpp
@@ -130,6 +130,8 @@ private:
void update_clock_source(const std::string &);
uhd::sensor_value_t get_ref_locked(void);
void check_fpga_compat(void);
+ void set_rx_fe_corrections(const double);
+ void set_tx_fe_corrections(const double);
};