| USRP Hardware Driver and USRP Manual Version: 4.9.0.makepkg-0-g9ec1f582 UHD and USRP Manual |

Loading...
Searching...
No Matches
nameless_gain_mixin.hpp
Go to the documentation of this file.
1//
2// Copyright 2021 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/property_tree.hpp>
10#include <uhd/rfnoc/rf_control/core_iface.hpp>
11#include <uhd/types/direction.hpp>
12#include <unordered_map>
13#include <functional>
14#include <memory>
15#include <string>
16#include <vector>
17
18 namespace uhd { namespace rfnoc { namespace rf_control {
19
22 class UHD_API nameless_gain_mixin : virtual public core_iface
23{
24 public:
25 using name_selector =
26 std::function<std::string(const uhd::direction_t trx, const size_t chan)>;
27
32 nameless_gain_mixin(name_selector name_selector);
33
34 virtual ~nameless_gain_mixin() = default;
35
36 double set_tx_gain(const double gain, const size_t chan) override;
37 double get_tx_gain(const size_t chan) override;
38
39 double set_rx_gain(const double gain, const size_t chan) override;
40 double get_rx_gain(const size_t chan) override;
41
42 // Getting the gain ranges is a bit different - these always use the empty name
43 gain_range_t get_tx_gain_range(const size_t chan) const override;
44 gain_range_t get_rx_gain_range(const size_t chan) const override;
45
46 private:
47 name_selector _name_selector;
48
49 using core_iface::get_tx_gain;
50 using core_iface::get_tx_gain_range;
51 using core_iface::set_tx_gain;
52
53 using core_iface::get_rx_gain;
54 using core_iface::get_rx_gain_range;
55 using core_iface::set_rx_gain;
56};
57
58}}} // namespace uhd::rfnoc::rf_control
uhd::rfnoc::rf_control::core_iface
Definition core_iface.hpp:26
uhd::rfnoc::rf_control::core_iface::get_rx_gain
virtual double get_rx_gain(const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::get_tx_gain
virtual double get_tx_gain(const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::set_tx_gain
virtual double set_tx_gain(const double gain, const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::set_rx_gain
virtual double set_rx_gain(const double gain, const size_t chan)=0
uhd::rfnoc::rf_control::core_iface::get_rx_gain_range
virtual uhd::gain_range_t get_rx_gain_range(const size_t chan) const =0
uhd::rfnoc::rf_control::core_iface::get_tx_gain_range
virtual uhd::gain_range_t get_tx_gain_range(const size_t chan) const =0
uhd::rfnoc::rf_control::nameless_gain_mixin::set_tx_gain
double set_tx_gain(const double gain, const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::get_rx_gain
double get_rx_gain(const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::nameless_gain_mixin
nameless_gain_mixin(name_selector name_selector)
uhd::rfnoc::rf_control::nameless_gain_mixin::get_tx_gain
double get_tx_gain(const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::get_rx_gain_range
gain_range_t get_rx_gain_range(const size_t chan) const override
uhd::rfnoc::rf_control::nameless_gain_mixin::name_selector
std::function< std::string(const uhd::direction_t trx, const size_t chan)> name_selector
Definition nameless_gain_mixin.hpp:25
uhd::rfnoc::rf_control::nameless_gain_mixin::set_rx_gain
double set_rx_gain(const double gain, const size_t chan) override
uhd::rfnoc::rf_control::nameless_gain_mixin::~nameless_gain_mixin
virtual ~nameless_gain_mixin()=default
uhd::rfnoc::rf_control::nameless_gain_mixin::get_tx_gain_range
gain_range_t get_tx_gain_range(const size_t chan) const override
UHD_API
#define UHD_API
Definition config.h:87
core_iface.hpp
direction.hpp
uhd::rfnoc::rf_control
Definition antenna_iface.hpp:17
uhd::rfnoc
Definition actions.hpp:24
uhd
Definition build_info.hpp:12
uhd::direction_t
direction_t
Definition direction.hpp:12
uhd::gain_range_t
meta_range_t gain_range_t
Definition ranges.hpp:130
property_tree.hpp