Loading [MathJax]/extensions/tex2jax.js
USRP Hardware Driver and USRP Manual  Version: 4.8.0.0
UHD and USRP Manual
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
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 
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::zbx_tx_dsa_cal::sptr
std::shared_ptr< zbx_tx_dsa_cal > sptr
Definition: dsa_cal.hpp:30
config.hpp
uhd::usrp::cal::zbx_rx_dsa_cal::sptr
std::shared_ptr< zbx_rx_dsa_cal > sptr
Definition: dsa_cal.hpp:86
UHD_API
#define UHD_API
Definition: config.h:87
uhd::usrp::cal::zbx_rx_dsa_cal
Definition: dsa_cal.hpp:80
uhd::usrp::cal::zbx_tx_dsa_cal
Definition: dsa_cal.hpp:23
uhd
Definition: build_info.hpp:12
uhd::usrp::cal::zbx_tx_dsa_cal::step_settings
std::array< uint32_t, NUM_DSA > step_settings
Definition: dsa_cal.hpp:31
container.hpp
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::container
Definition: container.hpp:22