From 95568c8b30490f630a72b665b135c46549ee5882 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 16 Nov 2011 06:39:31 +0000 Subject: e100: added self-cal support with minor speedups --- host/lib/usrp/e100/e100_impl.cpp | 21 +++++++++++++++++++++ host/lib/usrp/e100/e100_impl.hpp | 2 ++ 2 files changed, 23 insertions(+) (limited to 'host/lib/usrp/e100') diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp index 7804f7fd8..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 . // +#include "apply_corrections.hpp" #include "e100_impl.hpp" #include "e100_regs.hpp" #include @@ -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(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(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("/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); }; -- cgit v1.2.3