aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-06-27 12:00:18 -0700
committerMartin Braun <martin.braun@ettus.com>2017-06-27 12:00:18 -0700
commit5a0be9b1de7be7ba6c266dd742456a96e25373fc (patch)
tree6bcd3b02f399cc2677a6c747411d7e2ced1923f5 /host/lib/usrp/dboard
parente48659cec5207b598d877d8beca7e0b3807b617e (diff)
parent24db48766dff45b8fe8ed3031e09617ca92b84b6 (diff)
downloaduhd-5a0be9b1de7be7ba6c266dd742456a96e25373fc.tar.gz
uhd-5a0be9b1de7be7ba6c266dd742456a96e25373fc.tar.bz2
uhd-5a0be9b1de7be7ba6c266dd742456a96e25373fc.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r--host/lib/usrp/dboard/db_twinrx.cpp2
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp2
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp4
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp4
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_experts.cpp29
5 files changed, 23 insertions, 18 deletions
diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp
index 91b38f90c..cedc26c36 100644
--- a/host/lib/usrp/dboard/db_twinrx.cpp
+++ b/host/lib/usrp/dboard/db_twinrx.cpp
@@ -112,7 +112,7 @@ public:
"los/LO2/freq/value", prepend_ch("los/LO2/freq/desired", _ch_name), prepend_ch("los/LO2/freq/coerced", _ch_name),
0.0, AUTO_RESOLVE_ON_READ_WRITE);
get_rx_subtree()->create<std::vector<std::string> >("los/all/source/options")
- .set(boost::assign::list_of("internal")("external")("companion")("disabled"));
+ .set(boost::assign::list_of("internal")("external")("companion")("disabled")("reimport"));
expert_factory::add_prop_node<std::string>(_expert, get_rx_subtree(),
"los/all/source/value", prepend_ch("los/all/source", _ch_name),
"internal", AUTO_RESOLVE_ON_WRITE);
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp
index 62c5c39fb..fe6eca07b 100644
--- a/host/lib/usrp/dboard/db_xcvr2450.cpp
+++ b/host/lib/usrp/dboard/db_xcvr2450.cpp
@@ -371,7 +371,7 @@ double xcvr2450::set_lo_freq_core(double target_freq){
//variables used in the calculation below
double scaler = xcvr2450::is_highband(target_freq)? (4.0/5.0) : (4.0/3.0);
- double ref_freq = this->get_iface()->get_clock_rate(dboard_iface::UNIT_TX);
+ double ref_freq = this->get_iface()->get_codec_rate(dboard_iface::UNIT_TX);
int R, intdiv = 131, fracdiv = 0;
//loop through values until we get a match
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
index ddbbfaefb..00be82e1a 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
@@ -309,7 +309,7 @@ public:
boost::lock_guard<boost::mutex> lock(_mutex);
if (ch == CH1 or ch == BOTH) {
_cpld_regs->rf1_reg5.set(rm::rf1_reg5_t::SW14_CTRL_CH2, bool2bin(source!=LO_COMPANION));
- _cpld_regs->rf1_reg1.set(rm::rf1_reg1_t::SW15_CTRL_CH1, bool2bin(source==LO_EXTERNAL));
+ _cpld_regs->rf1_reg1.set(rm::rf1_reg1_t::SW15_CTRL_CH1, bool2bin(source==LO_EXTERNAL||source==LO_REIMPORT));
_cpld_regs->rf1_reg1.set(rm::rf1_reg1_t::SW16_CTRL_CH1, bool2bin(source!=LO_INTERNAL));
_lo1_src[size_t(CH1)] = source;
}
@@ -332,7 +332,7 @@ public:
_lo2_src[size_t(CH1)] = source;
}
if (ch == CH2 or ch == BOTH) {
- _cpld_regs->if0_reg4.set(rm::if0_reg4_t::SW19_CTRL_CH1, bool2bin(source==LO_EXTERNAL));
+ _cpld_regs->if0_reg4.set(rm::if0_reg4_t::SW19_CTRL_CH1, bool2bin(source==LO_EXTERNAL||source==LO_REIMPORT));
_cpld_regs->if0_reg0.set(rm::if0_reg0_t::SW20_CTRL_CH2, bool2bin(source==LO_INTERNAL||source==LO_DISABLED));
_cpld_regs->if0_reg4.set(rm::if0_reg4_t::SW21_CTRL_CH2, bool2bin(source==LO_INTERNAL));
_lo2_src[size_t(CH2)] = source;
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp
index 5537d00ab..2439addc4 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.hpp
@@ -35,7 +35,7 @@ public:
virtual ~twinrx_ctrl() {}
- enum channel_t { CH1 = 0, CH2 = 1, BOTH = 2};
+ enum channel_t { CH1 = 0, CH2 = 1, BOTH = 2 };
enum preamp_state_t { PREAMP_LOWBAND, PREAMP_HIGHBAND, PREAMP_BYPASS };
@@ -43,7 +43,7 @@ public:
enum preselector_path_t { PRESEL_PATH1, PRESEL_PATH2, PRESEL_PATH3, PRESEL_PATH4 };
- enum lo_source_t { LO_INTERNAL, LO_EXTERNAL, LO_COMPANION, LO_DISABLED };
+ enum lo_source_t { LO_INTERNAL, LO_EXTERNAL, LO_COMPANION, LO_DISABLED, LO_REIMPORT };
enum lo_export_source_t { LO_CH1_SYNTH, LO_CH2_SYNTH, LO_EXPORT_DISABLED };
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
index 1a66e8fe7..c6a2d42c0 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
@@ -309,17 +309,18 @@ void twinrx_lo_config_expert::resolve()
("internal", twinrx_ctrl::LO_INTERNAL)
("external", twinrx_ctrl::LO_EXTERNAL)
("companion", twinrx_ctrl::LO_COMPANION)
- ("disabled", twinrx_ctrl::LO_DISABLED);
+ ("disabled", twinrx_ctrl::LO_DISABLED)
+ ("reimport", twinrx_ctrl::LO_REIMPORT);
if (src_lookup.has_key(_lo_source_ch0)) {
_lo1_src_ch0 = _lo2_src_ch0 = src_lookup[_lo_source_ch0];
} else {
- throw uhd::value_error("Invalid LO source for channel 0.Choose from {internal, external, companion}");
+ throw uhd::value_error("Invalid LO source for channel 0.Choose from {internal, external, companion, reimport}");
}
if (src_lookup.has_key(_lo_source_ch1)) {
_lo1_src_ch1 = _lo2_src_ch1 = src_lookup[_lo_source_ch1];
} else {
- throw uhd::value_error("Invalid LO source for channel 1.Choose from {internal, external, companion}");
+ throw uhd::value_error("Invalid LO source for channel 1.Choose from {internal, external, companion, reimport}");
}
twinrx_ctrl::lo_export_source_t export_src = twinrx_ctrl::LO_EXPORT_DISABLED;
@@ -329,14 +330,16 @@ void twinrx_lo_config_expert::resolve()
if (_lo_export_ch1 and (_lo_source_ch1 == "external")) {
throw uhd::value_error("Cannot export an external LO for channel 1");
}
+
+ // Determine which channel will provide the exported LO
if (_lo_export_ch0 and _lo_export_ch1) {
throw uhd::value_error("Cannot export LOs for both channels");
} else if (_lo_export_ch0) {
- export_src = (_lo1_src_ch0 == twinrx_ctrl::LO_INTERNAL) ?
- twinrx_ctrl::LO_CH1_SYNTH : twinrx_ctrl::LO_CH2_SYNTH;
- } else if (_lo_export_ch1) {
- export_src = (_lo1_src_ch1 == twinrx_ctrl::LO_INTERNAL) ?
+ export_src = (_lo1_src_ch0 == twinrx_ctrl::LO_COMPANION) ?
twinrx_ctrl::LO_CH2_SYNTH : twinrx_ctrl::LO_CH1_SYNTH;
+ } else if (_lo_export_ch1) {
+ export_src = (_lo1_src_ch1 == twinrx_ctrl::LO_COMPANION) ?
+ twinrx_ctrl::LO_CH1_SYNTH : twinrx_ctrl::LO_CH2_SYNTH;
}
_lo1_export_src = _lo2_export_src = export_src;
}
@@ -351,14 +354,16 @@ void twinrx_lo_mapping_expert::resolve()
static const size_t CH1_MSK = 0x2;
// Determine which channels are "driving" each synthesizer
- // First check for explicit requests i.e. lo_source "internal" or "companion"
+ // First check for explicit requests
+ // "internal" or "reimport" -> this channel
+ // "companion" -> other channel
size_t synth_map[] = {0, 0};
- if (_lox_src_ch0 == twinrx_ctrl::LO_INTERNAL) {
+ if (_lox_src_ch0 == twinrx_ctrl::LO_INTERNAL or _lox_src_ch0 == twinrx_ctrl::LO_REIMPORT) {
synth_map[0] = synth_map[0] | CH0_MSK;
} else if (_lox_src_ch0 == twinrx_ctrl::LO_COMPANION) {
synth_map[1] = synth_map[1] | CH0_MSK;
}
- if (_lox_src_ch1 == twinrx_ctrl::LO_INTERNAL) {
+ if (_lox_src_ch1 == twinrx_ctrl::LO_INTERNAL or _lox_src_ch1 == twinrx_ctrl::LO_REIMPORT) {
synth_map[1] = synth_map[1] | CH1_MSK;
} else if (_lox_src_ch1 == twinrx_ctrl::LO_COMPANION) {
synth_map[0] = synth_map[0] | CH1_MSK;
@@ -370,7 +375,7 @@ void twinrx_lo_mapping_expert::resolve()
// to overlap tuning with signal dwell time.
bool hopping_enabled = false;
if (_lox_src_ch0 == twinrx_ctrl::LO_DISABLED) {
- if (_lox_src_ch1 == twinrx_ctrl::LO_INTERNAL) {
+ if (_lox_src_ch1 == twinrx_ctrl::LO_INTERNAL or _lox_src_ch1 == twinrx_ctrl::LO_REIMPORT) {
synth_map[0] = synth_map[0] | CH0_MSK;
hopping_enabled = true;
} else if (_lox_src_ch1 == twinrx_ctrl::LO_COMPANION) {
@@ -379,7 +384,7 @@ void twinrx_lo_mapping_expert::resolve()
}
}
if (_lox_src_ch1 == twinrx_ctrl::LO_DISABLED) {
- if (_lox_src_ch0 == twinrx_ctrl::LO_INTERNAL) {
+ if (_lox_src_ch0 == twinrx_ctrl::LO_INTERNAL or _lox_src_ch0 == twinrx_ctrl::LO_REIMPORT) {
synth_map[1] = synth_map[1] | CH1_MSK;
hopping_enabled = true;
} else if (_lox_src_ch0 == twinrx_ctrl::LO_COMPANION) {