[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r11056 - in gnuradio/branches/developers/eb/vrt/gr-vrt
From: |
eb |
Subject: |
[Commit-gnuradio] r11056 - in gnuradio/branches/developers/eb/vrt/gr-vrt: . src |
Date: |
Tue, 19 May 2009 00:44:12 -0600 (MDT) |
Author: eb
Date: 2009-05-19 00:44:12 -0600 (Tue, 19 May 2009)
New Revision: 11056
Added:
gnuradio/branches/developers/eb/vrt/gr-vrt/gnuradio-vrt.pc.in
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.h
Removed:
gnuradio/branches/developers/eb/vrt/gr-vrt/gnuradio-usrp2.pc.in
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_base.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_base.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_16sc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_16sc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_32fc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_32fc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_base.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_base.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_16sc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_16sc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_32fc.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_32fc.h
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_base.cc
gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_base.h
Log:
file renaming: s/usrp2/vrt/
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/gnuradio-vrt.pc.in (from rev
11055, gnuradio/branches/developers/eb/vrt/gr-vrt/gnuradio-usrp2.pc.in)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/gnuradio-vrt.pc.in
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/gnuradio-vrt.pc.in
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,11 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@/gnuradio
+
+Name: gnuradio-vrt
+Description: GNU Software Radio support for Virtual Radio Transport (VRT aka
VITA-49)
+Requires: gnuradio-core vrt
+Version: @VERSION@
+Libs: -L${libdir} -lgnuradio-vrt
+Cflags: -I${includedir}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.cc (from rev
11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_base.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.cc 2009-05-19
06:44:12 UTC (rev 11056)
@@ -0,0 +1,112 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <usrp2_base.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_base::usrp2_base(const char *name,
+ gr_io_signature_sptr input_signature,
+ gr_io_signature_sptr output_signature,
+ const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error)
+ : gr_sync_block(name,
+ input_signature,
+ output_signature),
+ d_u2(usrp2::usrp2::sptr())
+{
+ d_u2 = usrp2::usrp2::make(ifc, mac);
+ if (!d_u2)
+ throw std::runtime_error("Unable to initialize USRP2!");
+}
+
+usrp2_base::~usrp2_base ()
+{
+ // NOP
+}
+
+std::string
+usrp2_base::mac_addr() const
+{
+ return d_u2->mac_addr();
+}
+
+std::string
+usrp2_base::interface_name() const
+{
+ return d_u2->interface_name();
+}
+
+bool
+usrp2_base::fpga_master_clock_freq(long *freq) const
+{
+ return d_u2->fpga_master_clock_freq(freq);
+}
+
+bool
+usrp2_base::config_mimo(int flags)
+{
+ return d_u2->config_mimo(flags);
+}
+
+bool
+usrp2_base::sync_to_pps()
+{
+ return d_u2->sync_to_pps();
+}
+
+bool
+usrp2_base::sync_every_pps(bool enable)
+{
+ return d_u2->sync_every_pps(enable);
+}
+
+std::vector<uint32_t>
+usrp2_base::peek32(uint32_t addr, uint32_t words)
+{
+ return d_u2->peek32(addr, words);
+}
+
+bool
+usrp2_base::poke32(uint32_t addr, const std::vector<uint32_t> &data)
+{
+ return d_u2->poke32(addr, data);
+}
+
+bool
+usrp2_base::start()
+{
+ // Default implementation is NOP
+ return true;
+}
+
+bool
+usrp2_base::stop()
+{
+ // Default implementation is NOP
+ return true;
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.h (from rev
11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_base.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_base.h 2009-05-19
06:44:12 UTC (rev 11056)
@@ -0,0 +1,109 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2009 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_BASE_H
+#define INCLUDED_USRP2_BASE_H
+
+#include <gr_sync_block.h>
+#include <usrp2/usrp2.h>
+#include <stdexcept>
+
+// BIG ASS FIXME: get from lower layer MTU calculation
+#define USRP2_MIN_RX_SAMPLES 371
+
+/*!
+ * Base class for all USRP2 blocks
+ */
+class usrp2_base : public gr_sync_block
+{
+protected:
+ usrp2_base(const char *name,
+ gr_io_signature_sptr input_signature,
+ gr_io_signature_sptr output_signature,
+ const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error);
+
+ usrp2::usrp2::sptr d_u2;
+
+public:
+ ~usrp2_base();
+
+ /*!
+ * \brief Get USRP2 hardware MAC address
+ */
+ std::string mac_addr() const;
+
+ /*!
+ * \brief Get interface name used to communicat with USRP2
+ */
+ std::string interface_name() const;
+
+ /*!
+ * \brief Get USRP2 master clock rate
+ */
+ bool fpga_master_clock_freq(long *freq) const;
+
+ /*!
+ * \brief MIMO configuration
+ */
+ bool config_mimo(int flags);
+
+ /*!
+ * \brief Set master time to 0 at next PPS rising edge
+ */
+ bool sync_to_pps();
+
+ /*!
+ * Reset master time to 0 at every PPS edge
+ */
+ bool sync_every_pps(bool enable);
+
+ /*!
+ * \brief Read memory from Wishbone bus as words
+ */
+ std::vector<uint32_t> peek32(uint32_t addr, uint32_t words);
+
+ /*!
+ * \brief Write memory to Wishbone bus as words
+ */
+ bool poke32(uint32_t addr, const std::vector<uint32_t> &data);
+
+ /*!
+ * \brief Called by scheduler when starting flowgraph
+ */
+ virtual bool start();
+
+ /*!
+ * \brief Called by scheduler when stopping flowgraph
+ */
+ virtual bool stop();
+
+ /*!
+ * \brief Derived class must override this
+ */
+ virtual int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items) = 0;
+};
+
+#endif /* INCLUDED_USRP2_BASE_H */
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.cc (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_16sc.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.cc
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,73 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <usrp2_sink_16sc.h>
+#include <usrp2/metadata.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_sink_16sc_sptr
+usrp2_make_sink_16sc(const std::string &ifc, const std::string &mac_addr)
+ throw (std::runtime_error)
+{
+ return gnuradio::get_initial_sptr(new usrp2_sink_16sc(ifc, mac_addr));
+}
+
+usrp2_sink_16sc::usrp2_sink_16sc(const std::string &ifc, const std::string
&mac_addr)
+ throw (std::runtime_error)
+ : usrp2_sink_base("usrp2_sink_16sc",
+ gr_make_io_signature(1, 1, sizeof(std::complex<int16_t>)),
+ ifc, mac_addr)
+{
+ // NOP
+}
+
+usrp2_sink_16sc::~usrp2_sink_16sc()
+{
+ // NOP
+}
+
+int
+usrp2_sink_16sc::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ std::complex<int16_t> *in = (std::complex<int16_t> *)input_items[0];
+
+ usrp2::tx_metadata metadata;
+ metadata.timestamp = -1;
+ metadata.send_now = 1;
+ metadata.start_of_burst = 1;
+
+ bool ok = d_u2->tx_16sc(0, // FIXME: someday, streams will have channel
numbers
+ in, noutput_items, &metadata);
+ if (!ok){
+ std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
+ return -1; // say we're done
+ }
+
+ return noutput_items;
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.h (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_16sc.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_16sc.h
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SINK_16SC_H
+#define INCLUDED_USRP2_SINK_16SC_H
+
+#include <usrp2_sink_base.h>
+
+class usrp2_sink_16sc;
+typedef boost::shared_ptr<usrp2_sink_16sc> usrp2_sink_16sc_sptr;
+
+usrp2_sink_16sc_sptr
+usrp2_make_sink_16sc(const std::string &ifc="eth0",
+ const std::string &mac="")
+ throw (std::runtime_error);
+
+class usrp2_sink_16sc : public usrp2_sink_base
+{
+private:
+ friend usrp2_sink_16sc_sptr
+ usrp2_make_sink_16sc(const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error);
+
+protected:
+ usrp2_sink_16sc(const std::string &ifc, const std::string &mac)
+ throw (std::runtime_error);
+
+public:
+ ~usrp2_sink_16sc();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_USRP2_SINK_16SC_H */
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.cc (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_32fc.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.cc
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,73 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <usrp2_sink_32fc.h>
+#include <usrp2/metadata.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_sink_32fc_sptr
+usrp2_make_sink_32fc(const std::string &ifc, const std::string &mac_addr)
+ throw (std::runtime_error)
+{
+ return gnuradio::get_initial_sptr(new usrp2_sink_32fc(ifc, mac_addr));
+}
+
+usrp2_sink_32fc::usrp2_sink_32fc(const std::string &ifc, const std::string
&mac_addr)
+ throw (std::runtime_error)
+ : usrp2_sink_base("usrp2_sink_32fc",
+ gr_make_io_signature(1, 1, sizeof(gr_complex)),
+ ifc, mac_addr)
+{
+ // NOP
+}
+
+usrp2_sink_32fc::~usrp2_sink_32fc()
+{
+ // NOP
+}
+
+int
+usrp2_sink_32fc::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ gr_complex *in = (gr_complex *)input_items[0];
+
+ usrp2::tx_metadata metadata;
+ metadata.timestamp = -1;
+ metadata.send_now = 1;
+ metadata.start_of_burst = 1;
+
+ bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel
numbers
+ in, noutput_items, &metadata);
+ if (!ok){
+ std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
+ return -1; // say we're done
+ }
+
+ return noutput_items;
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.h (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_32fc.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_32fc.h
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SINK_32FC_H
+#define INCLUDED_USRP2_SINK_32FC_H
+
+#include <usrp2_sink_base.h>
+
+class usrp2_sink_32fc;
+typedef boost::shared_ptr<usrp2_sink_32fc> usrp2_sink_32fc_sptr;
+
+usrp2_sink_32fc_sptr
+usrp2_make_sink_32fc(const std::string &ifc="eth0",
+ const std::string &mac="")
+ throw (std::runtime_error);
+
+class usrp2_sink_32fc : public usrp2_sink_base
+{
+private:
+ friend usrp2_sink_32fc_sptr
+ usrp2_make_sink_32fc(const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error);
+
+protected:
+ usrp2_sink_32fc(const std::string &ifc, const std::string &mac)
+ throw (std::runtime_error);
+
+public:
+ ~usrp2_sink_32fc();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_USRP2_SINK_32FC_H */
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.cc (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_base.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.cc
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,151 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <usrp2_sink_base.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_sink_base::usrp2_sink_base(const char *name,
+ gr_io_signature_sptr input_signature,
+ const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error)
+ : usrp2_base(name,
+ input_signature,
+ gr_make_io_signature(0, 0, 0),
+ ifc, mac)
+{
+ // NOP
+}
+
+usrp2_sink_base::~usrp2_sink_base ()
+{
+ // NOP
+}
+
+bool
+usrp2_sink_base::set_gain(double gain)
+{
+ return d_u2->set_tx_gain(gain);
+}
+
+bool
+usrp2_sink_base::set_lo_offset(double frequency)
+{
+ return d_u2->set_tx_lo_offset(frequency);
+}
+
+bool
+usrp2_sink_base::set_center_freq(double frequency, usrp2::tune_result *tr)
+{
+ return d_u2->set_tx_center_freq(frequency, tr);
+}
+
+bool
+usrp2_sink_base::set_interp(int interp_factor)
+{
+ return d_u2->set_tx_interp(interp_factor);
+}
+
+void
+usrp2_sink_base::default_scale_iq(int interp_factor, int *scale_i, int
*scale_q)
+{
+ return d_u2->default_tx_scale_iq(interp_factor, scale_i, scale_q);
+}
+
+bool
+usrp2_sink_base::set_scale_iq(int scale_i, int scale_q)
+{
+ return d_u2->set_tx_scale_iq(scale_i, scale_q);
+}
+
+int
+usrp2_sink_base::interp()
+{
+ return d_u2->tx_interp();
+}
+
+bool
+usrp2_sink_base::dac_rate(long *rate)
+{
+ return d_u2->dac_rate(rate);
+}
+
+double
+usrp2_sink_base::gain_min()
+{
+ return d_u2->tx_gain_min();
+}
+
+double
+usrp2_sink_base::gain_max()
+{
+ return d_u2->tx_gain_max();
+}
+
+double
+usrp2_sink_base::gain_db_per_step()
+{
+ return d_u2->tx_gain_db_per_step();
+}
+
+double
+usrp2_sink_base::freq_min()
+{
+ return d_u2->tx_freq_min();
+}
+
+double
+usrp2_sink_base::freq_max()
+{
+ return d_u2->tx_freq_max();
+}
+
+bool
+usrp2_sink_base::daughterboard_id(int *dbid)
+{
+ return d_u2->tx_daughterboard_id(dbid);
+}
+
+bool usrp2_sink_base::set_gpio_ddr(uint16_t value, uint16_t mask)
+{
+ return d_u2->set_gpio_ddr(usrp2::GPIO_TX_BANK, value, mask);
+}
+
+bool usrp2_sink_base::set_gpio_sels(std::string sels)
+{
+ return d_u2->set_gpio_sels(usrp2::GPIO_TX_BANK, sels);
+}
+
+bool usrp2_sink_base::write_gpio(uint16_t value, uint16_t mask)
+{
+ return d_u2->write_gpio(usrp2::GPIO_TX_BANK, value, mask);
+}
+
+bool usrp2_sink_base::read_gpio(uint16_t *value)
+{
+ return d_u2->read_gpio(usrp2::GPIO_TX_BANK, value);
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.h (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_sink_base.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_sink_base.h
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,139 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SINK_BASE_H
+#define INCLUDED_USRP2_SINK_BASE_H
+
+#include <usrp2_base.h>
+
+/*!
+ * Base class for all USRP2 transmit blocks
+ */
+class usrp2_sink_base : public usrp2_base
+{
+protected:
+ usrp2_sink_base(const char *name,
+ gr_io_signature_sptr input_signature,
+ const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error);
+
+public:
+ ~usrp2_sink_base();
+
+ /*!
+ * \brief Set transmitter gain
+ */
+ bool set_gain(double gain);
+
+ /*!
+ * \brief Set transmitter LO offset frequency
+ */
+ bool set_lo_offset(double frequency);
+
+ /*!
+ * \brief Set transmitter center frequency
+ */
+ bool set_center_freq(double frequency, usrp2::tune_result *tr);
+
+ /*!
+ * \brief Set transmit interpolation rate
+ */
+ bool set_interp(int interp_factor);
+
+ /*!
+ * \brief Calculate default scale_iq for given interpolation factor
+ */
+ void default_scale_iq(int interpolation_factor, int *scale_i, int *scale_q);
+
+ /*!
+ * \brief Set transmit IQ scale factors
+ */
+ bool set_scale_iq(int scale_i, int scale_q);
+
+ /*!
+ * \brief Get transmit interpolation rate
+ */
+ int interp();
+
+ /*!
+ * \brief Get DAC sample rate in Hz
+ */
+ bool dac_rate(long *rate);
+
+ /*!
+ * \brief Returns minimum Tx gain
+ */
+ double gain_min();
+
+ /*!
+ * \brief Returns maximum Tx gain
+ */
+ double gain_max();
+
+ /*!
+ * \brief Returns Tx gain db_per_step
+ */
+ double gain_db_per_step();
+
+ /*!
+ * \brief Returns minimum Tx center frequency
+ */
+ double freq_min();
+
+ /*!
+ * \brief Returns maximum Tx center frequency
+ */
+ double freq_max();
+
+ /*!
+ * \brief Get Tx daughterboard ID
+ *
+ * \param[out] dbid returns the daughterboard id.
+ *
+ * daughterboard id >= 0 if successful, -1 if no daugherboard installed,
+ * -2 if invalid EEPROM on daughterboard.
+ */
+ bool daughterboard_id(int *dbid);
+
+ /*!
+ * \brief Set daughterboard GPIO data direction register.
+ */
+ bool set_gpio_ddr(uint16_t value, uint16_t mask);
+
+ /*!
+ * \brief Set daughterboard GPIO output selection register.
+ */
+ bool set_gpio_sels(std::string sels);
+
+ /*!
+ * \brief Set daughterboard GPIO pin values.
+ */
+ bool write_gpio(uint16_t value, uint16_t mask);
+
+ /*!
+ * \brief Read daughterboard GPIO pin values
+ */
+ bool read_gpio(uint16_t *value);
+};
+
+#endif /* INCLUDED_USRP2_SINK_BASE_H */
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.cc (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_16sc.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.cc
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,69 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <usrp2_source_16sc.h>
+#include <rx_16sc_handler.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_source_16sc_sptr
+usrp2_make_source_16sc(const std::string &ifc, const std::string &mac_addr)
+ throw (std::runtime_error)
+{
+ return gnuradio::get_initial_sptr(new usrp2_source_16sc(ifc, mac_addr));
+}
+
+usrp2_source_16sc::usrp2_source_16sc(const std::string &ifc, const std::string
&mac_addr)
+ throw (std::runtime_error)
+ : usrp2_source_base("usrp2_source_16sc",
+ gr_make_io_signature(1, 1, sizeof(std::complex<int16_t>)),
+ ifc, mac_addr)
+{
+ set_output_multiple(USRP2_MIN_RX_SAMPLES);
+}
+
+usrp2_source_16sc::~usrp2_source_16sc()
+{
+ // NOP
+}
+
+int
+usrp2_source_16sc::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ std::complex<int16_t> *out = (std::complex<int16_t> *)output_items[0];
+
+ rx_16sc_handler::sptr handler = rx_16sc_handler::make(noutput_items,
USRP2_MIN_RX_SAMPLES, out);
+
+ bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number
instead of 0
+ if (!ok){
+ std::cerr << "usrp2::rx_samples() failed" << std::endl;
+ return -1; // say we're done
+ }
+
+ return handler->nsamples();
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.h (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_16sc.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_16sc.h
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,54 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SOURCE_16SC_H
+#define INCLUDED_USRP2_SOURCE_16SC_H
+
+#include <usrp2_source_base.h>
+
+class usrp2_source_16sc;
+typedef boost::shared_ptr<usrp2_source_16sc> usrp2_source_16sc_sptr;
+
+usrp2_source_16sc_sptr
+usrp2_make_source_16sc(const std::string &ifc="eth0",
+ const std::string &mac="")
+ throw (std::runtime_error);
+
+class usrp2_source_16sc : public usrp2_source_base
+{
+private:
+ friend usrp2_source_16sc_sptr
+ usrp2_make_source_16sc(const std::string &ifc,
+ const std::string &mac) throw (std::runtime_error);
+
+protected:
+ usrp2_source_16sc(const std::string &ifc, const std::string &mac) throw
(std::runtime_error);
+
+public:
+ ~usrp2_source_16sc();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_USRP2_SOURCE_16SC_H */
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.cc (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_32fc.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.cc
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,69 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <usrp2_source_32fc.h>
+#include <rx_32fc_handler.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_source_32fc_sptr
+usrp2_make_source_32fc(const std::string &ifc, const std::string &mac_addr)
+ throw (std::runtime_error)
+{
+ return gnuradio::get_initial_sptr(new usrp2_source_32fc(ifc, mac_addr));
+}
+
+usrp2_source_32fc::usrp2_source_32fc(const std::string &ifc, const std::string
&mac_addr)
+ throw (std::runtime_error)
+ : usrp2_source_base("usrp2_source_32fc",
+ gr_make_io_signature(1, 1, sizeof(gr_complex)),
+ ifc, mac_addr)
+{
+ set_output_multiple(USRP2_MIN_RX_SAMPLES);
+}
+
+usrp2_source_32fc::~usrp2_source_32fc()
+{
+ // NOP
+}
+
+int
+usrp2_source_32fc::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ gr_complex *out = (gr_complex *)output_items[0];
+
+ rx_32fc_handler::sptr handler = rx_32fc_handler::make(noutput_items,
USRP2_MIN_RX_SAMPLES, out);
+
+ bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number
instead of 0
+ if (!ok){
+ std::cerr << "usrp2::rx_samples() failed" << std::endl;
+ return -1; // say we're done
+ }
+
+ return handler->nsamples();
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.h (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_32fc.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_32fc.h
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,54 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SOURCE_32FC_H
+#define INCLUDED_USRP2_SOURCE_32FC_H
+
+#include <usrp2_source_base.h>
+
+class usrp2_source_32fc;
+typedef boost::shared_ptr<usrp2_source_32fc> usrp2_source_32fc_sptr;
+
+usrp2_source_32fc_sptr
+usrp2_make_source_32fc(const std::string &ifc="eth0",
+ const std::string &mac="")
+ throw (std::runtime_error);
+
+class usrp2_source_32fc : public usrp2_source_base
+{
+private:
+ friend usrp2_source_32fc_sptr
+ usrp2_make_source_32fc(const std::string &ifc,
+ const std::string &mac) throw (std::runtime_error);
+
+protected:
+ usrp2_source_32fc(const std::string &ifc, const std::string &mac) throw
(std::runtime_error);
+
+public:
+ ~usrp2_source_32fc();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_USRP2_SOURCE_32FC_H */
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.cc (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_base.cc)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.cc
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.cc
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,179 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <usrp2_source_base.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+usrp2_source_base::usrp2_source_base(const char *name,
+ gr_io_signature_sptr output_signature,
+ const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error)
+ : usrp2_base(name,
+ gr_make_io_signature(0, 0, 0),
+ output_signature,
+ ifc, mac)
+{
+ // NOP
+}
+
+usrp2_source_base::~usrp2_source_base ()
+{
+ // NOP
+}
+
+bool
+usrp2_source_base::set_gain(double gain)
+{
+ return d_u2->set_rx_gain(gain);
+}
+
+bool
+usrp2_source_base::set_lo_offset(double frequency)
+{
+ return d_u2->set_rx_lo_offset(frequency);
+}
+
+bool
+usrp2_source_base::set_center_freq(double frequency, usrp2::tune_result *tr)
+{
+ return d_u2->set_rx_center_freq(frequency, tr);
+}
+
+bool
+usrp2_source_base::set_decim(int decimation_factor)
+{
+ return d_u2->set_rx_decim(decimation_factor);
+}
+
+bool
+usrp2_source_base::set_scale_iq(int scale_i, int scale_q)
+{
+ return d_u2->set_rx_scale_iq(scale_i, scale_q);
+}
+
+int
+usrp2_source_base::decim()
+{
+ return d_u2->rx_decim();
+}
+
+bool
+usrp2_source_base::adc_rate(long *rate)
+{
+ return d_u2->adc_rate(rate);
+}
+
+double
+usrp2_source_base::gain_min()
+{
+ return d_u2->rx_gain_min();
+}
+
+double
+usrp2_source_base::gain_max()
+{
+ return d_u2->rx_gain_max();
+}
+
+double
+usrp2_source_base::gain_db_per_step()
+{
+ return d_u2->rx_gain_db_per_step();
+}
+
+double
+usrp2_source_base::freq_min()
+{
+ return d_u2->rx_freq_min();
+}
+
+double
+usrp2_source_base::freq_max()
+{
+ return d_u2->rx_freq_max();
+}
+
+bool
+usrp2_source_base::daughterboard_id(int *dbid)
+{
+ return d_u2->rx_daughterboard_id(dbid);
+}
+
+unsigned int
+usrp2_source_base::overruns()
+{
+ return d_u2->rx_overruns();
+}
+
+unsigned int
+usrp2_source_base::missing()
+{
+ return d_u2->rx_missing();
+}
+
+bool
+usrp2_source_base::start()
+{
+ return d_u2->start_rx_streaming(0); // FIXME: someday sources will have
channel #s
+}
+
+bool
+usrp2_source_base::stop()
+{
+ return d_u2->stop_rx_streaming(0); // FIXME: someday sources will have
channel #s
+}
+
+bool
+usrp2_source_base::set_gpio_ddr(uint16_t value, uint16_t mask)
+{
+ return d_u2->set_gpio_ddr(usrp2::GPIO_RX_BANK, value, mask);
+}
+
+bool
+usrp2_source_base::set_gpio_sels(std::string sels)
+{
+ return d_u2->set_gpio_sels(usrp2::GPIO_RX_BANK, sels);
+}
+
+bool
+usrp2_source_base::write_gpio(uint16_t value, uint16_t mask)
+{
+ return d_u2->write_gpio(usrp2::GPIO_RX_BANK, value, mask);
+}
+
+bool
+usrp2_source_base::read_gpio(uint16_t *value)
+{
+ return d_u2->read_gpio(usrp2::GPIO_RX_BANK, value);
+}
+
+bool
+usrp2_source_base::enable_gpio_streaming(int enable)
+{
+ return d_u2->enable_gpio_streaming(usrp2::GPIO_RX_BANK, enable);
+}
Copied: gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.h (from
rev 11055, gnuradio/branches/developers/eb/vrt/gr-vrt/src/usrp2_source_base.h)
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.h
(rev 0)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_source_base.h
2009-05-19 06:44:12 UTC (rev 11056)
@@ -0,0 +1,159 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2009 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP2_SOURCE_BASE_H
+#define INCLUDED_USRP2_SOURCE_BASE_H
+
+#include <usrp2_base.h>
+
+/*!
+ * Base class for all USRP2 source blocks
+ */
+class usrp2_source_base : public usrp2_base
+{
+protected:
+ usrp2_source_base(const char *name,
+ gr_io_signature_sptr output_signature,
+ const std::string &ifc,
+ const std::string &mac)
+ throw (std::runtime_error);
+
+public:
+ ~usrp2_source_base();
+
+ /*!
+ * \brief Set receiver gain
+ */
+ bool set_gain(double gain);
+
+ /*!
+ * \brief Set receive LO offset frequency
+ */
+ bool set_lo_offset(double frequency);
+
+ /*!
+ * \brief Set receiver center frequency
+ */
+ bool set_center_freq(double frequency, usrp2::tune_result *tr);
+
+ /*!
+ * \brief Set receive decimation rate
+ */
+ bool set_decim(int decimation_factor);
+
+ /*!
+ * \brief Set receive IQ scale factors
+ */
+ bool set_scale_iq(int scale_i, int scale_q);
+
+ /*!
+ * \brief Get receive decimation rate
+ */
+ int decim();
+
+ /*!
+ * \brief Get the ADC sample rate
+ */
+ bool adc_rate(long *rate);
+
+ /*!
+ * \brief Returns minimum Rx gain
+ */
+ double gain_min();
+
+ /*!
+ * \brief Returns maximum Rx gain
+ */
+ double gain_max();
+
+ /*!
+ * \brief Returns Rx gain db_per_step
+ */
+ double gain_db_per_step();
+
+ /*!
+ * \brief Returns minimum Rx center frequency
+ */
+ double freq_min();
+
+ /*!
+ * \brief Returns maximum Rx center frequency
+ */
+ double freq_max();
+
+ /*!
+ * \brief Get Rx daughterboard ID
+ *
+ * \param[out] dbid returns the daughterboard id.
+ *
+ * daughterboard id >= 0 if successful, -1 if no daugherboard installed,
+ * -2 if invalid EEPROM on daughterboard.
+ */
+ bool daughterboard_id(int *dbid);
+
+ /*!
+ * \brief Returns number of receiver overruns
+ */
+ unsigned int overruns();
+
+ /*!
+ * \brief Returns number of missing sequence numbers
+ */
+ unsigned int missing();
+
+ /*!
+ * \brief Called by scheduler when starting flowgraph
+ */
+ virtual bool start();
+
+ /*!
+ * \brief Called by scheduler when stopping flowgraph
+ */
+ virtual bool stop();
+
+ /*!
+ * \brief Set daughterboard GPIO data direction register.
+ */
+ bool set_gpio_ddr(uint16_t value, uint16_t mask);
+
+ /*!
+ * \brief Set daughterboard GPIO output selection register.
+ */
+ bool set_gpio_sels(std::string sels);
+
+ /*!
+ * \brief Set daughterboard GPIO pin values.
+ */
+ bool write_gpio(uint16_t value, uint16_t mask);
+
+ /*!
+ * \brief Read daughterboard GPIO pin values
+ */
+ bool read_gpio(uint16_t *value);
+
+ /*!
+ * \brief Enable streaming GPIO in sample LSBs
+ */
+ bool enable_gpio_streaming(int enable);
+};
+
+#endif /* INCLUDED_USRP2_SOURCE_BASE_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r11056 - in gnuradio/branches/developers/eb/vrt/gr-vrt: . src,
eb <=