USRP Hardware Driver and USRP Manual  Version: 004.000.000.HEAD-0-g8773fb2c
UHD and USRP Manual
null_block_ctrl.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014 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_NULL_BLOCK_CTRL_HPP
19 #define INCLUDED_LIBUHD_RFNOC_NULL_BLOCK_CTRL_HPP
20 
23 
24 namespace uhd {
25  namespace rfnoc {
26 
46 {
47 public:
48  // This macro must always be at the top of the public section in an RFNoC block class
50 
51 
52  static const boost::uint32_t SR_LINES_PER_PACKET = 129;
54  static const boost::uint32_t SR_LINE_RATE = 130;
56  static const boost::uint32_t SR_ENABLE_STREAM = 131;
57 
58  static const size_t DEFAULT_LINES_PER_PACKET = 32;
59  static const size_t BYTES_PER_LINE = 8;
60 
62  // Note: This is 'cycles per line', so the bit rate is actually
63  // 64 times this value (byte/s is 8*rate etc.)
64  //
65  // Equivalent to writing to line_rate/value in the property tree.
66  //
67  // \param The rate you want to set this to
68  // \param The clock rate of this block's clock domain
69  // \returns the actual line rate (will find closest possible).
70  virtual double set_line_rate(double rate, double clock_rate=166.6e6) = 0;
71 
73  // from the property tree.
74  virtual double get_line_rate(double clock_rate=166.6e6) const = 0;
75 
76 }; /* class null_block_ctrl*/
77 
78 }} /* namespace uhd::rfnoc */
79 
80 #endif /* INCLUDED_LIBUHD_RFNOC_NULL_BLOCK_CTRL_HPP */
81 // vim: sw=4 et:
static const boost::uint32_t SR_LINE_RATE
Set this register to number of cycles between producing a line.
Definition: null_block_ctrl.hpp:54
#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
virtual double set_line_rate(double rate, double clock_rate=166.6e6)=0
Custom function to set the rate at which data is produced.
static const size_t DEFAULT_LINES_PER_PACKET
Definition: null_block_ctrl.hpp:58
Provide access to a &#39;null block&#39;.
Definition: null_block_ctrl.hpp:45
Definition: build_info.hpp:25
Definition: source_block_ctrl_base.hpp:35
virtual double get_line_rate(double clock_rate=166.6e6) const =0
Return the current line rate. Equivalent to reading line_rate/value.
static const boost::uint32_t SR_ENABLE_STREAM
Set this register to non-zero to start producing data.
Definition: null_block_ctrl.hpp:56
static const size_t BYTES_PER_LINE
Definition: null_block_ctrl.hpp:59
static const boost::uint32_t SR_LINES_PER_PACKET
Set this register to number of lines per packet.
Definition: null_block_ctrl.hpp:52