aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-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
3 files changed, 21 insertions, 16 deletions
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
index 346f39589..3bb5931bc 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 3b41972da..f4a1b8ac4 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
@@ -308,17 +308,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;
@@ -328,14 +329,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;
}
@@ -350,14 +353,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;
@@ -369,7 +374,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) {
@@ -378,7 +383,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) {