diff options
author | Josh Blum <josh@joshknows.com> | 2011-11-16 10:36:59 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-16 10:36:59 -0800 |
commit | 65b6acc1ac877849eb6cbe1a654562ca22e42c07 (patch) | |
tree | beca09db5794eb5a797c1c94e6ed4ad523a17f84 /host/lib/usrp/b100 | |
parent | eb11b05298dde8df750e903fe7d791050666278d (diff) | |
parent | 95568c8b30490f630a72b665b135c46549ee5882 (diff) | |
download | uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.gz uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.bz2 uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.zip |
Merge branch 'calibration'
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r-- | host/lib/usrp/b100/b100_impl.cpp | 25 | ||||
-rw-r--r-- | host/lib/usrp/b100/b100_impl.hpp | 2 |
2 files changed, 25 insertions, 2 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp index c506559be..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" @@ -293,13 +294,13 @@ b100_impl::b100_impl(const 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 @@ -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 */ |