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