1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
/* -*- c++ -*- */
/*
* Copyright 2019 Ettus Research, a National Instruments Brand.
* Copyright 2020 Free Software Foundation, Inc.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_UHD_RFNOC_TX_RADIO_H
#define INCLUDED_GR_UHD_RFNOC_TX_RADIO_H
#include <gnuradio/uhd/api.h>
#include <gnuradio/uhd/rfnoc_block.h>
#include <gnuradio/uhd/rfnoc_graph.h>
namespace gr {
namespace uhd {
/*! RFNoC TX Radio
*
* This wraps a radio block into GNU Radio. Note: When doing TX and RX in the
* same flow graph, simply crate an rfnoc_rx_radio and an rfnoc_tx_radio with
* the same block ID.
*
* \ingroup uhd_blk
*/
class GR_UHD_API rfnoc_tx_radio : virtual public rfnoc_block
{
public:
typedef boost::shared_ptr<rfnoc_tx_radio> sptr;
/*!
* \param graph Reference to the underlying rfnoc_graph object
* \param block_args Additional block arguments
* \param device_select Device Selection
* \param instance Instance Selection
*/
static sptr make(rfnoc_graph::sptr graph,
const ::uhd::device_addr_t& block_args,
const int device_select,
const int instance);
//! Set the input sampling rate of the radio block
//
// Note: The actual rate of the radio will be coerced to whatever it is
// capable of.
//
// \param rate The new sampling rate
virtual double set_rate(const double rate) = 0;
//! Set the antenna for this radio
//
// \param antenna The antenna name (e.g., "RX2"). Valid name depend on the
// underlying hardware.
// \param chan The channel for which this antenna setting is for
virtual void set_antenna(const std::string& antenna, const size_t chan) = 0;
//! Set the TX frequency for this radio
//
// \param frequency The received frequency (e.g., 1e9)
// \param chan The channel for which this frequency setting is for
virtual double set_frequency(const double frequency, const size_t chan) = 0;
//! Configure the tune args for this RX radio
//
// \param args The new args (e.g., "mode_n=1")
// \param chan The channel for which this setting is for
virtual void set_tune_args(const ::uhd::device_addr_t& args, const size_t chan) = 0;
//! Configure the overall gain for this TX radio
//
// \param gain The new gain value (in dB)
// \param chan The channel for which this setting is for
virtual double set_gain(const double gain, const size_t chan) = 0;
//! Configure a specific gain for this RX radio
//
// \param gain The new gain value (in dB)
// \param name The gain stage name to set
// \param chan The channel for which this setting is for
virtual double
set_gain(const double gain, const std::string& name, const size_t chan) = 0;
//! Switch the gain profile for this RX radio
//
// \param profile The name of the gain profile (e.g., "default")
// \param chan The channel for which this setting is for
virtual void set_gain_profile(const std::string& profile, const size_t chan) = 0;
//! Set the analog bandwidth for this RX radio
//
// \param bandwidth The new bandwidth, in Hz
// \param chan The channel for which this setting is for
virtual double set_bandwidth(const double bandwidth, const size_t chan) = 0;
//! Set the LO source for this TX radio
//
// Note: Available sources depend on the underlying hardware.
//
// \param source The new LO source (e.g., "internal")
// \param name The LO name (e.g. "LO1")
// \param chan The channel for which this setting is for
virtual void set_lo_source(const std::string& source,
const std::string& name,
const size_t chan) = 0;
//! Enable/disable LO export for this TX radio
//
// \param enabled When true, export this LO
// \param name The LO name (e.g. "LO1")
// \param chan The channel for which this setting is for
virtual void set_lo_export_enabled(const bool enabled,
const std::string& name,
const size_t chan) = 0;
//! Configure the LO frequency explicitly
//
// Consult uhd::rfnoc::radio_control::set_tx_lo_freq() for more details.
// \param freq The new LO frequency
// \param name The LO name (e.g. "LO1")
// \param chan The channel for which this setting is for
virtual double
set_lo_freq(const double freq, const std::string& name, const size_t chan) = 0;
//! Set the DC offset value explicitly
//
// Consult uhd::rfnoc::radio_control::set_tx_dc_offset() for more details.
//
// \param offset The DC offset value that gets used for compensation
// \param chan The channel for which this setting is for
virtual void set_dc_offset(const std::complex<double>& offset, const size_t chan) = 0;
//! Set the I/Q imbalance correction value explicitly
//
// Consult uhd::rfnoc::radio_control::set_tx_iq_balance() for more details.
//
// \param offset The DC offset value that gets used for compensation
// \param chan The channel for which this setting is for
virtual void set_iq_balance(const std::complex<double>& correction,
const size_t chan) = 0;
};
} // namespace uhd
} // namespace gr
#endif /* INCLUDED_GR_UHD_RFNOC_TX_RADIO_H */
|