USRP Hardware Driver and Device Manual  Version: 4.10.0.0-0-g2af4ddb9
UHD and USRP Manual
complex_gain_iface.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2025 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/config.hpp>
11 #include <uhd/types/direction.hpp>
12 #include <uhd/types/time_spec.hpp>
13 #include <complex>
14 #include <optional>
15 
16 namespace uhd { namespace features {
17 
18 template <uhd::direction_t trx>
20 {
21 public:
22  using sptr = std::shared_ptr<complex_gain_iface>;
23 
25  {
26  if constexpr (trx == uhd::direction_t::TX_DIRECTION) {
28  } else {
30  }
31  }
32 
33  std::string get_feature_name() const
34  {
35  if constexpr (trx == uhd::direction_t::TX_DIRECTION) {
36  return "TX Complex Gain";
37  } else {
38  return "RX Complex Gain";
39  }
40  }
41 
42  virtual ~complex_gain_iface() = default;
43 
64  virtual void set_gain_coeff(const std::complex<double> gain_coeff,
65  const size_t chan,
66  const std::optional<uhd::time_spec_t> time = {}) = 0;
67 
70  virtual std::complex<double> get_gain_coeff(const size_t chan) = 0;
71 };
72 
75 
76 }} // namespace uhd::features
Definition: complex_gain_iface.hpp:20
std::string get_feature_name() const
Returns a human-readable string name of this feature.
Definition: complex_gain_iface.hpp:33
virtual void set_gain_coeff(const std::complex< double > gain_coeff, const size_t chan, const std::optional< uhd::time_spec_t > time={})=0
std::shared_ptr< complex_gain_iface > sptr
Definition: complex_gain_iface.hpp:22
virtual std::complex< double > get_gain_coeff(const size_t chan)=0
virtual ~complex_gain_iface()=default
static discoverable_feature::feature_id_t get_feature_id()
Definition: complex_gain_iface.hpp:24
Definition: discoverable_feature.hpp:26
feature_id_t
An enum of all features supported by the driver. When creating a new.
Definition: discoverable_feature.hpp:32
@ RX_COMPLEX_GAIN
Definition: discoverable_feature.hpp:44
@ TX_COMPLEX_GAIN
Definition: discoverable_feature.hpp:43
#define UHD_API
Definition: config.h:87
Definition: build_info.hpp:12
@ TX_DIRECTION
Transmit.
Definition: direction.hpp:16