USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
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
core_iface.hpp
property_tree.hpp
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:26
uhd::rfnoc::rf_control::nameless_gain_mixin
Definition: nameless_gain_mixin.hpp:22
UHD_API
#define UHD_API
Definition: config.h:87
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
Definition: core_iface.hpp:25
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
Definition: build_info.hpp:12
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::set_tx_gain
virtual double set_tx_gain(const double 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
direction.hpp
uhd::rfnoc::rf_control::core_iface::set_rx_gain
virtual double set_rx_gain(const double gain, const size_t chan)=0
uhd::meta_range_t
Definition: ranges.hpp:65
uhd::direction_t
direction_t
Definition: direction.hpp:12