[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7151 - gnuradio/branches/developers/jcorgan/t127/usrp
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r7151 - gnuradio/branches/developers/jcorgan/t127/usrpdb/src |
Date: |
Thu, 13 Dec 2007 10:59:48 -0700 (MST) |
Author: jcorgan
Date: 2007-12-13 10:59:47 -0700 (Thu, 13 Dec 2007)
New Revision: 7151
Added:
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.cc
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.h
Modified:
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
Log:
Added usrpdb_base class.
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am
2007-12-13 17:50:02 UTC (rev 7150)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am
2007-12-13 17:59:47 UTC (rev 7151)
@@ -54,8 +54,9 @@
lib_LTLIBRARIES = libusrpdb.la
libusrpdb_la_SOURCES = \
- usrpdb_qa_hwa.cc \
- usrpdb_hwa.cc
+ usrpdb_base.cc \
+ usrpdb_hwa.cc \
+ usrpdb_qa_hwa.cc
ourlib_LTLIBRARIES = _usrpdb.la
@@ -72,6 +73,7 @@
_usrpdb_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
grinclude_HEADERS = \
+ usrpdb_base.h \
usrpdb_hwa.h \
usrpdb_qa_hwa.h
Added: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.cc
(rev 0)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.cc
2007-12-13 17:59:47 UTC (rev 7151)
@@ -0,0 +1,78 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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 <usrpdb_base.h>
+
+usrpdb_base::usrpdb_base(usrpdb_hwa_sptr hwa)
+ : d_hwa(hwa)
+{
+}
+
+bool
+usrpdb_base::i_and_q_swapped()
+{
+ return false;
+}
+
+bool
+usrpdb_base::spectrum_inverted()
+{
+ return false;
+}
+
+void
+usrpdb_base::set_enable(bool on)
+{
+ // nop
+}
+
+void
+usrpdb_base::set_auto_tr(bool on)
+{
+ // nop
+}
+
+void
+usrpdb_base::set_lo_offset(float offset)
+{
+ // nop
+}
+
+float
+usrpdb_base::lo_offset()
+{
+ return 0.0;
+}
+
+void
+usrpdb_base::select_antenna(int which)
+{
+ // nop
+}
+
+usrpdb_base::~usrpdb_base()
+{
+}
Added: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.h
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.h
(rev 0)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_base.h
2007-12-13 17:59:47 UTC (rev 7151)
@@ -0,0 +1,59 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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_USRPDB_BASE_H
+#define INCLUDED_USRPDB_BASE_H
+
+#include <usrpdb_hwa.h>
+
+// Would rather make this a std::vector<float>, but don't want to use
+// STL so this code can be cross-compiled on the USRP2 FPGA CPU
+typedef float *freq_range_t; // min, max, step
+typedef float *gain_range_t; // min, max, step
+
+class usrpdb_base
+{
+ usrpdb_hwa_sptr d_hwa;
+
+public:
+ usrpdb_base(usrpdb_hwa_sptr hwa);
+ virtual ~usrpdb_base();
+
+ // These methods MUST be overridden in derived classes
+ // (they raised NotImplemented exceptions in old db_base.py)
+ virtual const freq_range_t freq_range() = 0;
+ virtual const gain_range_t gain_range() = 0;
+ virtual void set_freq(float target_freq, const float &actual_baseband_freq)
= 0;
+ virtual bool set_gain(float gain) = 0;
+ virtual bool is_quadrature() = 0;
+
+ // These methods MAY be overriden in derived classes, but have default ops
+ virtual bool i_and_q_swapped(); // false
+ virtual bool spectrum_inverted(); // false
+ virtual void set_enable(bool on); // nop
+ virtual void set_auto_tr(bool on); // nop
+ virtual void set_lo_offset(float offset); // nop
+ virtual float lo_offset(); // 0.0
+ virtual void select_antenna(int which); // nop
+};
+
+#endif /* INCLUDED_USRPDB_BASE_H */
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
2007-12-13 17:50:02 UTC (rev 7150)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
2007-12-13 17:59:47 UTC (rev 7151)
@@ -23,6 +23,8 @@
#ifndef INCLUDED_USRPDB_HWA_H
#define INCLUDED_USRPDB_HWA_H
+#include <boost/shared_ptr.hpp>
+
class usrpdb_hwa
{
public:
@@ -31,4 +33,6 @@
virtual ~usrpdb_hwa() = 0;
};
+typedef boost::shared_ptr<usrpdb_hwa> usrpdb_hwa_sptr;
+
#endif /* INCLUDED_USRPDB_HWA_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7151 - gnuradio/branches/developers/jcorgan/t127/usrpdb/src,
jcorgan <=