| USRP Hardware Driver and Device Manual Version: 4.10.0.0 UHD and USRP Manual |

Loading...
Searching...
No Matches
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>
10#include <uhd/features/discoverable_feature.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>
19 class UHD_API complex_gain_iface : public discoverable_feature
20{
21 public:
22 using sptr = std::shared_ptr<complex_gain_iface>;
23
24 static discoverable_feature::feature_id_t get_feature_id()
25 {
26 if constexpr (trx == uhd::direction_t::TX_DIRECTION) {
27 return discoverable_feature::TX_COMPLEX_GAIN;
28 } else {
29 return discoverable_feature::RX_COMPLEX_GAIN;
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
73 using tx_complex_gain_iface = complex_gain_iface<uhd::direction_t::TX_DIRECTION>;
74 using rx_complex_gain_iface = complex_gain_iface<uhd::direction_t::RX_DIRECTION>;
75
76}} // namespace uhd::features
uhd::features::complex_gain_iface
Definition complex_gain_iface.hpp:20
uhd::features::complex_gain_iface::get_feature_name
std::string get_feature_name() const
Returns a human-readable string name of this feature.
Definition complex_gain_iface.hpp:33
uhd::features::complex_gain_iface::set_gain_coeff
virtual void set_gain_coeff(const std::complex< double > gain_coeff, const size_t chan, const std::optional< uhd::time_spec_t > time={})=0
uhd::features::complex_gain_iface::sptr
std::shared_ptr< complex_gain_iface > sptr
Definition complex_gain_iface.hpp:22
uhd::features::complex_gain_iface::~complex_gain_iface
virtual ~complex_gain_iface()=default
uhd::features::complex_gain_iface::get_feature_id
static discoverable_feature::feature_id_t get_feature_id()
Definition complex_gain_iface.hpp:24
uhd::features::complex_gain_iface::get_gain_coeff
virtual std::complex< double > get_gain_coeff(const size_t chan)=0
uhd::features::discoverable_feature
Definition discoverable_feature.hpp:26
uhd::features::discoverable_feature::feature_id_t
feature_id_t
An enum of all features supported by the driver. When creating a new.
Definition discoverable_feature.hpp:32
uhd::features::discoverable_feature::RX_COMPLEX_GAIN
@ RX_COMPLEX_GAIN
Definition discoverable_feature.hpp:44
uhd::features::discoverable_feature::TX_COMPLEX_GAIN
@ TX_COMPLEX_GAIN
Definition discoverable_feature.hpp:43
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
direction.hpp
discoverable_feature.hpp
uhd::features
Definition adc_self_calibration_iface.hpp:16
uhd::features::tx_complex_gain_iface
complex_gain_iface< uhd::direction_t::TX_DIRECTION > tx_complex_gain_iface
Definition complex_gain_iface.hpp:73
uhd::features::rx_complex_gain_iface
complex_gain_iface< uhd::direction_t::RX_DIRECTION > rx_complex_gain_iface
Definition complex_gain_iface.hpp:74
uhd
Definition build_info.hpp:12
uhd::TX_DIRECTION
@ TX_DIRECTION
Transmit.
Definition direction.hpp:16
time_spec.hpp