USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
UHD and USRP Manual
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 <boost/optional.hpp>
13 #include <array>
14 #include <map>
15 
16 namespace uhd { namespace usrp { namespace cal {
17 
21 {
22 public:
23  static constexpr uint32_t NUM_AMP = 1;
24  static constexpr uint32_t NUM_DSA = 2 + NUM_AMP;
25  static constexpr uint32_t NUM_GAIN_STAGES = 61;
26 
27  using sptr = std::shared_ptr<zbx_tx_dsa_cal>;
28  using step_settings = std::array<uint32_t, NUM_DSA>;
29 
37  virtual void add_frequency_band(const double max_freq,
38  const std::string& name,
39  std::array<step_settings, NUM_GAIN_STAGES> dsa_steps) = 0;
40 
49  virtual const step_settings get_dsa_setting(
50  const double freq, const size_t gain_index) const = 0;
51 
52  /* Check whether two frequencies map to the same band.
53  */
54  virtual bool is_same_band(double freq1, double freq2) const = 0;
55 
60  virtual std::vector<uint32_t> get_band_settings(double freq, uint8_t dsa) const = 0;
61 
65  virtual void clear() = 0;
66 
68  static sptr make(
69  const std::string& name, const std::string& serial, const uint64_t timestamp);
70 
72  static sptr make();
73 };
74 
78 {
79 public:
80  static constexpr uint32_t NUM_DSA = 4;
81  static constexpr uint32_t NUM_GAIN_STAGES = 61;
82 
83  using sptr = std::shared_ptr<zbx_rx_dsa_cal>;
84  using step_settings = std::array<uint32_t, NUM_DSA>;
85 
93  virtual void add_frequency_band(const double max_freq,
94  const std::string& name,
95  std::array<step_settings, NUM_GAIN_STAGES> dsa_steps) = 0;
96 
97  virtual bool is_same_band(double freq1, double freq2) const = 0;
106  virtual const step_settings get_dsa_setting(
107  const double freq, const size_t gain_index) const = 0;
108 
113  virtual std::vector<uint32_t> get_band_settings(double freq, uint8_t dsa) const = 0;
114 
118  virtual void clear() = 0;
119 
121  static sptr make(
122  const std::string& name, const std::string& serial, const uint64_t timestamp);
123 
125  static sptr make();
126 };
127 
128 }}} // namespace uhd::usrp::cal
129 
130 #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:27
config.hpp
uhd::usrp::cal::zbx_rx_dsa_cal::sptr
std::shared_ptr< zbx_rx_dsa_cal > sptr
Definition: dsa_cal.hpp:83
UHD_API
#define UHD_API
Definition: config.h:87
uhd::usrp::cal::zbx_rx_dsa_cal
Definition: dsa_cal.hpp:77
uhd::usrp::cal::zbx_tx_dsa_cal
Definition: dsa_cal.hpp:20
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:28
container.hpp
uhd::usrp::cal::zbx_rx_dsa_cal::step_settings
std::array< uint32_t, NUM_DSA > step_settings
Definition: dsa_cal.hpp:84
uhd::usrp::cal::container
Definition: container.hpp:22