From 07ba94643ed2cfeed91542e3c1fc59cbdb39a932 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 21 Oct 2011 16:38:27 -0700 Subject: usrp: add api control for tx/rx dc offset control --- host/lib/usrp/multi_usrp.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'host/lib/usrp/multi_usrp.cpp') 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(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 &offset, size_t chan){ + if (chan != ALL_CHANS){ + _tree->access >(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 &offset, size_t chan){ + if (chan != ALL_CHANS){ + _tree->access >(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; -- cgit v1.2.3