aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-05-12 13:52:38 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2020-05-19 13:30:36 -0500
commiteb4bedf3133ce1ed275d03b36839ec61d75f2e60 (patch)
treea04aaa3eda51197e4a7b677203b7b384473aa7f3 /host/lib
parent307e6c5eab88385ba8ad3ab683b99e9e4e62070e (diff)
downloaduhd-eb4bedf3133ce1ed275d03b36839ec61d75f2e60.tar.gz
uhd-eb4bedf3133ce1ed275d03b36839ec61d75f2e60.tar.bz2
uhd-eb4bedf3133ce1ed275d03b36839ec61d75f2e60.zip
twinrx: Provide power cal ID
Note that the TwinRX has a different behaviour if two or one channel are enabled. For that reason, TwinRX requires 8 different sets of calibration data: - For one vs. two channels - For channel 0 and channel 1 - For RX1 and RX2 Since every combination of these settings is possible, that results in 2^3 == 8 combinations. The choice of RX1 vs. RX2 is encoded in the calibration key. The choice of one vs. two channels is also encoded in the calibration key, and is derived using an expert node. Channel 0 and 1 are assumed symmetric, thus, the encoding for those happens in the calibration serial.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/dboard/db_twinrx.cpp3
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_experts.cpp9
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_experts.hpp7
3 files changed, 19 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp
index 258dc95a4..a7c57979d 100644
--- a/host/lib/usrp/dboard/db_twinrx.cpp
+++ b/host/lib/usrp/dboard/db_twinrx.cpp
@@ -195,6 +195,9 @@ public:
prepend_ch("enabled", _ch_name),
false,
AUTO_RESOLVE_ON_WRITE);
+ // ID for cal data lookup. This depends on how many channels are enabled
+ expert_factory::add_prop_node<std::string>(
+ _expert, get_rx_subtree(), "id", prepend_ch("id", _ch_name), "twinrx");
// Readback
get_rx_subtree()
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
index 36bcc1863..d196d99e2 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp
@@ -459,6 +459,15 @@ void twinrx_antenna_expert::resolve()
throw uhd::value_error(
"Cannot calibrate channel 1 and export the LO for channel 0.");
}
+
+ // Set ID for power cal
+ if (_enabled_ch0 and _enabled_ch1) {
+ _id_ch0 = "twinrx2";
+ _id_ch1 = "twinrx2";
+ } else {
+ _id_ch0 = "twinrx";
+ _id_ch1 = "twinrx";
+ }
}
/*!---------------------------------------------------------
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp b/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp
index c7e021a90..9d2269916 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_experts.hpp
@@ -374,6 +374,8 @@ public:
, _lo_export_ch1(db, prepend_ch("los/all/export", "1"))
, _ant_mapping(db, "com/ant_mapping")
, _cal_mode(db, "com/cal_mode")
+ , _id_ch0(db, prepend_ch("id", "0"))
+ , _id_ch1(db, prepend_ch("id", "1"))
{
bind_accessor(_antenna_ch0);
bind_accessor(_antenna_ch1);
@@ -383,6 +385,8 @@ public:
bind_accessor(_lo_export_ch1);
bind_accessor(_ant_mapping);
bind_accessor(_cal_mode);
+ bind_accessor(_id_ch0);
+ bind_accessor(_id_ch1);
}
private:
@@ -398,6 +402,9 @@ private:
// Outputs
experts::data_writer_t<twinrx_ctrl::antenna_mapping_t> _ant_mapping;
experts::data_writer_t<twinrx_ctrl::cal_mode_t> _cal_mode;
+
+ experts::data_writer_t<std::string> _id_ch0;
+ experts::data_writer_t<std::string> _id_ch1;
};
/*!---------------------------------------------------------