From 8459432067055759bd1d9b04f0e7943f1cf35d2d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 10 Nov 2011 20:22:54 -0800 Subject: usrp: basically working iq cal on tx --- host/lib/usrp/usrp2/usrp2_impl.cpp | 12 ++++++++++++ host/lib/usrp/usrp2/usrp2_impl.hpp | 2 ++ 2 files changed, 14 insertions(+) (limited to 'host/lib/usrp/usrp2') diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index bb3bfc7e4..6170948ca 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -17,6 +17,7 @@ #include "usrp2_impl.hpp" #include "fw_common.h" +#include "apply_corrections.hpp" #include #include #include @@ -600,6 +601,13 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ rx_db_eeprom.id, tx_db_eeprom.id, gdb_eeprom.id, _mbc[mb].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(db_tx_fe_path / name / "freq" / "value") + .subscribe(boost::bind(&usrp2_impl::set_tx_fe_corrections, this, mb, _1)); + } } //initialize io handling @@ -653,6 +661,10 @@ sensor_value_t usrp2_impl::get_ref_locked(const std::string &mb){ return sensor_value_t("Ref", lock, "locked", "unlocked"); } +void usrp2_impl::set_tx_fe_corrections(const std::string &mb, const double tx_lo_freq){ + apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/" + mb), "A", tx_lo_freq); +} + #include #include diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 535397d84..74ef3d460 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -106,6 +106,8 @@ private: uhd::sensor_value_t get_mimo_locked(const std::string &); uhd::sensor_value_t get_ref_locked(const std::string &); + void set_tx_fe_corrections(const std::string &mb, const double tx_lo_freq); + //device properties interface uhd::property_tree::sptr get_tree(void) const{ return _tree; -- cgit v1.2.3