aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-10-21 16:38:27 -0700
committerJosh Blum <josh@joshknows.com>2011-11-03 20:37:13 -0700
commit07ba94643ed2cfeed91542e3c1fc59cbdb39a932 (patch)
tree0203eb83489e5c0bddd696c84c4285e51b36b23f /host/lib
parentae9e89d76b2eb86a29995f04aaab1aa59ee93f04 (diff)
downloaduhd-07ba94643ed2cfeed91542e3c1fc59cbdb39a932.tar.gz
uhd-07ba94643ed2cfeed91542e3c1fc59cbdb39a932.tar.bz2
uhd-07ba94643ed2cfeed91542e3c1fc59cbdb39a932.zip
usrp: add api control for tx/rx dc offset control
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/multi_usrp.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 97c5ea630..5fff989ce 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -547,6 +547,26 @@ public:
return _tree->list(rx_rf_fe_root(chan) / "sensors");
}
+ void set_rx_dc_offset(const bool enb, size_t chan){
+ if (chan != ALL_CHANS){
+ _tree->access<bool>(rx_rf_fe_root(chan).branch_path() / "dc_offset" / "enable").set(enb);
+ return;
+ }
+ for (size_t c = 0; c < get_rx_num_channels(); c++){
+ this->set_rx_dc_offset(enb, c);
+ }
+ }
+
+ void set_rx_dc_offset(const std::complex<double> &offset, size_t chan){
+ if (chan != ALL_CHANS){
+ _tree->access<std::complex<double> >(rx_rf_fe_root(chan).branch_path() / "dc_offset" / "value").set(offset);
+ return;
+ }
+ for (size_t c = 0; c < get_rx_num_channels(); c++){
+ this->set_rx_dc_offset(offset, c);
+ }
+ }
+
/*******************************************************************
* TX methods
******************************************************************/
@@ -661,6 +681,16 @@ public:
return _tree->list(tx_rf_fe_root(chan) / "sensors");
}
+ void set_tx_dc_offset(const std::complex<double> &offset, size_t chan){
+ if (chan != ALL_CHANS){
+ _tree->access<std::complex<double> >(tx_rf_fe_root(chan).branch_path() / "dc_offset" / "value").set(offset);
+ return;
+ }
+ for (size_t c = 0; c < get_tx_num_channels(); c++){
+ this->set_tx_dc_offset(offset, c);
+ }
+ }
+
private:
device::sptr _dev;
property_tree::sptr _tree;