summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-10 20:22:54 -0800
committerJosh Blum <josh@joshknows.com>2011-11-10 20:22:54 -0800
commit8459432067055759bd1d9b04f0e7943f1cf35d2d (patch)
treeb647f54fa9ccbbcd289acc21a8806e940b7a9c4b /host/lib/usrp/usrp2
parent3cb60c974fff6779396294fd456904d1f6addd71 (diff)
downloaduhd-8459432067055759bd1d9b04f0e7943f1cf35d2d.tar.gz
uhd-8459432067055759bd1d9b04f0e7943f1cf35d2d.tar.bz2
uhd-8459432067055759bd1d9b04f0e7943f1cf35d2d.zip
usrp: basically working iq cal on tx
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp12
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.hpp2
2 files changed, 14 insertions, 0 deletions
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 <uhd/utils/log.hpp>
#include <uhd/utils/msg.hpp>
#include <uhd/exception.hpp>
@@ -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<double>(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 <boost/math/special_functions/round.hpp>
#include <boost/math/special_functions/sign.hpp>
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;