aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/multi_usrp.cpp
diff options
context:
space:
mode:
authorJason Abele <jason@ettus.com>2011-12-13 08:15:02 -0800
committerNicholas Corgan <n.corgan@gmail.com>2012-09-04 11:23:44 -0700
commit5f64270976200206d5395467f2c63eaa7ca86366 (patch)
tree53c756202654f6dd0078c91f34fc0257c0b000b9 /host/lib/usrp/multi_usrp.cpp
parent9d6f94929ebe66d8839441a3ab1c190aac1c1cab (diff)
downloaduhd-5f64270976200206d5395467f2c63eaa7ca86366.tar.gz
uhd-5f64270976200206d5395467f2c63eaa7ca86366.tar.bz2
uhd-5f64270976200206d5395467f2c63eaa7ca86366.zip
First pass at getting tune_request_t to control IF freq in TVRX2
Diffstat (limited to 'host/lib/usrp/multi_usrp.cpp')
-rw-r--r--host/lib/usrp/multi_usrp.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 1267da89c..7f61565fc 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -129,6 +129,9 @@ static tune_result_t tune_xx_subdev_and_dsp(
//------------------------------------------------------------------
double lo_offset = 0.0;
if (rf_fe_subtree->access<bool>("use_lo_offset").get()){
+ //If the frontend has lo_offset value and range properties, trust it for lo_offset
+ if (rf_fe_subtree->exists("lo_offset/value")) lo_offset = rf_fe_subtree->access<double>("lo_offset/value").get();
+
//If the local oscillator will be in the passband, use an offset.
//But constrain the LO offset by the width of the filter bandwidth.
const double rate = dsp_subtree->access<double>("rate/value").get();
@@ -147,6 +150,14 @@ static tune_result_t tune_xx_subdev_and_dsp(
break;
case tune_request_t::POLICY_MANUAL:
+ //If the rf_fe understands lo_offset settings, infer the desired lo_offset and set it
+ // Side effect: In TVRX2 for example, after setting the lo_offset (if_freq) with a
+ // POLICY_MANUAL, there is no way for the user to automatically get back to default
+ // if_freq without deconstruct/reconstruct the rf_fe objects.
+ if (rf_fe_subtree->exists("lo_offset/value")) {
+ rf_fe_subtree->access<double>("lo_offset/value").set(tune_request.rf_freq - tune_request.target_freq);
+ }
+
target_rf_freq = tune_request.rf_freq;
rf_fe_subtree->access<double>("freq/value").set(target_rf_freq);
break;