From adbe1a0efe7598a9e0433675e2852aad2e280c62 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 29 Jun 2011 10:54:28 -0700 Subject: uhd: loopback working on usrp2 --- host/lib/usrp2/usrp2_impl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'host/lib/usrp2/usrp2_impl.cpp') diff --git a/host/lib/usrp2/usrp2_impl.cpp b/host/lib/usrp2/usrp2_impl.cpp index 50d1eb2e2..e65461103 100644 --- a/host/lib/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp2/usrp2_impl.cpp @@ -437,6 +437,8 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ .subscribe(boost::bind(&usrp2_impl::update_rx_samp_rate, this, _1)); _tree->create(rx_dsp_path / "freq/value") .subscribe_master(boost::bind(&rx_dsp_core_200::set_freq, _mbc[mb].rx_dsps[dspno], _1)); + _tree->create(rx_dsp_path / "freq/range") + .publish(boost::bind(&rx_dsp_core_200::get_freq_range, _mbc[mb].rx_dsps[dspno])); _tree->create(rx_dsp_path / "stream_cmd") .subscribe(boost::bind(&rx_dsp_core_200::issue_stream_command, _mbc[mb].rx_dsps[dspno], _1)); } @@ -454,6 +456,8 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ .subscribe(boost::bind(&usrp2_impl::update_tx_samp_rate, this, _1)); _tree->create(mb_path / "tx_dsps/0/freq/value") .subscribe_master(boost::bind(&usrp2_impl::set_tx_dsp_freq, this, mb, _1)); + _tree->create(mb_path / "tx_dsps/0/freq/range") + .publish(boost::bind(&usrp2_impl::get_tx_dsp_freq_range, this, mb)); //setup dsp flow control const double ups_per_sec = device_args_i.cast("ups_per_sec", 20); @@ -605,6 +609,12 @@ double usrp2_impl::set_tx_dsp_freq(const std::string &mb, const double freq_){ return _mbc[mb].tx_dsp->set_freq(new_freq) + dac_shift; //actual freq } +meta_range_t usrp2_impl::get_tx_dsp_freq_range(const std::string &mb){ + const double tick_rate = _tree->access("/mboards/"+mb+"/tick_rate").get(); + const meta_range_t dsp_range = _mbc[mb].tx_dsp->get_freq_range(); + return meta_range_t(dsp_range.start() - tick_rate*2, dsp_range.stop() + tick_rate*2, dsp_range.step()); +} + void usrp2_impl::update_ref_source(const std::string &mb, const std::string &source){ //clock source ref 10mhz switch(_mbc[mb].iface->get_rev()){ -- cgit v1.2.3