USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
UHD and USRP Manual
radio_ctrl.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2015-2016 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP
9 #define INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP
10 
17 #include <uhd/types/direction.hpp>
18 #include <uhd/types/ranges.hpp>
19 
20 namespace uhd { namespace rfnoc {
21 
25  public sink_block_ctrl_base,
26  public rate_node_ctrl,
27  public tick_node_ctrl,
29 {
30 public:
32 
33  virtual ~radio_ctrl() {}
34 
35 
37  static const size_t ALL_CHANS = size_t(~0);
38 
40  static const std::string ALL_GAINS;
41 
43  static const std::string ALL_LOS;
44 
45  /************************************************************************
46  * API calls
47  ***********************************************************************/
52  virtual double get_rate() const = 0;
53 
58  virtual double set_rate(double rate) = 0;
59 
64  virtual std::string get_tx_antenna(const size_t chan) /* const */ = 0;
65 
70  virtual void set_tx_antenna(const std::string& ant, const size_t chan) = 0;
71 
76  virtual std::string get_rx_antenna(const size_t chan) /* const */ = 0;
77 
82  virtual void set_rx_antenna(const std::string& ant, const size_t chan) = 0;
83 
91  virtual double get_tx_frequency(const size_t chan) /* const */ = 0;
92 
103  virtual double set_tx_frequency(const double freq, size_t chan) = 0;
104 
109  virtual double get_rx_frequency(const size_t chan) /* const */ = 0;
110 
120  virtual double set_rx_frequency(const double freq, const size_t chan) = 0;
121 
126  virtual double get_tx_gain(const size_t chan) = 0;
127 
135  virtual double set_tx_gain(const double gain, const size_t chan) = 0;
136 
141  virtual double get_rx_gain(const size_t chan) = 0;
142 
150  virtual double set_rx_gain(const double gain, const size_t chan) = 0;
151 
156  virtual double get_tx_bandwidth(const size_t chan) = 0;
157 
164  virtual double set_tx_bandwidth(const double bandwidth, const size_t chan) = 0;
165 
170  virtual double get_rx_bandwidth(const size_t chan) = 0;
171 
178  virtual double set_rx_bandwidth(const double bandwidth, const size_t chan) = 0;
179 
187  virtual void set_time_now(const time_spec_t& time_spec) = 0;
188 
200  virtual void set_time_next_pps(const time_spec_t& time_spec) = 0;
201 
210  virtual time_spec_t get_time_now() = 0;
211 
216  virtual time_spec_t get_time_last_pps() = 0;
217 
222  virtual std::vector<std::string> get_gpio_banks() const = 0;
223 
239  virtual void set_gpio_attr(const std::string& bank,
240  const std::string& attr,
241  const uint32_t value,
242  const uint32_t mask) = 0;
243 
259  virtual uint32_t get_gpio_attr(const std::string& bank, const std::string& attr) = 0;
260 
261  /**************************************************************************
262  * LO Controls
263  *************************************************************************/
269  virtual std::vector<std::string> get_rx_lo_names(const size_t chan) = 0;
270 
279  virtual std::vector<std::string> get_rx_lo_sources(
280  const std::string& name, const size_t chan) = 0;
281 
290  virtual freq_range_t get_rx_lo_freq_range(
291  const std::string& name, const size_t chan) = 0;
292 
302  virtual void set_rx_lo_source(
303  const std::string& src, const std::string& name, const size_t chan) = 0;
304 
313  virtual const std::string get_rx_lo_source(
314  const std::string& name, const size_t chan) = 0;
315 
324  virtual void set_rx_lo_export_enabled(
325  bool enabled, const std::string& name, const size_t chan) = 0;
326 
332  virtual bool get_rx_lo_export_enabled(const std::string& name, const size_t chan) = 0;
333 
341  virtual double set_rx_lo_freq(
342  double freq, const std::string& name, const size_t chan) = 0;
343 
352  virtual double get_rx_lo_freq(const std::string& name, const size_t chan) = 0;
353 
359  virtual std::vector<std::string> get_tx_lo_names(const size_t chan) = 0;
360 
369  virtual std::vector<std::string> get_tx_lo_sources(
370  const std::string& name, const size_t chan) = 0;
371 
380  virtual freq_range_t get_tx_lo_freq_range(
381  const std::string& name, const size_t chan) = 0;
382 
392  virtual void set_tx_lo_source(
393  const std::string& src, const std::string& name, const size_t chan) = 0;
394 
403  virtual const std::string get_tx_lo_source(
404  const std::string& name, const size_t chan) = 0;
405 
414  virtual void set_tx_lo_export_enabled(
415  const bool enabled, const std::string& name, const size_t chan) = 0;
416 
422  virtual bool get_tx_lo_export_enabled(const std::string& name, const size_t chan) = 0;
423 
433  virtual double set_tx_lo_freq(
434  const double freq, const std::string& name, const size_t chan) = 0;
435 
447  virtual double get_tx_lo_freq(const std::string& name, const size_t chan) = 0;
448 
449  /**************************************************************************
450  * Time and clock control
451  *************************************************************************/
452 
461  virtual void set_time_source(const std::string& source) = 0;
462 
468  virtual std::string get_time_source() = 0;
469 
475  virtual std::vector<std::string> get_time_sources() = 0;
476 
484  virtual void set_clock_source(const std::string& source) = 0;
485 
491  virtual std::string get_clock_source() = 0;
492 
498  virtual std::vector<std::string> get_clock_sources() = 0;
499 
506  virtual size_t get_chan_from_dboard_fe(
507  const std::string& fe, const uhd::direction_t dir) = 0;
508 
511  virtual std::string get_dboard_fe_from_chan(
512  const size_t chan, const uhd::direction_t dir) = 0;
513 
516  virtual void enable_rx_timestamps(const bool enable, const size_t chan) = 0;
517 }; /* class radio_ctrl */
518 
519 }} /* namespace uhd::rfnoc */
520 
521 #endif /* INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP */
Definition: terminator_node_ctrl.hpp:29
#define UHD_RFNOC_BLOCK_OBJECT(class_name)
This macro must be put in the public section of an RFNoC.
Definition: block_ctrl_base.hpp:59
Definition: sink_block_ctrl_base.hpp:25
Definition: time_spec.hpp:29
Definition: rate_node_ctrl.hpp:27
Block controller for all RFNoC-based radio blocks.
Definition: radio_ctrl.hpp:24
static const std::string ALL_GAINS
A wildcard gain element name.
Definition: radio_ctrl.hpp:40
static const std::string ALL_LOS
A wildcard local oscillator element name.
Definition: radio_ctrl.hpp:43
Definition: build_info.hpp:13
Definition: tick_node_ctrl.hpp:24
#define UHD_RFNOC_API
Definition: config.hpp:104
Definition: source_block_ctrl_base.hpp:24
direction_t
Definition: direction.hpp:13
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:88
Definition: ranges.hpp:65