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.
27 #include <usrp2_base.h>
28 #include <gr_io_signature.h>
31 usrp2_base::usrp2_base(const char *name,
32 gr_io_signature_sptr input_signature,
33 gr_io_signature_sptr output_signature,
34 const std::string &ifc,
35 const std::string &mac)
36 throw (std::runtime_error)
40 d_u2(usrp2::usrp2::sptr())
42 d_u2 = usrp2::usrp2::make(ifc, mac);
44 throw std::runtime_error("Unable to initialize USRP2!");
47 usrp2_base::~usrp2_base ()
53 usrp2_base::mac_addr() const
55 return d_u2->mac_addr();
59 usrp2_base::interface_name() const
61 return d_u2->interface_name();
65 usrp2_base::fpga_master_clock_freq(long *freq) const
67 return d_u2->fpga_master_clock_freq(freq);
71 usrp2_base::config_mimo(int flags)
73 return d_u2->config_mimo(flags);
77 usrp2_base::sync_to_pps()
79 return d_u2->sync_to_pps();
83 usrp2_base::sync_every_pps(bool enable)
85 return d_u2->sync_every_pps(enable);
89 usrp2_base::peek32(uint32_t addr, uint32_t words)
91 return d_u2->peek32(addr, words);
95 usrp2_base::poke32(uint32_t addr, const std::vector<uint32_t> &data)
97 return d_u2->poke32(addr, data);
103 // Default implementation is NOP
110 // Default implementation is NOP