USRP Hardware Driver and USRP Manual  Version: 4.6.0.0
UHD and USRP Manual
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>
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 
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 
52 
56 };
57 
58 }}} // namespace uhd::rfnoc::rf_control
virtual double get_tx_gain(const size_t chan)=0
virtual uhd::gain_range_t get_tx_gain_range(const size_t chan) const =0
Definition: build_info.hpp:12
virtual double get_rx_gain(const size_t chan)=0
Definition: core_iface.hpp:25
virtual uhd::gain_range_t get_rx_gain_range(const size_t chan) const =0
virtual double set_rx_gain(const double gain, const size_t chan)=0
#define UHD_API
Definition: config.h:87
Definition: nameless_gain_mixin.hpp:22
Definition: ranges.hpp:65
virtual double set_tx_gain(const double gain, const size_t chan)=0
std::function< std::string(const uhd::direction_t trx, const size_t chan)> name_selector
Definition: nameless_gain_mixin.hpp:26