summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-15 16:22:18 -0800
committerJosh Blum <josh@joshknows.com>2011-11-15 16:22:18 -0800
commit18abd4dbbf29ec9372bdd2ee83288fc94c20534c (patch)
tree325ce37ad5dbec664bca112c9fae96604fe82073 /host/lib/usrp/b100
parentf68a9271f448a8c8878e2f0fb03b801f345287b3 (diff)
downloaduhd-18abd4dbbf29ec9372bdd2ee83288fc94c20534c.tar.gz
uhd-18abd4dbbf29ec9372bdd2ee83288fc94c20534c.tar.bz2
uhd-18abd4dbbf29ec9372bdd2ee83288fc94c20534c.zip
uhd: support for applying cal corrections B100
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp21
-rw-r--r--host/lib/usrp/b100/b100_impl.hpp2
2 files changed, 23 insertions, 0 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 067fe8d47..7674a0fcf 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include "apply_corrections.hpp"
#include "b100_impl.hpp"
#include "b100_ctrl.hpp"
#include "fpga_regs_standard.h"
@@ -408,6 +409,18 @@ b100_impl::b100_impl(const 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(&b100_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(&b100_impl::set_rx_fe_corrections, this, _1));
+ }
+
//initialize io handling
this->io_init();
@@ -501,3 +514,11 @@ sensor_value_t b100_impl::get_ref_locked(void){
const bool lock = _clock_ctrl->get_locked();
return sensor_value_t("Ref", lock, "locked", "unlocked");
}
+
+void b100_impl::set_rx_fe_corrections(const double lo_freq){
+ apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+}
+
+void b100_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/b100/b100_impl.hpp b/host/lib/usrp/b100/b100_impl.hpp
index 0984260be..96d90b14c 100644
--- a/host/lib/usrp/b100/b100_impl.hpp
+++ b/host/lib/usrp/b100/b100_impl.hpp
@@ -125,6 +125,8 @@ private:
void clear_fpga_fifo(void);
void handle_async_message(uhd::transport::managed_recv_buffer::sptr);
uhd::sensor_value_t get_ref_locked(void);
+ void set_rx_fe_corrections(const double);
+ void set_tx_fe_corrections(const double);
};
#endif /* INCLUDED_b100_IMPL_HPP */