3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 #ifndef INCLUDED_USRP2_BASE_H
24 #define INCLUDED_USRP2_BASE_H
26 #include <gr_sync_block.h>
27 #include <usrp2/usrp2.h>
30 // BIG ASS FIXME: get from lower layer MTU calculation
31 #define USRP2_MIN_RX_SAMPLES 371
34 * Base class for all USRP2 blocks
36 class usrp2_base : public gr_sync_block
39 usrp2_base(const char *name,
40 gr_io_signature_sptr input_signature,
41 gr_io_signature_sptr output_signature,
42 const std::string &ifc,
43 const std::string &mac)
44 throw (std::runtime_error);
46 usrp2::usrp2::sptr d_u2;
52 * \brief Get USRP2 hardware MAC address
54 std::string mac_addr() const;
57 * \brief Get USRP2 master clock rate
59 bool fpga_master_clock_freq(long *freq) const;
62 * \brief Set master time to 0 at next PPS rising edge
68 * \brief Read memory from Wishbone bus
70 std::vector<uint8_t> peek(uint32_t addr, uint32_t len);
73 * \brief Called by scheduler when starting flowgraph
78 * \brief Called by scheduler when stopping flowgraph
83 * \brief Derived class must override this
85 virtual int work(int noutput_items,
86 gr_vector_const_void_star &input_items,
87 gr_vector_void_star &output_items) = 0;
90 #endif /* INCLUDED_USRP2_BASE_H */