summaryrefslogtreecommitdiff
path: root/gr-uhd/lib
diff options
context:
space:
mode:
authorJosh Blum2011-10-24 11:31:59 -0700
committerJosh Blum2011-11-07 18:56:28 -0800
commit9058109de812a5a8c45a180131531b5ad10a9d7a (patch)
tree32c5e382a2671d166eb614285cb37d6d57142dc1 /gr-uhd/lib
parent8e60469acd6be356c64bfb27f58b393f3dd361cf (diff)
downloadgnuradio-9058109de812a5a8c45a180131531b5ad10a9d7a.tar.gz
gnuradio-9058109de812a5a8c45a180131531b5ad10a9d7a.tar.bz2
gnuradio-9058109de812a5a8c45a180131531b5ad10a9d7a.zip
uhd: added set for RX/TX iq balance and dc offset
Diffstat (limited to 'gr-uhd/lib')
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc20
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc28
2 files changed, 44 insertions, 4 deletions
diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc
index cd40dac20..cb17119b7 100644
--- a/gr-uhd/lib/gr_uhd_usrp_sink.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc
@@ -142,11 +142,27 @@ public:
return _dev->set_tx_bandwidth(bandwidth, chan);
}
- uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan){
+ void set_dc_offset(const std::complex<double> &offset, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_tx_dc_offset(offset, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ void set_iq_balance(const std::complex<double> &correction, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_tx_iq_balance(correction, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ uhd::sensor_value_t get_sensor(const std::string &name, size_t chan){
return _dev->get_tx_sensor(name, chan);
}
- std::vector<std::string> get_dboard_sensor_names(size_t chan){
+ std::vector<std::string> get_sensor_names(size_t chan){
return _dev->get_tx_sensor_names(chan);
}
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index 4f46fce79..421adafe1 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -146,11 +146,35 @@ public:
return _dev->set_rx_bandwidth(bandwidth, chan);
}
- uhd::sensor_value_t get_dboard_sensor(const std::string &name, size_t chan){
+ void set_dc_offset(const bool enable, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_rx_dc_offset(enable, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ void set_dc_offset(const std::complex<double> &offset, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_rx_dc_offset(offset, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ void set_iq_balance(const std::complex<double> &correction, size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
+ return _dev->set_rx_iq_balance(correction, chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+ uhd::sensor_value_t get_sensor(const std::string &name, size_t chan){
return _dev->get_rx_sensor(name, chan);
}
- std::vector<std::string> get_dboard_sensor_names(size_t chan){
+ std::vector<std::string> get_sensor_names(size_t chan){
return _dev->get_rx_sensor_names(chan);
}