aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common
diff options
context:
space:
mode:
authorNicolas Cuervo <nicolas.cuervo@ettus.com>2016-08-09 18:29:08 -0700
committerMartin Braun <martin.braun@ettus.com>2016-08-11 15:32:35 -0700
commit00c70d7155e40e59c7635b5aecc2993ca3f4ae5e (patch)
tree6a05f2713dad9219e7a0d5208db89a857ada7a29 /host/lib/usrp/common
parentbf6adfaf6f4b391ea74639133a6a00b0ca7fcfa0 (diff)
downloaduhd-00c70d7155e40e59c7635b5aecc2993ca3f4ae5e.tar.gz
uhd-00c70d7155e40e59c7635b5aecc2993ca3f4ae5e.tar.bz2
uhd-00c70d7155e40e59c7635b5aecc2993ca3f4ae5e.zip
Frontend corrections: Provide new function for RFNoC-based radio
Diffstat (limited to 'host/lib/usrp/common')
-rw-r--r--host/lib/usrp/common/apply_corrections.cpp51
-rw-r--r--host/lib/usrp/common/apply_corrections.hpp16
2 files changed, 64 insertions, 3 deletions
diff --git a/host/lib/usrp/common/apply_corrections.cpp b/host/lib/usrp/common/apply_corrections.cpp
index 3d33e7d11..272e0e093 100644
--- a/host/lib/usrp/common/apply_corrections.cpp
+++ b/host/lib/usrp/common/apply_corrections.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2016 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -144,6 +144,34 @@ static void apply_fe_corrections(
/***********************************************************************
* Wrapper routines with nice try/catch + print
**********************************************************************/
+void uhd::usrp::apply_tx_fe_corrections( //overloading to work according to rfnoc tree struct
+ property_tree::sptr sub_tree, //starts at mboards/x
+ const uhd::fs_path db_path,
+ const uhd::fs_path tx_fe_corr_path,
+ const double lo_freq //actual lo freq
+){
+ boost::mutex::scoped_lock l(corrections_mutex);
+ try{
+ apply_fe_corrections(
+ sub_tree,
+ db_path + "/tx_eeprom",
+ tx_fe_corr_path + "/iq_balance/value",
+ "tx_iq_cal_v0.2_",
+ lo_freq
+ );
+ apply_fe_corrections(
+ sub_tree,
+ db_path + "/tx_eeprom",
+ tx_fe_corr_path + "/dc_offset/value",
+ "tx_dc_cal_v0.2_",
+ lo_freq
+ );
+ }
+ catch(const std::exception &e){
+ UHD_MSG(error) << "Failure in apply_tx_fe_corrections: " << e.what() << std::endl;
+ }
+}
+
void uhd::usrp::apply_tx_fe_corrections(
property_tree::sptr sub_tree, //starts at mboards/x
const std::string &slot, //name of dboard slot
@@ -171,6 +199,27 @@ void uhd::usrp::apply_tx_fe_corrections(
}
}
+void uhd::usrp::apply_rx_fe_corrections( //overloading to work according to rfnoc tree struct
+ property_tree::sptr sub_tree, //starts at mboards/x
+ const uhd::fs_path db_path,
+ const uhd::fs_path rx_fe_corr_path,
+ const double lo_freq //actual lo freq
+){
+ boost::mutex::scoped_lock l(corrections_mutex);
+ try{
+ apply_fe_corrections(
+ sub_tree,
+ db_path + "/rx_eeprom",
+ rx_fe_corr_path + "/iq_balance/value",
+ "rx_iq_cal_v0.2_",
+ lo_freq
+ );
+ }
+ catch(const std::exception &e){
+ UHD_MSG(error) << "Failure in apply_tx_fe_corrections: " << e.what() << std::endl;
+ }
+}
+
void uhd::usrp::apply_rx_fe_corrections(
property_tree::sptr sub_tree, //starts at mboards/x
const std::string &slot, //name of dboard slot
diff --git a/host/lib/usrp/common/apply_corrections.hpp b/host/lib/usrp/common/apply_corrections.hpp
index c516862d1..0ab5377f3 100644
--- a/host/lib/usrp/common/apply_corrections.hpp
+++ b/host/lib/usrp/common/apply_corrections.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2016 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,16 +26,28 @@ namespace uhd{ namespace usrp{
void apply_tx_fe_corrections(
property_tree::sptr sub_tree, //starts at mboards/x
- const std::string &slot, //name of dboard slot
+ const fs_path db_path,
+ const fs_path tx_fe_corr_path,
const double tx_lo_freq //actual lo freq
);
+ void apply_tx_fe_corrections(
+ property_tree::sptr sub_tree, //starts at mboards/x
+ const std::string &slot, //name of dboard slot
+ const double tx_lo_freq //actual lo freq
+ );
void apply_rx_fe_corrections(
property_tree::sptr sub_tree, //starts at mboards/x
const std::string &slot, //name of dboard slot
const double rx_lo_freq //actual lo freq
);
+ void apply_rx_fe_corrections(
+ property_tree::sptr sub_tree, //starts at mboards/x
+ const fs_path db_path,
+ const fs_path rx_fe_corr_path,
+ const double rx_lo_freq //actual lo freq
+ );
}} //namespace uhd::usrp
#endif /* INCLUDED_LIBUHD_USRP_COMMON_APPLY_CORRECTIONS_HPP */