Loading...
Searching...
No Matches
dsa_cal.hpp
Go to the documentation of this file.
//
// Copyright 2020 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#ifndef INCLUDED_LIBUHD_CAL_GAIN_HPP
#define INCLUDED_LIBUHD_CAL_GAIN_HPP
#include <uhd/cal/container.hpp>
#include <uhd/config.hpp>
#include <array>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
namespace uhd { namespace usrp { namespace cal {
class UHD_API zbx_tx_dsa_cal : public container
{
public:
static constexpr uint32_t NUM_AMP = 1;
static constexpr uint32_t NUM_DSA = 2 + NUM_AMP;
static constexpr uint32_t NUM_GAIN_STAGES = 61;
using sptr = std::shared_ptr<zbx_tx_dsa_cal>;
using step_settings = std::array<uint32_t, NUM_DSA>;
virtual void add_frequency_band(const double max_freq,
const std::string& name,
std::array<step_settings, NUM_GAIN_STAGES> dsa_steps) = 0;
virtual const step_settings get_dsa_setting(
const double freq, const size_t gain_index) const = 0;
/* Check whether two frequencies map to the same band.
*/
virtual bool is_same_band(double freq1, double freq2) const = 0;
virtual std::vector<uint32_t> get_band_settings(double freq, uint8_t dsa) const = 0;
virtual void clear() = 0;
static sptr make(
const std::string& name, const std::string& serial, const uint64_t timestamp);
static sptr make();
};
class UHD_API zbx_rx_dsa_cal : public container
{
public:
static constexpr uint32_t NUM_DSA = 4;
static constexpr uint32_t NUM_GAIN_STAGES = 61;
using sptr = std::shared_ptr<zbx_rx_dsa_cal>;
using step_settings = std::array<uint32_t, NUM_DSA>;
virtual void add_frequency_band(const double max_freq,
const std::string& name,
std::array<step_settings, NUM_GAIN_STAGES> dsa_steps) = 0;
virtual bool is_same_band(double freq1, double freq2) const = 0;
virtual const step_settings get_dsa_setting(
const double freq, const size_t gain_index) const = 0;
virtual std::vector<uint32_t> get_band_settings(double freq, uint8_t dsa) const = 0;
virtual void clear() = 0;
static sptr make(
const std::string& name, const std::string& serial, const uint64_t timestamp);
static sptr make();
};
}}} // namespace uhd::usrp::cal
#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 container.hpp:15
uhd::usrp
Definition container.hpp:15
uhd
Definition build_info.hpp:12