aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/rf_control/nameless_gain_mixin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/rfnoc/rf_control/nameless_gain_mixin.cpp')
-rw-r--r--host/lib/rfnoc/rf_control/nameless_gain_mixin.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/host/lib/rfnoc/rf_control/nameless_gain_mixin.cpp b/host/lib/rfnoc/rf_control/nameless_gain_mixin.cpp
new file mode 100644
index 000000000..d10d01efb
--- /dev/null
+++ b/host/lib/rfnoc/rf_control/nameless_gain_mixin.cpp
@@ -0,0 +1,56 @@
+//
+// Copyright 2021 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#include <uhd/property_tree.hpp>
+#include <uhdlib/rfnoc/rf_control/nameless_gain_mixin.hpp>
+#include <unordered_map>
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace uhd { namespace rfnoc { namespace rf_control {
+
+nameless_gain_mixin::nameless_gain_mixin(name_selector name_selector)
+ : _name_selector(name_selector)
+{
+}
+
+double nameless_gain_mixin::set_tx_gain(const double gain, const size_t chan)
+{
+ const auto name = _name_selector(TX_DIRECTION, chan);
+ return set_tx_gain(gain, name, chan);
+}
+
+double nameless_gain_mixin::get_tx_gain(const size_t chan)
+{
+ const auto name = _name_selector(TX_DIRECTION, chan);
+ return get_tx_gain(name, chan);
+}
+
+double nameless_gain_mixin::set_rx_gain(const double gain, const size_t chan)
+{
+ const auto name = _name_selector(RX_DIRECTION, chan);
+ return set_rx_gain(gain, name, chan);
+}
+
+double nameless_gain_mixin::get_rx_gain(const size_t chan)
+{
+ const auto name = _name_selector(RX_DIRECTION, chan);
+ return get_rx_gain(name, chan);
+}
+
+gain_range_t nameless_gain_mixin::get_tx_gain_range(const size_t chan) const
+{
+ return get_tx_gain_range("", chan);
+}
+
+gain_range_t nameless_gain_mixin::get_rx_gain_range(const size_t chan) const
+{
+ return get_rx_gain_range("", chan);
+}
+
+}}} // namespace uhd::rfnoc::rf_control