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

Loading...
Searching...
No Matches
dsa_cal.hpp
Go to the documentation of this file.
1//
2// Copyright 2020 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#ifndef INCLUDED_LIBUHD_CAL_GAIN_HPP
8#define INCLUDED_LIBUHD_CAL_GAIN_HPP
9
10#include <uhd/cal/container.hpp>
11#include <uhd/config.hpp>
12#include <array>
13#include <cstddef>
14#include <cstdint>
15#include <memory>
16#include <string>
17#include <vector>
18
19 namespace uhd { namespace usrp { namespace cal {
20
23 class UHD_API zbx_tx_dsa_cal : public container
24{
25 public:
26 static constexpr uint32_t NUM_AMP = 1;
27 static constexpr uint32_t NUM_DSA = 2 + NUM_AMP;
28 static constexpr uint32_t NUM_GAIN_STAGES = 61;
29
30 using sptr = std::shared_ptr<zbx_tx_dsa_cal>;
31 using step_settings = std::array<uint32_t, NUM_DSA>;
32
40 virtual void add_frequency_band(const double max_freq,
41 const std::string& name,
42 std::array<step_settings, NUM_GAIN_STAGES> dsa_steps) = 0;
43
52 virtual const step_settings get_dsa_setting(
53 const double freq, const size_t gain_index) const = 0;
54
55 /* Check whether two frequencies map to the same band.
56 */
57 virtual bool is_same_band(double freq1, double freq2) const = 0;
58
63 virtual std::vector<uint32_t> get_band_settings(double freq, uint8_t dsa) const = 0;
64
68 virtual void clear() = 0;
69
71 static sptr make(
72 const std::string& name, const std::string& serial, const uint64_t timestamp);
73
75 static sptr make();
76};
77
80 class UHD_API zbx_rx_dsa_cal : public container
81{
82 public:
83 static constexpr uint32_t NUM_DSA = 4;
84 static constexpr uint32_t NUM_GAIN_STAGES = 61;
85
86 using sptr = std::shared_ptr<zbx_rx_dsa_cal>;
87 using step_settings = std::array<uint32_t, NUM_DSA>;
88
96 virtual void add_frequency_band(const double max_freq,
97 const std::string& name,
98 std::array<step_settings, NUM_GAIN_STAGES> dsa_steps) = 0;
99
100 virtual bool is_same_band(double freq1, double freq2) const = 0;
109 virtual const step_settings get_dsa_setting(
110 const double freq, const size_t gain_index) const = 0;
111
116 virtual std::vector<uint32_t> get_band_settings(double freq, uint8_t dsa) const = 0;
117
121 virtual void clear() = 0;
122
124 static sptr make(
125 const std::string& name, const std::string& serial, const uint64_t timestamp);
126
128 static sptr make();
129};
130
131}}} // namespace uhd::usrp::cal
132
133#endif /* INCLUDED_LIBUHD_CAL_GAIN_HPP */
uhd::usrp::cal::container
Definition container.hpp:23
uhd::usrp::cal::zbx_rx_dsa_cal
Definition dsa_cal.hpp:81
uhd::usrp::cal::zbx_rx_dsa_cal::make
static sptr make(const std::string &name, const std::string &serial, const uint64_t timestamp)
Factory for new cal data sets.
uhd::usrp::cal::zbx_rx_dsa_cal::get_dsa_setting
virtual const step_settings get_dsa_setting(const double freq, const size_t gain_index) const =0
uhd::usrp::cal::zbx_rx_dsa_cal::make
static sptr make()
Default factory.
uhd::usrp::cal::zbx_rx_dsa_cal::add_frequency_band
virtual void add_frequency_band(const double max_freq, const std::string &name, std::array< step_settings, NUM_GAIN_STAGES > dsa_steps)=0
uhd::usrp::cal::zbx_rx_dsa_cal::get_band_settings
virtual std::vector< uint32_t > get_band_settings(double freq, uint8_t dsa) const =0
uhd::usrp::cal::zbx_rx_dsa_cal::NUM_GAIN_STAGES
static constexpr uint32_t NUM_GAIN_STAGES
Definition dsa_cal.hpp:84
uhd::usrp::cal::zbx_rx_dsa_cal::is_same_band
virtual bool is_same_band(double freq1, double freq2) const =0
uhd::usrp::cal::zbx_rx_dsa_cal::step_settings
std::array< uint32_t, NUM_DSA > step_settings
Definition dsa_cal.hpp:87
uhd::usrp::cal::zbx_rx_dsa_cal::clear
virtual void clear()=0
uhd::usrp::cal::zbx_rx_dsa_cal::sptr
std::shared_ptr< zbx_rx_dsa_cal > sptr
Definition dsa_cal.hpp:86
uhd::usrp::cal::zbx_rx_dsa_cal::NUM_DSA
static constexpr uint32_t NUM_DSA
Definition dsa_cal.hpp:83
uhd::usrp::cal::zbx_tx_dsa_cal
Definition dsa_cal.hpp:24
uhd::usrp::cal::zbx_tx_dsa_cal::make
static sptr make(const std::string &name, const std::string &serial, const uint64_t timestamp)
Factory for new cal data sets.
uhd::usrp::cal::zbx_tx_dsa_cal::NUM_GAIN_STAGES
static constexpr uint32_t NUM_GAIN_STAGES
Definition dsa_cal.hpp:28
uhd::usrp::cal::zbx_tx_dsa_cal::clear
virtual void clear()=0
uhd::usrp::cal::zbx_tx_dsa_cal::step_settings
std::array< uint32_t, NUM_DSA > step_settings
Definition dsa_cal.hpp:31
uhd::usrp::cal::zbx_tx_dsa_cal::add_frequency_band
virtual void add_frequency_band(const double max_freq, const std::string &name, std::array< step_settings, NUM_GAIN_STAGES > dsa_steps)=0
uhd::usrp::cal::zbx_tx_dsa_cal::NUM_AMP
static constexpr uint32_t NUM_AMP
Definition dsa_cal.hpp:26
uhd::usrp::cal::zbx_tx_dsa_cal::is_same_band
virtual bool is_same_band(double freq1, double freq2) const =0
uhd::usrp::cal::zbx_tx_dsa_cal::get_band_settings
virtual std::vector< uint32_t > get_band_settings(double freq, uint8_t dsa) const =0
uhd::usrp::cal::zbx_tx_dsa_cal::get_dsa_setting
virtual const step_settings get_dsa_setting(const double freq, const size_t gain_index) const =0
uhd::usrp::cal::zbx_tx_dsa_cal::sptr
std::shared_ptr< zbx_tx_dsa_cal > sptr
Definition dsa_cal.hpp:30
uhd::usrp::cal::zbx_tx_dsa_cal::NUM_DSA
static constexpr uint32_t NUM_DSA
Definition dsa_cal.hpp:27
uhd::usrp::cal::zbx_tx_dsa_cal::make
static sptr make()
Default factory.
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
container.hpp
uhd::usrp::cal
Definition cal_utils.hpp:11
uhd::usrp
Definition cal_utils.hpp:11
uhd
Definition build_info.hpp:12