USRP Hardware Driver and USRP Manual  Version: 004.000.000.HEAD-0-g8773fb2c
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 
104  virtual double set_tx_frequency(const double freq, size_t chan) = 0;
105 
110  virtual double get_rx_frequency(const size_t chan) /* const */ = 0;
111 
119  virtual double set_rx_frequency(const double freq, const size_t chan) = 0;
120 
125  virtual double get_tx_gain(const size_t chan) = 0;
126 
134  virtual double set_tx_gain(const double gain, const size_t chan) = 0;
135 
140  virtual double get_rx_gain(const size_t chan) = 0;
141 
149  virtual double set_rx_gain(const double gain, const size_t chan) = 0;
150 
158  virtual void set_time_now(const time_spec_t &time_spec) = 0;
159 
171  virtual void set_time_next_pps(const time_spec_t &time_spec) = 0;
172 
181  virtual time_spec_t get_time_now() = 0;
182 
187  virtual time_spec_t get_time_last_pps() = 0;
188 
195  virtual size_t get_chan_from_dboard_fe(const std::string &fe, const uhd::direction_t dir) = 0;
196 
199  virtual std::string get_dboard_fe_from_chan(const size_t chan, const uhd::direction_t dir) = 0;
200 
201 }; /* class radio_ctrl */
202 
203 }} /* namespace uhd::rfnoc */
204 
205 #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