USRP Hardware Driver and USRP Manual  Version: 003.010.000.HEAD-0-g6e1ac3fc
UHD and USRP Manual
radio_ctrl.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2015-2016 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP
19 #define INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP
20 
21 #include <uhd/types/direction.hpp>
28 
29 namespace uhd {
30  namespace rfnoc {
31 
36  public sink_block_ctrl_base,
37  public rate_node_ctrl,
38  public tick_node_ctrl,
40 {
41 public:
43 
44  virtual ~radio_ctrl(){}
45 
46  /************************************************************************
47  * API calls
48  ***********************************************************************/
53  virtual double get_rate() const = 0;
54 
59  virtual double set_rate(double rate) = 0;
60 
65  virtual std::string get_tx_antenna(const size_t chan) /* const */ = 0;
66 
71  virtual void set_tx_antenna(const std::string &ant, const size_t chan) = 0;
72 
77  virtual std::string get_rx_antenna(const size_t chan) /* const */ = 0;
78 
83  virtual void set_rx_antenna(const std::string &ant, const size_t chan) = 0;
84 
92  virtual double get_tx_frequency(const size_t chan) /* const */ = 0;
93 
101  virtual double set_tx_frequency(const double freq, size_t chan) = 0;
102 
107  virtual double get_rx_frequency(const size_t chan) /* const */ = 0;
108 
116  virtual double set_rx_frequency(const double freq, const size_t chan) = 0;
117 
122  virtual double get_tx_gain(const size_t chan) = 0;
123 
131  virtual double set_tx_gain(const double gain, const size_t chan) = 0;
132 
137  virtual double get_rx_gain(const size_t chan) = 0;
138 
146  virtual double set_rx_gain(const double gain, const size_t chan) = 0;
147 
155  virtual void set_time_now(const time_spec_t &time_spec) = 0;
156 
168  virtual void set_time_next_pps(const time_spec_t &time_spec) = 0;
169 
178  virtual time_spec_t get_time_now() = 0;
179 
184  virtual time_spec_t get_time_last_pps() = 0;
185 
192  virtual size_t get_chan_from_dboard_fe(const std::string &fe, const uhd::direction_t dir) = 0;
193 
196  virtual std::string get_dboard_fe_from_chan(const size_t chan, const uhd::direction_t dir) = 0;
197 
198 }; /* class radio_ctrl */
199 
200 }} /* namespace uhd::rfnoc */
201 
202 #endif /* INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP */
Definition: terminator_node_ctrl.hpp:40
#define UHD_RFNOC_BLOCK_OBJECT(class_name)
This macro must be put in the public section of an RFNoC.
Definition: block_ctrl_base.hpp:74
Definition: sink_block_ctrl_base.hpp:36
Definition: time_spec.hpp:39
Definition: rate_node_ctrl.hpp:38
Block controller for all RFNoC-based radio blocks.
Definition: radio_ctrl.hpp:34
Definition: build_info.hpp:25
Definition: tick_node_ctrl.hpp:35
#define UHD_RFNOC_API
Definition: config.hpp:103
Definition: source_block_ctrl_base.hpp:35
direction_t
Definition: direction.hpp:23