commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11381 - in gnuradio/branches/developers/jcorgan/usrp-


From: jcorgan
Subject: [Commit-gnuradio] r11381 - in gnuradio/branches/developers/jcorgan/usrp-headers: config usrp/host usrp/host/include/usrp usrp/host/lib usrp/host/lib/legacy usrp/host/lib/legacy/limbo
Date: Wed, 8 Jul 2009 16:36:08 -0600 (MDT)

Author: jcorgan
Date: 2009-07-08 16:36:06 -0600 (Wed, 08 Jul 2009)
New Revision: 11381

Added:
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_base.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_basic.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dbs_rx.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt754.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt768.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf_mimo.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_tv_rx.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_xcvr2450.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_basic.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_bytesex.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_prims.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_slots.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_standard.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_subdev_spec.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_tune_result.h
   gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.h
Removed:
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_basic.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dbs_rx.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt754.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt768.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf_mimo.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_tv_rx.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_wbx.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_wbx.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_xcvr2450.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_basic.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_bytesex.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_prims.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_slots.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_standard.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_subdev_spec.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_tune_result.h
Modified:
   gnuradio/branches/developers/jcorgan/usrp-headers/config/grc_usrp.m4
   gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/Makefile.am
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/Makefile.am
   gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/Makefile.am
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/Makefile.am
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base_impl.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_basic.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.h
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dbs_rx.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt754.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt768.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf_mimo.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_tv_rx.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_xcvr2450.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/gen_usrp_dbid.py
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_basic.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_prims.cc
   
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_standard.cc
Log:
libusrp compiles, nothing outside yet

Modified: gnuradio/branches/developers/jcorgan/usrp-headers/config/grc_usrp.m4
===================================================================
--- gnuradio/branches/developers/jcorgan/usrp-headers/config/grc_usrp.m4        
2009-07-08 19:50:21 UTC (rev 11380)
+++ gnuradio/branches/developers/jcorgan/usrp-headers/config/grc_usrp.m4        
2009-07-08 22:36:06 UTC (rev 11381)
@@ -57,13 +57,16 @@
     fi
     if test $passed != with; then
        dnl how and where to find INCLUDES and LA
-       usrp_INCLUDES="-I\${abs_top_srcdir}/usrp/host/lib/legacy \
-               -I\${abs_top_srcdir}/usrp/firmware/include \
-               -I\${abs_top_builddir}/usrp/host/lib/legacy"
+       usrp_INCLUDES=" \
+               -I\${abs_top_srcdir}/usrp/host/include \
+               -I\${abs_top_builddir}/usrp/host/include \
+               -I\${abs_top_srcdir}/usrp/firmware/include"
         usrp_LA="\${abs_top_builddir}/usrp/host/lib/legacy/libusrp.la"
        usrp_inband_INCLUDES="-I\${abs_top_srcdir}/usrp/host/lib/inband"
        
usrp_inband_LA="\${abs_top_builddir}/usrp/host/lib/inband/libusrp-inband.la"
     fi
+    #-I\${abs_top_srcdir}/usrp/host/lib/legacy
+    #-I\${abs_top_builddir}/usrp/host/lib/legacy"
 
     dnl Include the usrp-inband INCLUDES and LA
     AC_SUBST(usrp_inband_INCLUDES)

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/Makefile.am     
2009-07-08 19:50:21 UTC (rev 11380)
+++ gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/Makefile.am     
2009-07-08 22:36:06 UTC (rev 11381)
@@ -19,7 +19,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-SUBDIRS = include misc lib apps apps-inband
+SUBDIRS = misc lib include apps #apps-inband
 
 if PYTHON
 SUBDIRS += swig

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/Makefile.am
        2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/Makefile.am
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -19,3 +19,25 @@
 # Boston, MA 02110-1301, USA.
 # 
 
+include $(top_srcdir)/Makefile.common
+
+usrpincludedir = $(includedir)/usrp
+
+usrpinclude_HEADERS = \
+       db_base.h \
+       db_basic.h \
+       db_dbs_rx.h \
+       db_dtt754.h \
+       db_dtt768.h \
+       db_flexrf.h \
+       db_flexrf_mimo.h \
+       db_tv_rx.h \
+       db_xcvr2450.h \
+       usrp_basic.h \
+       usrp_bytesex.h \
+       usrp_dbid.h \
+       usrp_prims.h \
+       usrp_slots.h \
+       usrp_standard.h \
+       usrp_subdev_spec.h \
+       usrp_tune_result.h

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_base.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_base.h
                          (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_base.h
  2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,119 @@
+/* -*- 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 asversion 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_DB_BASE_H
+#define INCLUDED_DB_BASE_H
+
+#include <string>
+#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
+#include <iosfwd>
+
+class db_base;
+typedef boost::shared_ptr<db_base> db_base_sptr;
+
+class usrp_basic;
+typedef boost::shared_ptr<usrp_basic> usrp_basic_sptr;
+
+struct freq_result_t
+{
+  bool  ok;
+  double baseband_freq;
+};
+
+/******************************************************************************/
+
+/*!
+ * \brief Abstract base class for all USRP daughterboards
+ * \ingroup usrp
+ */
+class db_base
+{
+ protected:
+  bool                         d_is_shutdown;
+  usrp_basic                  *d_raw_usrp;
+  int                          d_which;
+  double                       d_lo_offset;
+
+  void _enable_refclk(bool enable);
+  virtual double _refclk_freq();
+  virtual int _refclk_divisor();
+
+  usrp_basic *usrp(){
+    return d_raw_usrp;
+  }
+
+ public:
+  db_base(boost::shared_ptr<usrp_basic> usrp, int which);
+  virtual ~db_base();
+
+  int dbid();
+  std::string name();
+  std::string side_and_name();
+  int which() { return d_which; }
+
+  bool bypass_adc_buffers(bool bypass);
+  bool set_atr_mask(int v);
+  bool set_atr_txval(int v);
+  bool set_atr_rxval(int v);
+  bool set_atr_tx_delay(int v);
+  bool set_atr_rx_delay(int v);
+  bool set_lo_offset(double offset);
+  double lo_offset() { return d_lo_offset; }
+
+
+  ////////////////////////////////////////////////////////
+  // derived classes should override the following methods
+
+protected:
+  friend class usrp_basic;
+
+  /*!
+   * Called to shutdown daughterboard.  Called from dtor and usrp_basic dtor.
+   *
+   * N.B., any class that overrides shutdown MUST call shutdown in its 
destructor.
+   */
+  virtual void shutdown();
+
+
+public:
+  virtual float gain_min() = 0;
+  virtual float gain_max() = 0;
+  virtual float gain_db_per_step() = 0;
+  virtual double freq_min() = 0;
+  virtual double freq_max() = 0;
+  virtual struct freq_result_t set_freq(double target_freq) = 0;
+  virtual bool set_gain(float gain) = 0;
+  virtual bool is_quadrature() = 0;
+  virtual bool i_and_q_swapped();
+  virtual bool spectrum_inverted();
+  virtual bool set_enable(bool on);
+  virtual bool set_auto_tr(bool on);
+  virtual bool select_rx_antenna(int which_antenna);
+  virtual bool select_rx_antenna(const std::string &which_antenna);
+  virtual bool set_bw(float bw);
+};
+
+
+std::ostream & operator<<(std::ostream &os, db_base &x);
+
+#endif /* INCLUDED_DB_BASE_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_base.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_base.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_base.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_base.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_base.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_base.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_base.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_base.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_base.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_base.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_base.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_base.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_base.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_base.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_base.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_base.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_base.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_base.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_base.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_base.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_basic.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_basic.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_basic.h
                         (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_basic.h
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,99 @@
+/* -*- 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 asversion 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 DB_BASIC_H
+#define DB_BASIC_H
+
+#include <usrp/db_base.h>
+
+
+/******************************************************************************/
+
+
+class db_basic_tx : public db_base
+{
+public:
+  db_basic_tx(usrp_basic_sptr usrp, int which);
+  ~db_basic_tx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  double freq_min();
+  double freq_max();
+  struct freq_result_t set_freq(double target_freq);
+  bool  set_gain(float gain);
+  bool  is_quadrature();
+};
+
+
+/******************************************************************************/
+
+
+class db_basic_rx : public db_base
+{
+ public:
+  db_basic_rx(usrp_basic_sptr usrp, int which, int subdev);
+  ~db_basic_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  double freq_min();
+  double freq_max();
+  struct freq_result_t set_freq(double target_freq);
+  bool set_gain(float gain);
+  bool is_quadrature();
+
+private:
+  int d_subdev;
+};
+
+
+/******************************************************************************/
+
+
+class db_lf_rx : public db_basic_rx
+{
+ public:
+  db_lf_rx(usrp_basic_sptr usrp, int which, int subdev);
+  ~db_lf_rx();
+  
+  double freq_min();
+  double freq_max();
+};
+
+
+/******************************************************************************/
+
+
+class db_lf_tx : public db_basic_tx
+{ 
+ public:
+  db_lf_tx(usrp_basic_sptr usrp, int which);
+  ~db_lf_tx();
+  
+  double freq_min();
+  double freq_max();
+};
+
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_basic.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_basic.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_basic.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_basic.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_basic.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_basic.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_basic.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_basic.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_basic.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_basic.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_basic.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_basic.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_basic.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_basic.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_basic.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_basic.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_basic.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_basic.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_basic.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_basic.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dbs_rx.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dbs_rx.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dbs_rx.h
                                (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dbs_rx.h
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,83 @@
+/* -*- 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 asversion 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 DB_DBS_RX_H
+#define DB_DBS_RX_H
+
+#include <usrp/db_base.h>
+#include <vector>
+
+#if 0
+struct bw_t {
+  int m;
+  int fdac;
+  float div;
+};
+#endif
+
+class db_dbs_rx : public db_base
+{
+private:
+  int d_osc, d_cp, d_n, d_div2, d_r, d_r_int;
+  int d_fdac, d_m, d_dl, d_ade, d_adl, d_gc1, d_gc2, d_diag;
+  int d_i2c_addr;
+  
+  // Internal gain functions
+  void _write_reg(int regno, int v);
+  void _write_regs(int starting_regno, const std::vector<int> &vals);
+  std::vector<int> _read_status();
+  void _send_reg(int regno);
+  void _set_m(int m);
+  void _set_fdac(int fdac);
+  void _set_dl(int dl);
+  void _set_gc2(int gc2);
+  void _set_gc1(int gc1);
+  void _set_pga(int pga_gain);
+
+  // Internal frequency function
+  void _set_osc(int osc);
+  void _set_cp(int cp);
+  void _set_n(int n);
+  void _set_div2(int div2);
+  void _set_r(int r);
+  void _set_ade(int ade);
+
+  int _refclk_divisor();
+
+protected:
+  void shutdown();
+
+public:
+  db_dbs_rx(usrp_basic_sptr usrp, int which);
+  ~db_dbs_rx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  double freq_min();
+  double freq_max();
+  struct freq_result_t set_freq(double freq);
+  bool  set_gain(float gain);
+  bool  is_quadrature();
+  bool  set_bw(float bw);
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dbs_rx.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_dbs_rx.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_dbs_rx.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_dbs_rx.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_dbs_rx.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_dbs_rx.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_dbs_rx.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_dbs_rx.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_dbs_rx.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_dbs_rx.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_dbs_rx.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_dbs_rx.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_dbs_rx.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_dbs_rx.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_dbs_rx.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_dbs_rx.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_dbs_rx.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_dbs_rx.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_dbs_rx.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_dbs_rx.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt754.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt754.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt754.h
                                (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt754.h
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,57 @@
+/* -*- 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 asversion 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 DB_DTT754_H
+#define DB_DTT754_H
+
+#include <usrp/db_base.h>
+#include <boost/shared_ptr.hpp>
+
+class db_dtt754 : public db_base
+{
+public:
+  db_dtt754(usrp_basic_sptr usrp, int which);
+  ~db_dtt754();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool  set_gain(float gain);
+
+  double freq_min();
+  double freq_max();
+  struct freq_result_t set_freq(double target_freq);
+  
+  bool is_quadrature();
+  bool spectrum_inverted();
+  bool set_bw(float bw);
+
+private:
+  void _set_rfagc(float gain);
+  void _set_ifagc(float gain);
+  void _set_pga(float pga_gain);
+
+  int d_i2c_addr;
+  float d_bw, d_freq, d_IF, d_f_ref;
+  bool d_inverted;
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt754.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_dtt754.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_dtt754.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_dtt754.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_dtt754.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_dtt754.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_dtt754.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_dtt754.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_dtt754.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_dtt754.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_dtt754.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_dtt754.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_dtt754.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_dtt754.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_dtt754.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_dtt754.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_dtt754.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_dtt754.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_dtt754.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_dtt754.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt768.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt768.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt768.h
                                (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt768.h
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,57 @@
+/* -*- 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 asversion 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 DB_DTT768_H
+#define DB_DTT768_H
+
+#include <usrp/db_base.h>
+#include <boost/shared_ptr.hpp>
+
+class db_dtt768 : public db_base
+{
+public:
+  db_dtt768(usrp_basic_sptr usrp, int which);
+  ~db_dtt768();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool  set_gain(float gain);
+
+  double freq_min();
+  double freq_max();
+  struct freq_result_t set_freq(double target_freq);
+  
+  bool is_quadrature();
+  bool spectrum_inverted();
+  bool set_bw(float bw);
+
+private:
+  void _set_rfagc(float gain);
+  void _set_ifagc(float gain);
+  void _set_pga(float pga_gain);
+
+  int d_i2c_addr;
+  float d_bw, d_freq, d_IF, d_f_ref;
+  bool d_inverted;
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_dtt768.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_dtt768.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_dtt768.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_dtt768.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_dtt768.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_dtt768.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_dtt768.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_dtt768.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_dtt768.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_dtt768.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_dtt768.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_dtt768.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_dtt768.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_dtt768.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_dtt768.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_dtt768.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_dtt768.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_dtt768.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_dtt768.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_dtt768.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf.h
                                (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf.h
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,355 @@
+/* -*- 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 asversion 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 DB_FLEXRF_H
+#define DB_FLEXRF_H
+
+#include <usrp/db_base.h>
+#include <cmath>
+
+//debug_using_gui = true                // Must be set to True or False
+#define debug_using_gui false           // Must be set to True or False
+
+class _AD4360_common;
+
+class flexrf_base : public db_base
+{
+public:
+  flexrf_base(usrp_basic_sptr usrp, int which, int _power_on=0);
+  ~flexrf_base();
+
+  struct freq_result_t set_freq(double freq);
+
+  bool  is_quadrature();
+  double freq_min();
+  double freq_max();
+
+protected:
+  void _write_all(int R, int control, int N);
+  void _write_control(int control);
+  void _write_R(int R);
+  void _write_N(int N);
+  void _write_it(int v);
+  bool _lock_detect();
+
+  virtual bool _compute_regs(double freq, int &retR, int &retcontrol, 
+                            int &retN, double &retfreq);
+  int  _compute_control_reg();
+  int _refclk_divisor();
+  double _refclk_freq();
+
+  bool _set_pga(float pga_gain);
+
+  int power_on() { return d_power_on; }
+  int power_off() { return 0; }
+
+  bool d_first;
+  int  d_spi_format;
+  int  d_spi_enable;
+  int  d_power_on;
+  int  d_PD;
+
+  _AD4360_common *d_common;
+};
+
+// ----------------------------------------------------------------
+
+class flexrf_base_tx : public flexrf_base
+{
+protected:
+  void shutdown();
+
+public:
+  flexrf_base_tx(usrp_basic_sptr usrp, int which, int _power_on=0);
+  ~flexrf_base_tx();
+
+  // All RFX tx d'boards have fixed gain
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+
+  bool set_auto_tr(bool on);
+  bool set_enable(bool on);
+  bool set_gain(float gain);
+};
+
+class flexrf_base_rx : public flexrf_base
+{
+protected:
+  void shutdown();
+
+public:
+  flexrf_base_rx(usrp_basic_sptr usrp, int which, int _power_on=0);
+  ~flexrf_base_rx();
+    
+  bool set_auto_tr(bool on);
+  bool select_rx_antenna(int which_antenna);
+  bool select_rx_antenna(const std::string &which_antenna);
+  bool set_gain(float gain);
+
+};
+
+// ----------------------------------------------------------------
+
+
+class _AD4360_common
+{
+public:
+  _AD4360_common();
+  virtual ~_AD4360_common();
+
+  virtual double freq_min() = 0;
+  virtual double freq_max() = 0;
+
+  bool _compute_regs(double refclk_freq, double freq, int &retR, 
+                    int &retcontrol, int &retN, double &retfreq);
+  int _compute_control_reg();
+  virtual int _refclk_divisor();
+  int _prescaler();
+
+  void R_DIV(int div) { d_R_DIV = div; }
+
+protected:
+  int d_R_RSV, d_BSC, d_TEST, d_LDP, d_ABP, d_N_RSV, d_PL, d_MTLD;
+  int d_CPG, d_CP3S, d_PDP, d_MUXOUT, d_CR, d_PC;
+
+  // FIXME: d_PD might cause conflict from flexrf_base
+  int d_A_DIV, d_B_DIV, d_R_DIV, d_P, d_PD, d_CP2, d_CP1, d_DIVSEL;
+  int d_DIV2, d_CPGAIN, d_freq_mult;
+
+};
+
+//----------------------------------------------------------------------
+
+class _2400_common : public _AD4360_common
+{
+ public:
+  _2400_common();
+  ~_2400_common() {}
+ 
+  double freq_min();
+  double freq_max();
+};
+
+//----------------------------------------------------------------------
+
+class _1200_common : public _AD4360_common
+{
+public:
+  _1200_common();
+  ~_1200_common() {}
+
+  double freq_min();
+  double freq_max();
+};
+
+//-------------------------------------------------------------------------
+
+class _1800_common : public _AD4360_common
+{
+ public:
+  _1800_common();
+  ~_1800_common() {}
+
+  double freq_min();
+  double freq_max();
+};
+
+//-------------------------------------------------------------------------
+
+class _900_common : public _AD4360_common
+{
+public:
+  _900_common();
+  ~_900_common() {}
+  
+  double freq_min();
+  double freq_max();
+};
+
+//-------------------------------------------------------------------------
+
+class _400_common : public _AD4360_common
+{
+public:
+  _400_common();
+  ~_400_common() {}
+
+  double freq_min();
+  double freq_max();
+};
+
+class _400_tx : public _400_common
+{
+public:
+  _400_tx();
+  ~_400_tx() {}
+};
+
+class _400_rx : public _400_common
+{
+public:
+  _400_rx();
+  ~_400_rx() {}
+};
+
+//------------------------------------------------------------    
+
+class db_flexrf_2400_tx : public flexrf_base_tx
+{
+ public:
+  db_flexrf_2400_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_2400_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_2400_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_2400_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_2400_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+//------------------------------------------------------------    
+
+class db_flexrf_1200_tx : public flexrf_base_tx
+{
+public:
+  db_flexrf_1200_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_1200_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_1200_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_1200_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_1200_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+//------------------------------------------------------------    
+
+class db_flexrf_1800_tx : public flexrf_base_tx
+{
+ public:
+  db_flexrf_1800_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_1800_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_1800_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_1800_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_1800_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+//------------------------------------------------------------    
+
+class db_flexrf_900_tx : public flexrf_base_tx
+{
+ public:
+  db_flexrf_900_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_900_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_900_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_900_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_900_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+
+//------------------------------------------------------------    
+
+class db_flexrf_400_tx : public flexrf_base_tx
+{
+ public:
+  db_flexrf_400_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_400_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_400_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_400_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_400_rx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_flexrf.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_flexrf.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_flexrf.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_flexrf.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_flexrf.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_flexrf.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_flexrf.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_flexrf.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_flexrf.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_flexrf.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_flexrf.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_flexrf.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_flexrf.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_flexrf.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_flexrf.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_flexrf.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_flexrf.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_flexrf.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_flexrf.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf_mimo.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf_mimo.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf_mimo.h
                           (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf_mimo.h
   2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ */ 
+
+#include <usrp/db_flexrf.h>
+
+class db_flexrf_2400_tx_mimo_a : public db_flexrf_2400_tx
+{
+ public:
+  db_flexrf_2400_tx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_2400_rx_mimo_a : public db_flexrf_2400_rx
+{
+ public:
+  db_flexrf_2400_rx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+      
+class db_flexrf_2400_tx_mimo_b : public db_flexrf_2400_tx
+{
+ public:
+  db_flexrf_2400_tx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_2400_rx_mimo_b : public db_flexrf_2400_rx
+{
+ public:
+  db_flexrf_2400_rx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+
+class db_flexrf_1800_tx_mimo_a : public db_flexrf_1800_tx
+{
+ public:
+  db_flexrf_1800_tx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1800_rx_mimo_a : public db_flexrf_1800_rx
+{
+ public:
+  db_flexrf_1800_rx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1800_tx_mimo_b : public db_flexrf_1800_tx
+{
+ public:
+  db_flexrf_1800_tx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1800_rx_mimo_b : public db_flexrf_1800_rx
+{
+ public:
+  db_flexrf_1800_rx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1200_tx_mimo_a : public db_flexrf_1200_tx
+{
+ public:
+  db_flexrf_1200_tx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1200_rx_mimo_a : public db_flexrf_1200_rx
+{
+ public:
+  db_flexrf_1200_rx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1200_tx_mimo_b : public db_flexrf_1200_tx
+{
+ public:
+  db_flexrf_1200_tx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_1200_rx_mimo_b : public db_flexrf_1200_rx
+{
+ public:
+  db_flexrf_1200_rx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_900_tx_mimo_a : public db_flexrf_900_tx
+{
+ public:
+  db_flexrf_900_tx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_900_rx_mimo_a : public db_flexrf_900_rx
+{
+ public:
+  db_flexrf_900_rx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_900_tx_mimo_b : public db_flexrf_900_tx
+{
+ public:
+  db_flexrf_900_tx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_900_rx_mimo_b : public db_flexrf_900_rx
+{
+ public:
+  db_flexrf_900_rx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_400_tx_mimo_a : public db_flexrf_400_tx
+{
+ public:
+  db_flexrf_400_tx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_400_rx_mimo_a : public db_flexrf_400_rx
+{
+ public:
+  db_flexrf_400_rx_mimo_a(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_400_tx_mimo_b : public db_flexrf_400_tx
+{
+ public:
+  db_flexrf_400_tx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};
+
+class db_flexrf_400_rx_mimo_b : public db_flexrf_400_rx
+{
+ public:
+  db_flexrf_400_rx_mimo_b(usrp_basic_sptr usrp, int which);
+  int _refclk_divisor();
+};


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_flexrf_mimo.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_flexrf_mimo.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_flexrf_mimo.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_flexrf_mimo.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_flexrf_mimo.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_flexrf_mimo.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_flexrf_mimo.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_flexrf_mimo.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_flexrf_mimo.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_flexrf_mimo.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_flexrf_mimo.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_flexrf_mimo.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_flexrf_mimo.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_flexrf_mimo.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_flexrf_mimo.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_flexrf_mimo.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_flexrf_mimo.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_flexrf_mimo.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_flexrf_mimo.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_flexrf_mimo.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_tv_rx.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_tv_rx.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_tv_rx.h
                         (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_tv_rx.h
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,56 @@
+/* -*- 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 asversion 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 DB_TV_RX_H
+#define DB_TV_RX_H
+
+#include <usrp/db_base.h>
+
+class db_tv_rx : public db_base
+{
+private:
+  void _set_rfagc(float gain);
+  void _set_ifagc(float gain);
+  void _set_pga(float pga_gain);
+
+  int d_i2c_addr;
+  double d_first_IF, d_second_IF;
+  int d_reference_divisor;
+  bool d_fast_tuning;
+  bool d_inverted;
+
+public:
+  db_tv_rx(usrp_basic_sptr usrp, int which, 
+          double first_IF, double second_IF);
+  ~db_tv_rx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  double freq_min();
+  double freq_max();
+  struct freq_result_t set_freq(double target_freq);
+  bool  set_gain(float gain);
+  bool  is_quadrature();
+  bool  spectrum_inverted();
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_tv_rx.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_tv_rx.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_tv_rx.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_tv_rx.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_tv_rx.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_tv_rx.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_tv_rx.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_tv_rx.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_tv_rx.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_tv_rx.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_tv_rx.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_tv_rx.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_tv_rx.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_tv_rx.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_tv_rx.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_tv_rx.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_tv_rx.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_tv_rx.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_tv_rx.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_tv_rx.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_xcvr2450.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_xcvr2450.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_xcvr2450.h
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_xcvr2450.h
      2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,92 @@
+/* -*- 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 asversion 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 DB_XCVR2450_H
+#define DB_XCVR2450_H
+
+#include <usrp/db_base.h>
+#include <boost/shared_ptr.hpp>
+
+class xcvr2450;
+typedef boost::shared_ptr<xcvr2450> xcvr2450_sptr;
+
+
+/******************************************************************************/
+
+
+class db_xcvr2450_base: public db_base
+{
+  /*
+   * Abstract base class for all xcvr2450 boards.
+   * 
+   * Derive board specific subclasses from db_xcvr2450_base_{tx,rx}
+   */
+public:
+  db_xcvr2450_base(usrp_basic_sptr usrp, int which);
+  ~db_xcvr2450_base();
+  struct freq_result_t set_freq(double target_freq);
+  bool is_quadrature();
+  double freq_min();
+  double freq_max();
+
+protected:
+  xcvr2450_sptr d_xcvr;
+  void shutdown_common();
+};
+
+
+/******************************************************************************/
+
+
+class db_xcvr2450_tx : public db_xcvr2450_base
+{
+protected:
+  void shutdown();
+
+public:
+  db_xcvr2450_tx(usrp_basic_sptr usrp, int which);
+  ~db_xcvr2450_tx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool  set_gain(float gain);
+  bool  i_and_q_swapped();
+};
+
+class db_xcvr2450_rx : public db_xcvr2450_base
+{
+protected:
+  void shutdown();
+
+public:
+  db_xcvr2450_rx(usrp_basic_sptr usrp, int which);
+  ~db_xcvr2450_rx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool  set_gain(float gain);
+};
+
+
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/db_xcvr2450.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_xcvr2450.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_xcvr2450.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_xcvr2450.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_xcvr2450.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_xcvr2450.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_xcvr2450.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_xcvr2450.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_xcvr2450.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_xcvr2450.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_xcvr2450.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_xcvr2450.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_xcvr2450.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_xcvr2450.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_xcvr2450.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_xcvr2450.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_xcvr2450.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_xcvr2450.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_xcvr2450.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_xcvr2450.h:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_basic.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_basic.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_basic.h
                               (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_basic.h
       2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,991 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2003,2004,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.
+ */
+
+/*
+ * ----------------------------------------------------------------------
+ * Mid level interface to the Universal Software Radio Peripheral (Rev 1)
+ *
+ * These classes implement the basic functionality for talking to the
+ * USRP.  They try to be as independent of the signal processing code
+ * in FPGA as possible.  They implement access to the low level
+ * peripherals on the board, provide a common way for reading and
+ * writing registers in the FPGA, and provide the high speed interface
+ * to streaming data across the USB.
+ *
+ * It is expected that subclasses will be derived that provide
+ * access to the functionality to a particular FPGA configuration.
+ * ----------------------------------------------------------------------
+ */
+
+#ifndef INCLUDED_USRP_BASIC_H
+#define INCLUDED_USRP_BASIC_H
+
+#include <usrp/db_base.h>
+#include <usrp/usrp_slots.h>
+#include <string>
+#include <vector>
+#include <boost/utility.hpp>
+#include <usrp/usrp_subdev_spec.h>
+
+struct usb_dev_handle;
+class  fusb_devhandle;
+class  fusb_ephandle;
+
+enum txrx_t {
+  C_RX = 0,
+  C_TX = 1
+};
+
+/*!
+ * \brief abstract base class for usrp operations
+ * \ingroup usrp
+ */
+class usrp_basic : boost::noncopyable
+{
+protected:
+  void shutdown_daughterboards();
+
+protected:
+  struct usb_dev_handle        *d_udh;
+  int                   d_usb_data_rate;       // bytes/sec
+  int                   d_bytes_per_poll;      // how often to poll for 
overruns
+  bool                  d_verbose;
+  long                   d_fpga_master_clock_freq;
+
+  static const int      MAX_REGS = 128;
+  unsigned int          d_fpga_shadows[MAX_REGS];
+
+  int                   d_dbid[2];             // daughterboard ID's (side A, 
side B)
+
+  /*!
+   * Shared pointers to subclasses of db_base.
+   *
+   * The outer vector is of length 2 (0 = side A, 1 = side B).  The
+   * inner vectors are of length 1, 2 or 3 depending on the number of
+   * subdevices implemented by the daugherboard.  At this time, only
+   * the Basic Rx and LF Rx implement more than 1 subdevice.
+   */
+  std::vector< std::vector<db_base_sptr> > d_db;
+
+  //! One time call, made only only from usrp_standard_*::make after 
shared_ptr is created.
+  void init_db(usrp_basic_sptr u);
+
+
+  usrp_basic (int which_board,
+             struct usb_dev_handle *open_interface (struct usb_device *dev),
+             const std::string fpga_filename = "",
+             const std::string firmware_filename = "");
+
+  /*!
+   * \brief advise usrp_basic of usb data rate (bytes/sec)
+   *
+   * N.B., this doesn't tweak any hardware.  Derived classes
+   * should call this to inform us of the data rate whenever it's
+   * first set or if it changes.
+   *
+   * \param usb_data_rate      bytes/sec
+   */
+  void set_usb_data_rate (int usb_data_rate);
+  
+  /*!
+   * \brief Write auxiliary digital to analog converter.
+   *
+   * \param slot       Which Tx or Rx slot to write.
+   *                   N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's.
+   *                   SLOT_TX_B and SLOT_RX_B share the same AUX DAC's.
+   * \param which_dac  [0,3] RX slots must use only 0 and 1.  TX slots must 
use only 2 and 3.
+   * \param value      [0,4095]
+   * \returns true iff successful
+   */
+  bool _write_aux_dac (int slot, int which_dac, int value);
+
+  /*!
+   * \brief Read auxiliary analog to digital converter.
+   *
+   * \param slot       2-bit slot number. E.g., SLOT_TX_A
+   * \param which_adc  [0,1]
+   * \param value      return 12-bit value [0,4095]
+   * \returns true iff successful
+   */
+  bool _read_aux_adc (int slot, int which_adc, int *value);
+
+  /*!
+   * \brief Read auxiliary analog to digital converter.
+   *
+   * \param slot       2-bit slot number. E.g., SLOT_TX_A
+   * \param which_adc  [0,1]
+   * \returns value in the range [0,4095] if successful, else READ_FAILED.
+   */
+  int _read_aux_adc (int slot, int which_adc);
+
+
+public:
+  virtual ~usrp_basic ();
+
+
+  /*!
+   * Return a vector of vectors that contain shared pointers
+   * to the daughterboard instance(s) associated with the specified side.
+   *
+   * It is an error to use the returned objects after the usrp_basic
+   * object has been destroyed.
+   */
+  std::vector<std::vector<db_base_sptr> > db() const { return d_db; }
+
+  /*!
+   * Return a vector of size >= 1 that contains shared pointers
+   * to the daughterboard instance(s) associated with the specified side.
+   *
+   * \param which_side [0,1] which daughterboard
+   *
+   * It is an error to use the returned objects after the usrp_basic
+   * object has been destroyed.
+   */
+  std::vector<db_base_sptr> db(int which_side);
+ 
+  /*!
+   * \brief is the subdev_spec valid?
+   */
+  bool is_valid(const usrp_subdev_spec &ss);
+
+  /*!
+   * \brief given a subdev_spec, return the corresponding daughterboard object.
+   * \throws std::invalid_ argument if ss is invalid.
+   *
+   * \param ss specifies the side and subdevice
+   */
+  db_base_sptr selected_subdev(const usrp_subdev_spec &ss);
+
+  /*!
+   * \brief return frequency of master oscillator on USRP
+   */
+  long fpga_master_clock_freq () const { return d_fpga_master_clock_freq; }
+
+  /*!
+   * Tell API that the master oscillator on the USRP is operating at a 
non-standard 
+   * fixed frequency. This is only needed for custom USRP hardware modified to 
+   * operate at a different frequency from the default factory configuration. 
This
+   * function must be called prior to any other API function.
+   * \param master_clock USRP2 FPGA master clock frequency in Hz (10..64 MHz)
+   */
+  void set_fpga_master_clock_freq (long master_clock) { 
d_fpga_master_clock_freq = master_clock; }
+
+  /*!
+   * \returns usb data rate in bytes/sec
+   */
+  int usb_data_rate () const { return d_usb_data_rate; }
+
+  void set_verbose (bool on) { d_verbose = on; }
+
+  //! magic value used on alternate register read interfaces
+  static const int READ_FAILED = -99999;
+
+  /*!
+   * \brief Write EEPROM on motherboard or any daughterboard.
+   * \param i2c_addr           I2C bus address of EEPROM
+   * \param eeprom_offset      byte offset in EEPROM to begin writing
+   * \param buf                        the data to write
+   * \returns true iff sucessful
+   */
+  bool write_eeprom (int i2c_addr, int eeprom_offset, const std::string buf);
+
+  /*!
+   * \brief Read EEPROM on motherboard or any daughterboard.
+   * \param i2c_addr           I2C bus address of EEPROM
+   * \param eeprom_offset      byte offset in EEPROM to begin reading
+   * \param len                        number of bytes to read
+   * \returns the data read if successful, else a zero length string.
+   */
+  std::string read_eeprom (int i2c_addr, int eeprom_offset, int len);
+
+  /*!
+   * \brief Write to I2C peripheral
+   * \param i2c_addr           I2C bus address (7-bits)
+   * \param buf                        the data to write
+   * \returns true iff successful
+   * Writes are limited to a maximum of of 64 bytes.
+   */
+  bool write_i2c (int i2c_addr, const std::string buf);
+
+  /*!
+   * \brief Read from I2C peripheral
+   * \param i2c_addr           I2C bus address (7-bits)
+   * \param len                        number of bytes to read
+   * \returns the data read if successful, else a zero length string.
+   * Reads are limited to a maximum of 64 bytes.
+   */
+  std::string read_i2c (int i2c_addr, int len);
+
+  /*!
+   * \brief Set ADC offset correction
+   * \param which_adc  which ADC[0,3]: 0 = RX_A I, 1 = RX_A Q...
+   * \param offset     16-bit value to subtract from raw ADC input.
+   */
+  bool set_adc_offset (int which_adc, int offset);
+
+  /*!
+   * \brief Set DAC offset correction
+   * \param which_dac  which DAC[0,3]: 0 = TX_A I, 1 = TX_A Q...
+   * \param offset     10-bit offset value (ambiguous format:  See AD9862 
datasheet).
+   * \param offset_pin 1-bit value.  If 0 offset applied to -ve differential 
pin;
+   *                                  If 1 offset applied to +ve differential 
pin.
+   */
+  bool set_dac_offset (int which_dac, int offset, int offset_pin);
+
+  /*!
+   * \brief Control ADC input buffer
+   * \param which_adc  which ADC[0,3]
+   * \param bypass     if non-zero, bypass input buffer and connect input
+   *                   directly to switched cap SHA input of RxPGA.
+   */
+  bool set_adc_buffer_bypass (int which_adc, bool bypass);
+
+  /*!
+   * \brief Enable/disable automatic DC offset removal control loop in FPGA
+   *
+   * \param bits  which control loops to enable
+   * \param mask  which \p bits to pay attention to
+   *
+   * If the corresponding bit is set, enable the automatic DC
+   * offset correction control loop.
+   *
+   * <pre>
+   * The 4 low bits are significant:
+   *
+   *   ADC0 = (1 << 0)
+   *   ADC1 = (1 << 1)
+   *   ADC2 = (1 << 2)
+   *   ADC3 = (1 << 3)
+   * </pre>
+   *
+   * By default the control loop is enabled on all ADC's.
+   */
+  bool set_dc_offset_cl_enable(int bits, int mask);
+
+  /*!
+   * \brief return the usrp's serial number.
+   *
+   * \returns non-zero length string iff successful.
+   */
+  std::string serial_number();
+
+  /*!
+   * \brief Return daughterboard ID for given side [0,1].
+   *
+   * \param which_side [0,1] which daughterboard
+   *
+   * \return daughterboard id >= 0 if successful
+   * \return -1 if no daugherboard
+   * \return -2 if invalid EEPROM on daughterboard
+   */
+  virtual int daughterboard_id (int which_side) const = 0;
+
+  /*!
+   * \brief Clock ticks to delay rising of T/R signal
+   * \sa write_atr_mask, write_atr_txval, write_atr_rxval
+   */
+  bool write_atr_tx_delay(int value);
+
+  /*!
+   * \brief Clock ticks to delay falling edge of T/R signal
+   * \sa write_atr_mask, write_atr_txval, write_atr_rxval
+   */
+  bool write_atr_rx_delay(int value);
+
+
+  // ================================================================
+  // Routines to access and control daughterboard specific i/o
+  //
+  // Those with a common_ prefix access either the Tx or Rx side depending
+  // on the txrx parameter.  Those without the common_ prefix are virtual
+  // and are overriden in usrp_basic_rx and usrp_basic_tx to access the
+  // the Rx or Tx sides automatically.  We provide the common_ versions
+  // for those daughterboards such as the WBX and XCVR2450 that share
+  // h/w resources (such as the LO) between the Tx and Rx sides.
+
+  // ----------------------------------------------------------------
+  // BEGIN common_  daughterboard control functions
+
+  /*!
+   * \brief Set Programmable Gain Amplifier(PGA)
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_amp  which amp [0,3]
+   * \param gain_in_db gain value(linear in dB)
+   *
+   * gain is rounded to closest setting supported by hardware.
+   *
+   * \returns true iff sucessful.
+   *
+   * \sa pga_min(), pga_max(), pga_db_per_step()
+   */
+  bool common_set_pga(txrx_t txrx, int which_amp, double gain_in_db);
+
+  /*!
+   * \brief Return programmable gain amplifier gain setting in dB.
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_amp  which amp [0,3]
+   */
+  double common_pga(txrx_t txrx, int which_amp) const;
+
+  /*!
+   * \brief Return minimum legal PGA gain in dB.
+   * \param txrx       Tx or Rx?
+   */
+  double common_pga_min(txrx_t txrx) const;
+
+  /*!
+   * \brief Return maximum legal PGA gain in dB.
+   * \param txrx       Tx or Rx?
+   */
+  double common_pga_max(txrx_t txrx) const;
+
+  /*!
+   * \brief Return hardware step size of PGA(linear in dB).
+   * \param txrx       Tx or Rx?
+   */
+  double common_pga_db_per_step(txrx_t txrx) const;
+
+  /*!
+   * \brief Write direction register(output enables) for pins that go to 
daughterboard.
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which size
+   * \param value      value to write into register
+   * \param mask       which bits of value to write into reg
+   *
+   * Each d'board has 16-bits of general purpose i/o.
+   * Setting the bit makes it an output from the FPGA to the d'board.
+   *
+   * This register is initialized based on a value stored in the
+   * d'board EEPROM.  In general, you shouldn't be using this routine
+   * without a very good reason.  Using this method incorrectly will
+   * kill your USRP motherboard and/or daughterboard.
+   */
+  bool _common_write_oe(txrx_t txrx, int which_side, int value, int mask);
+
+  /*!
+   * \brief Write daughterboard i/o pin value
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   * \param value      value to write into register
+   * \param mask       which bits of value to write into reg
+   */
+  bool common_write_io(txrx_t txrx, int which_side, int value, int mask);
+
+  /*!
+   * \brief Read daughterboard i/o pin value
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   * \param value      output
+   */
+  bool common_read_io(txrx_t txrx, int which_side, int *value);
+
+  /*!
+   * \brief Read daughterboard i/o pin value
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   * \returns register value if successful, else READ_FAILED
+   */
+  int common_read_io(txrx_t txrx, int which_side);
+
+  /*!
+   * \brief Write daughterboard refclk config register
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   * \param value      value to write into register, see below
+   *
+   * <pre>
+   * Control whether a reference clock is sent to the daughterboards,
+   * and what frequency.  The refclk is sent on d'board i/o pin 0.
+   * 
+   *     3                   2                   1                       
+   *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+   *  +-----------------------------------------------+-+------------+
+   *  |             Reserved (Must be zero)           |E|   DIVISOR  |
+   *  +-----------------------------------------------+-+------------+
+   * 
+   *  Bit 7  -- 1 turns on refclk, 0 allows IO use
+   *  Bits 6:0 Divider value
+   * </pre>
+   */
+  bool common_write_refclk(txrx_t txrx, int which_side, int value);
+
+  /*!
+   * \brief Automatic Transmit/Receive switching
+   * <pre>
+   *
+   * If automatic transmit/receive (ATR) switching is enabled in the
+   * FR_ATR_CTL register, the presence or absence of data in the FPGA
+   * transmit fifo selects between two sets of values for each of the 4
+   * banks of daughterboard i/o pins.
+   *
+   * Each daughterboard slot has 3 16-bit registers associated with it:
+   *   FR_ATR_MASK_*, FR_ATR_TXVAL_* and FR_ATR_RXVAL_*
+   *
+   * FR_ATR_MASK_{0,1,2,3}: 
+   *
+   *   These registers determine which of the daugherboard i/o pins are
+   *   affected by ATR switching.  If a bit in the mask is set, the
+   *   corresponding i/o bit is controlled by ATR, else it's output
+   *   value comes from the normal i/o pin output register:
+   *   FR_IO_{0,1,2,3}.
+   *
+   * FR_ATR_TXVAL_{0,1,2,3}:
+   * FR_ATR_RXVAL_{0,1,2,3}:
+   *
+   *   If the Tx fifo contains data, then the bits from TXVAL that are
+   *   selected by MASK are output.  Otherwise, the bits from RXVAL that
+   *   are selected by MASK are output.
+   * </pre>
+   */
+  bool common_write_atr_mask(txrx_t txrx, int which_side, int value);
+  bool common_write_atr_txval(txrx_t txrx, int which_side, int value);
+  bool common_write_atr_rxval(txrx_t txrx, int which_side, int value);
+
+  /*!
+   * \brief Write auxiliary digital to analog converter.
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   *                   N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's.
+   *                   SLOT_TX_B and SLOT_RX_B share the same AUX DAC's.
+   * \param which_dac  [2,3] TX slots must use only 2 and 3.
+   * \param value      [0,4095]
+   * \returns true iff successful
+   */
+  bool common_write_aux_dac(txrx_t txrx, int which_side, int which_dac, int 
value);
+
+  /*!
+   * \brief Read auxiliary analog to digital converter.
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   * \param which_adc  [0,1]
+   * \param value      return 12-bit value [0,4095]
+   * \returns true iff successful
+   */
+  bool common_read_aux_adc(txrx_t txrx, int which_side, int which_adc, int 
*value);
+
+  /*!
+   * \brief Read auxiliary analog to digital converter.
+   *
+   * \param txrx       Tx or Rx?
+   * \param which_side [0,1] which d'board
+   * \param which_adc  [0,1]
+   * \returns value in the range [0,4095] if successful, else READ_FAILED.
+   */
+  int common_read_aux_adc(txrx_t txrx, int which_side, int which_adc);
+
+  // END common_ daughterboard control functions
+  // ----------------------------------------------------------------
+  // BEGIN virtual daughterboard control functions
+
+  /*!
+   * \brief Set Programmable Gain Amplifier (PGA)
+   *
+   * \param which_amp  which amp [0,3]
+   * \param gain_in_db gain value (linear in dB)
+   *
+   * gain is rounded to closest setting supported by hardware.
+   *
+   * \returns true iff sucessful.
+   *
+   * \sa pga_min(), pga_max(), pga_db_per_step()
+   */
+  virtual bool set_pga (int which_amp, double gain_in_db) = 0;
+
+  /*!
+   * \brief Return programmable gain amplifier gain setting in dB.
+   *
+   * \param which_amp  which amp [0,3]
+   */
+  virtual double pga (int which_amp) const = 0;
+
+  /*!
+   * \brief Return minimum legal PGA gain in dB.
+   */
+  virtual double pga_min () const = 0;
+
+  /*!
+   * \brief Return maximum legal PGA gain in dB.
+   */
+  virtual double pga_max () const = 0;
+
+  /*!
+   * \brief Return hardware step size of PGA (linear in dB).
+   */
+  virtual double pga_db_per_step () const = 0;
+
+  /*!
+   * \brief Write direction register (output enables) for pins that go to 
daughterboard.
+   *
+   * \param which_side [0,1] which size
+   * \param value      value to write into register
+   * \param mask       which bits of value to write into reg
+   *
+   * Each d'board has 16-bits of general purpose i/o.
+   * Setting the bit makes it an output from the FPGA to the d'board.
+   *
+   * This register is initialized based on a value stored in the
+   * d'board EEPROM.  In general, you shouldn't be using this routine
+   * without a very good reason.  Using this method incorrectly will
+   * kill your USRP motherboard and/or daughterboard.
+   */
+  virtual bool _write_oe (int which_side, int value, int mask) = 0;
+
+  /*!
+   * \brief Write daughterboard i/o pin value
+   *
+   * \param which_side [0,1] which d'board
+   * \param value      value to write into register
+   * \param mask       which bits of value to write into reg
+   */
+  virtual bool write_io (int which_side, int value, int mask) = 0;
+
+  /*!
+   * \brief Read daughterboard i/o pin value
+   *
+   * \param which_side [0,1] which d'board
+   * \param value      output
+   */
+  virtual bool read_io (int which_side, int *value) = 0;
+
+  /*!
+   * \brief Read daughterboard i/o pin value
+   *
+   * \param which_side [0,1] which d'board
+   * \returns register value if successful, else READ_FAILED
+   */
+  virtual int read_io (int which_side) = 0;
+
+  /*!
+   * \brief Write daughterboard refclk config register
+   *
+   * \param which_side [0,1] which d'board
+   * \param value      value to write into register, see below
+   *
+   * <pre>
+   * Control whether a reference clock is sent to the daughterboards,
+   * and what frequency.  The refclk is sent on d'board i/o pin 0.
+   * 
+   *     3                   2                   1                       
+   *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+   *  +-----------------------------------------------+-+------------+
+   *  |             Reserved (Must be zero)           |E|   DIVISOR  |
+   *  +-----------------------------------------------+-+------------+
+   * 
+   *  Bit 7  -- 1 turns on refclk, 0 allows IO use
+   *  Bits 6:0 Divider value
+   * </pre>
+   */
+  virtual bool write_refclk(int which_side, int value) = 0;
+
+  virtual bool write_atr_mask(int which_side, int value) = 0;
+  virtual bool write_atr_txval(int which_side, int value) = 0;
+  virtual bool write_atr_rxval(int which_side, int value) = 0;
+
+  /*!
+   * \brief Write auxiliary digital to analog converter.
+   *
+   * \param which_side [0,1] which d'board
+   *                   N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's.
+   *                   SLOT_TX_B and SLOT_RX_B share the same AUX DAC's.
+   * \param which_dac  [2,3] TX slots must use only 2 and 3.
+   * \param value      [0,4095]
+   * \returns true iff successful
+   */
+  virtual bool write_aux_dac (int which_side, int which_dac, int value) = 0;
+
+  /*!
+   * \brief Read auxiliary analog to digital converter.
+   *
+   * \param which_side [0,1] which d'board
+   * \param which_adc  [0,1]
+   * \param value      return 12-bit value [0,4095]
+   * \returns true iff successful
+   */
+  virtual bool read_aux_adc (int which_side, int which_adc, int *value) = 0;
+
+  /*!
+   * \brief Read auxiliary analog to digital converter.
+   *
+   * \param which_side [0,1] which d'board
+   * \param which_adc  [0,1]
+   * \returns value in the range [0,4095] if successful, else READ_FAILED.
+   */
+  virtual int read_aux_adc (int which_side, int which_adc) = 0;
+
+  /*!
+   * \brief returns current fusb block size
+   */
+  virtual int block_size() const = 0;
+
+  /*!
+   * \brief returns A/D or D/A converter rate in Hz
+   */
+  virtual long converter_rate() const = 0;
+
+  // END virtual daughterboard control functions
+
+  // ----------------------------------------------------------------
+  // Low level implementation routines.
+  // You probably shouldn't be using these...
+  //
+
+  bool _set_led (int which_led, bool on);
+
+  /*!
+   * \brief Write FPGA register.
+   * \param regno      7-bit register number
+   * \param value      32-bit value
+   * \returns true iff successful
+   */
+  bool _write_fpga_reg (int regno, int value); //< 7-bit regno, 32-bit value
+
+  /*!
+   * \brief Read FPGA register.
+   * \param regno      7-bit register number
+   * \param value      32-bit value
+   * \returns true iff successful
+   */
+  bool _read_fpga_reg (int regno, int *value); //< 7-bit regno, 32-bit value
+
+  /*!
+   * \brief Read FPGA register.
+   * \param regno      7-bit register number
+   * \returns register value if successful, else READ_FAILED
+   */
+  int  _read_fpga_reg (int regno);
+
+  /*!
+   * \brief Write FPGA register with mask.
+   * \param regno      7-bit register number
+   * \param value      16-bit value
+   * \param mask       16-bit value
+   * \returns true if successful
+   * Only use this for registers who actually implement a mask in the verilog 
firmware, like FR_RX_MASTER_SLAVE
+   */
+  bool _write_fpga_reg_masked (int regno, int value, int mask);
+
+  /*!
+   * \brief Write AD9862 register.
+   * \param which_codec 0 or 1
+   * \param regno      6-bit register number
+   * \param value      8-bit value
+   * \returns true iff successful
+   */
+  bool _write_9862 (int which_codec, int regno, unsigned char value);
+
+  /*!
+   * \brief Read AD9862 register.
+   * \param which_codec 0 or 1
+   * \param regno      6-bit register number
+   * \param value      8-bit value
+   * \returns true iff successful
+   */
+  bool _read_9862 (int which_codec, int regno, unsigned char *value) const;
+
+  /*!
+   * \brief Read AD9862 register.
+   * \param which_codec 0 or 1
+   * \param regno      6-bit register number
+   * \returns register value if successful, else READ_FAILED
+   */
+  int  _read_9862 (int which_codec, int regno) const;
+
+  /*!
+   * \brief Write data to SPI bus peripheral.
+   *
+   * \param optional_header    0,1 or 2 bytes to write before buf.
+   * \param enables            bitmask of peripherals to write. See 
usrp_spi_defs.h
+   * \param format             transaction format.  See usrp_spi_defs.h 
SPI_FMT_*
+   * \param buf                        the data to write
+   * \returns true iff successful
+   * Writes are limited to a maximum of 64 bytes.
+   *
+   * If \p format specifies that optional_header bytes are present, they are
+   * written to the peripheral immediately prior to writing \p buf.
+   */
+  bool _write_spi (int optional_header, int enables, int format, std::string 
buf);
+
+  /*
+   * \brief Read data from SPI bus peripheral.
+   *
+   * \param optional_header    0,1 or 2 bytes to write before buf.
+   * \param enables            bitmask of peripheral to read. See 
usrp_spi_defs.h
+   * \param format             transaction format.  See usrp_spi_defs.h 
SPI_FMT_*
+   * \param len                        number of bytes to read.  Must be in 
[0,64].
+   * \returns the data read if sucessful, else a zero length string.
+   *
+   * Reads are limited to a maximum of 64 bytes.
+   *
+   * If \p format specifies that optional_header bytes are present, they
+   * are written to the peripheral first.  Then \p len bytes are read from
+   * the peripheral and returned.
+   */
+  std::string _read_spi (int optional_header, int enables, int format, int 
len);
+
+  /*!
+   * \brief Start data transfers.
+   * Called in base class to derived class order.
+   */
+  bool start ();
+
+  /*!
+   * \brief Stop data transfers.
+   * Called in base class to derived class order.
+   */
+  bool stop ();
+};
+
+/*!
+ * \brief class for accessing the receive side of the USRP
+ * \ingroup usrp
+ */
+class usrp_basic_rx : public usrp_basic 
+{
+private:
+  fusb_devhandle       *d_devhandle;
+  fusb_ephandle                *d_ephandle;
+  int                   d_bytes_seen;          // how many bytes we've seen
+  bool                  d_first_read;
+  bool                  d_rx_enable;
+
+protected:
+  /*!
+   * \param which_board             Which USRP board on usb (not particularly 
useful; use 0)
+   * \param fusb_block_size  fast usb xfer block size.  Must be a multiple of 
512. 
+   *                         Use zero for a reasonable default.
+   * \param fusb_nblocks     number of fast usb URBs to allocate.  Use zero 
for a reasonable default. 
+   * \param fpga_filename    name of the rbf file to load
+   * \param firmware_filename name of ihx file to load
+   */
+  usrp_basic_rx (int which_board,
+                int fusb_block_size=0,
+                int fusb_nblocks=0,
+                const std::string fpga_filename = "",
+                const std::string firmware_filename = ""
+                );  // throws if trouble
+
+  bool set_rx_enable (bool on);
+  bool rx_enable () const { return d_rx_enable; }
+
+  bool disable_rx ();          // conditional disable, return prev state
+  void restore_rx (bool on);   // conditional set
+
+  void probe_rx_slots (bool verbose);
+
+public:
+  ~usrp_basic_rx ();
+
+  /*!
+   * \brief invokes constructor, returns instance or 0 if trouble
+   *
+   * \param which_board             Which USRP board on usb (not particularly 
useful; use 0)
+   * \param fusb_block_size  fast usb xfer block size.  Must be a multiple of 
512. 
+   *                         Use zero for a reasonable default.
+   * \param fusb_nblocks     number of fast usb URBs to allocate.  Use zero 
for a reasonable default. 
+   * \param fpga_filename    name of file that contains image to load into FPGA
+   * \param firmware_filename  name of file that contains image to load into 
FX2
+   */
+  static usrp_basic_rx *make (int which_board,
+                             int fusb_block_size=0,
+                             int fusb_nblocks=0,
+                             const std::string fpga_filename = "",
+                             const std::string firmware_filename = ""
+                             );
+
+  /*!
+   * \brief tell the fpga the rate rx samples are coming from the A/D's
+   *
+   * div = fpga_master_clock_freq () / sample_rate
+   *
+   * sample_rate is determined by a myriad of registers
+   * in the 9862.  That's why you have to tell us, so
+   * we can tell the fpga.
+   */
+  bool set_fpga_rx_sample_rate_divisor (unsigned int div);
+
+  /*!
+   * \brief read data from the D/A's via the FPGA.
+   * \p len must be a multiple of 512 bytes.
+   *
+   * \returns the number of bytes read, or -1 on error.
+   *
+   * If overrun is non-NULL it will be set true iff an RX overrun is detected.
+   */
+  int read (void *buf, int len, bool *overrun);
+
+
+  //! sampling rate of A/D converter
+  virtual long converter_rate() const { return fpga_master_clock_freq(); } // 
64M
+  long adc_rate() const { return converter_rate(); }
+  int daughterboard_id (int which_side) const { return d_dbid[which_side & 
0x1]; }
+
+  bool set_pga (int which_amp, double gain_in_db);
+  double pga (int which_amp) const;
+  double pga_min () const;
+  double pga_max () const;
+  double pga_db_per_step () const;
+
+  bool _write_oe (int which_side, int value, int mask);
+  bool write_io (int which_side, int value, int mask);
+  bool read_io (int which_side, int *value);
+  int read_io (int which_side);
+  bool write_refclk(int which_side, int value);
+  bool write_atr_mask(int which_side, int value);
+  bool write_atr_txval(int which_side, int value);
+  bool write_atr_rxval(int which_side, int value);
+
+  bool write_aux_dac (int which_side, int which_dac, int value);
+  bool read_aux_adc (int which_side, int which_adc, int *value);
+  int  read_aux_adc (int which_side, int which_adc);
+
+  int block_size() const;
+
+  // called in base class to derived class order
+  bool start ();
+  bool stop ();
+};
+
+/*!
+ * \brief class for accessing the transmit side of the USRP
+ * \ingroup usrp
+ */
+class usrp_basic_tx : public usrp_basic 
+{
+private:
+  fusb_devhandle       *d_devhandle;
+  fusb_ephandle                *d_ephandle;
+  int                   d_bytes_seen;          // how many bytes we've seen
+  bool                  d_first_write;
+  bool                  d_tx_enable;
+
+ protected:
+  /*!
+   * \param which_board             Which USRP board on usb (not particularly 
useful; use 0)
+   * \param fusb_block_size  fast usb xfer block size.  Must be a multiple of 
512.
+   *                         Use zero for a reasonable default.
+   * \param fusb_nblocks     number of fast usb URBs to allocate.  Use zero 
for a reasonable default.
+   * \param fpga_filename    name of file that contains image to load into FPGA
+   * \param firmware_filename  name of file that contains image to load into 
FX2
+   */
+  usrp_basic_tx (int which_board,
+                int fusb_block_size=0,
+                int fusb_nblocks=0,
+                const std::string fpga_filename = "",
+                const std::string firmware_filename = ""
+                );             // throws if trouble
+
+  bool set_tx_enable (bool on);
+  bool tx_enable () const { return d_tx_enable; }
+
+  bool disable_tx ();          // conditional disable, return prev state
+  void restore_tx (bool on);   // conditional set
+
+  void probe_tx_slots (bool verbose);
+
+public:
+
+  ~usrp_basic_tx ();
+
+  /*!
+   * \brief invokes constructor, returns instance or 0 if trouble
+   *
+   * \param which_board             Which USRP board on usb (not particularly 
useful; use 0)
+   * \param fusb_block_size  fast usb xfer block size.  Must be a multiple of 
512. 
+   *                         Use zero for a reasonable default.
+   * \param fusb_nblocks     number of fast usb URBs to allocate.  Use zero 
for a reasonable default. 
+   * \param fpga_filename    name of file that contains image to load into FPGA
+   * \param firmware_filename  name of file that contains image to load into 
FX2
+   */
+  static usrp_basic_tx *make (int which_board, int fusb_block_size=0, int 
fusb_nblocks=0,
+                             const std::string fpga_filename = "",
+                             const std::string firmware_filename = ""
+                             );
+
+  /*!
+   * \brief tell the fpga the rate tx samples are going to the D/A's
+   *
+   * div = fpga_master_clock_freq () * 2
+   *
+   * sample_rate is determined by a myriad of registers
+   * in the 9862.  That's why you have to tell us, so
+   * we can tell the fpga.
+   */
+  bool set_fpga_tx_sample_rate_divisor (unsigned int div);
+
+  /*!
+   * \brief Write data to the A/D's via the FPGA.
+   *
+   * \p len must be a multiple of 512 bytes.
+   * \returns number of bytes written or -1 on error.
+   *
+   * if \p underrun is non-NULL, it will be set to true iff
+   * a transmit underrun condition is detected.
+   */
+  int write (const void *buf, int len, bool *underrun);
+
+  /*
+   * Block until all outstanding writes have completed.
+   * This is typically used to assist with benchmarking
+   */
+  void wait_for_completion ();
+
+  //! sampling rate of D/A converter
+  virtual long converter_rate() const { return fpga_master_clock_freq () * 2; 
} // 128M
+  long dac_rate() const { return converter_rate(); }
+  int daughterboard_id (int which_side) const { return d_dbid[which_side & 
0x1]; }
+
+  bool set_pga (int which_amp, double gain_in_db);
+  double pga (int which_amp) const;
+  double pga_min () const;
+  double pga_max () const;
+  double pga_db_per_step () const;
+
+  bool _write_oe (int which_side, int value, int mask);
+  bool write_io (int which_side, int value, int mask);
+  bool read_io (int which_side, int *value);
+  int read_io (int which_side);
+  bool write_refclk(int which_side, int value);
+  bool write_atr_mask(int which_side, int value);
+  bool write_atr_txval(int which_side, int value);
+  bool write_atr_rxval(int which_side, int value);
+
+  bool write_aux_dac (int which_side, int which_dac, int value);
+  bool read_aux_adc (int which_side, int which_adc, int *value);
+  int read_aux_adc (int which_side, int which_adc);
+
+  int block_size() const;
+
+  // called in base class to derived class order
+  bool start ();
+  bool stop ();
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_basic.h
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_basic.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_basic.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_basic.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_basic.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_basic.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_basic.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_basic.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_basic.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_basic.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_basic.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_basic.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_basic.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_basic.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_basic.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_basic.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_basic.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_basic.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_basic.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_basic.h:11235-11360
Added: svn:eol-style
   + native

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_bytesex.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_bytesex.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_bytesex.h
                             (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_bytesex.h
     2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,108 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_USRP_BYTESEX_H
+#define INCLUDED_USRP_BYTESEX_H
+
+/*!
+ * \brief routines for convertering between host and usrp byte order
+ *
+ * Prior to including this file, the user must include "config.h"
+ * which will or won't define WORDS_BIGENDIAN based on the
+ * result of the AC_C_BIGENDIAN autoconf test.
+ */
+
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#else
+
+#warning Using non-portable code (likely wrong other than ILP32).
+
+static inline unsigned short int
+bswap_16 (unsigned short int x)
+{
+  return ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8));
+}
+
+static inline unsigned int
+bswap_32 (unsigned int x)
+{
+  return ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) \
+        | (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24));
+}
+#endif
+
+
+#ifdef WORDS_BIGENDIAN
+
+static inline unsigned int
+host_to_usrp_u32 (unsigned int x)
+{
+  return bswap_32(x);
+}
+
+static inline unsigned int
+usrp_to_host_u32 (unsigned int x)
+{
+  return bswap_32(x);
+}
+
+static inline short int
+host_to_usrp_short (short int x)
+{
+  return bswap_16 (x);
+}
+
+static inline short int
+usrp_to_host_short (short int x)
+{
+  return bswap_16 (x);
+}
+
+#else
+
+static inline unsigned int
+host_to_usrp_u32 (unsigned int x)
+{
+  return x;
+}
+
+static inline unsigned int
+usrp_to_host_u32 (unsigned int x)
+{
+  return x;
+}
+
+static inline short int
+host_to_usrp_short (short int x)
+{
+  return x;
+}
+
+static inline short int
+usrp_to_host_short (unsigned short int x)
+{
+  return x;
+}
+
+#endif
+
+#endif /* INCLUDED_USRP_BYTESEX_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_bytesex.h
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_bytesex.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_bytesex.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_bytesex.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_bytesex.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_bytesex.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_bytesex.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_bytesex.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_bytesex.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_bytesex.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_bytesex.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_bytesex.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_bytesex.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_bytesex.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_bytesex.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_bytesex.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_bytesex.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_bytesex.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_bytesex.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_bytesex.h:11235-11360
Added: svn:eol-style
   + native

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_prims.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_prims.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_prims.h
                               (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_prims.h
       2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,294 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2003,2004,2006,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.
+ */
+
+/*
+ * Low level primitives for directly messing with USRP hardware.
+ *
+ * If you're trying to use the USRP, you'll probably want to take a look
+ * at the usrp_rx and usrp_tx classes.  They hide a bunch of low level details
+ * and provide high performance streaming i/o.
+ *
+ * This interface is built on top of libusb, which allegedly works under
+ * Linux, *BSD and Mac OS/X.  http://libusb.sourceforge.net
+ */
+
+#ifndef _USRP_PRIMS_H_
+#define _USRP_PRIMS_H_
+
+#include <usrp/usrp_slots.h>
+#include <string>
+
+static const int USRP_HASH_SIZE = 16;
+
+enum usrp_load_status_t { ULS_ERROR = 0, ULS_OK, ULS_ALREADY_LOADED };
+
+struct usb_dev_handle;
+struct usb_device;
+
+/*!
+ * \brief initialize libusb; probe busses and devices.
+ * Safe to call more than once.
+ */
+void usrp_one_time_init ();
+
+/*
+ * force a rescan of the buses and devices
+ */
+void usrp_rescan ();
+
+/*!
+ * \brief locate Nth (zero based) USRP device in system.
+ * Return pointer or 0 if not found.
+ *
+ * The following kinds of devices are considered USRPs:
+ *
+ *   unconfigured USRP (no firwmare loaded)
+ *   configured USRP (firmware loaded)
+ *   unconfigured Cypress FX2 (only if fx2_ok_p is true)
+ */
+struct usb_device *usrp_find_device (int nth, bool fx2_ok_p = false);
+
+bool usrp_usrp_p (struct usb_device *q);               //< is this a USRP
+bool usrp_usrp0_p (struct usb_device *q);              //< is this a USRP Rev 0
+bool usrp_usrp1_p (struct usb_device *q);              //< is this a USRP Rev 1
+bool usrp_usrp2_p (struct usb_device *q);              //< is this a USRP Rev 2
+int  usrp_hw_rev (struct usb_device *q);               //< return h/w rev code
+
+bool usrp_fx2_p (struct usb_device *q);                        //< is this an 
unconfigured Cypress FX2
+
+bool usrp_unconfigured_usrp_p (struct usb_device *q);  //< some kind of 
unconfigured USRP
+bool usrp_configured_usrp_p (struct usb_device *q);    //< some kind of 
configured USRP
+
+/*!
+ * \brief given a usb_device return an instance of the appropriate 
usb_dev_handle
+ *
+ * These routines claim the specified interface and select the
+ * correct alternate interface.  (USB nomenclature is totally screwed!)
+ *
+ * If interface can't be opened, or is already claimed by some other
+ * process, 0 is returned.
+ */
+struct usb_dev_handle *usrp_open_cmd_interface (struct usb_device *dev);
+struct usb_dev_handle *usrp_open_rx_interface (struct usb_device *dev);
+struct usb_dev_handle *usrp_open_tx_interface (struct usb_device *dev);
+
+/*!
+ * \brief close interface.
+ */
+bool usrp_close_interface (struct usb_dev_handle *udh);
+
+/*!
+ * \brief load intel hex format file into USRP/Cypress FX2 (8051).
+ *
+ * The filename extension is typically *.ihx
+ *
+ * Note that loading firmware may cause the device to renumerate.  I.e.,
+ * change its configuration, invalidating the current device handle.
+ */
+
+usrp_load_status_t 
+usrp_load_firmware (struct usb_dev_handle *udh, const char *filename, bool 
force);
+
+/*!
+ * \brief load intel hex format file into USRP FX2 (8051).
+ *
+ * The filename extension is typically *.ihx
+ *
+ * Note that loading firmware may cause the device to renumerate.  I.e.,
+ * change its configuration, invalidating the current device handle.
+ * If the result is ULS_OK, usrp_load_firmware_nth delays 1 second
+ * then rescans the busses and devices.
+ */
+usrp_load_status_t
+usrp_load_firmware_nth (int nth, const char *filename, bool force);
+
+/*!
+ * \brief load fpga configuration bitstream
+ */
+usrp_load_status_t
+usrp_load_fpga (struct usb_dev_handle *udh, const char *filename, bool force);
+
+/*!
+ * \brief load the regular firmware and fpga bitstream in the Nth USRP.
+ *
+ * This is the normal starting point...
+ */
+bool usrp_load_standard_bits (int nth, bool force,
+                             const std::string fpga_filename = "",
+                             const std::string firmware_filename = "");
+
+/*!
+ * \brief copy the given \p hash into the USRP hash slot \p which.
+ * The usrp implements two hash slots, 0 and 1.
+ */
+bool usrp_set_hash (struct usb_dev_handle *udh, int which,
+                   const unsigned char hash[USRP_HASH_SIZE]);
+
+/*!
+ * \brief retrieve the \p hash from the USRP hash slot \p which.
+ * The usrp implements two hash slots, 0 and 1.
+ */
+bool usrp_get_hash (struct usb_dev_handle *udh, int which,
+                   unsigned char hash[USRP_HASH_SIZE]);
+
+bool usrp_write_fpga_reg (struct usb_dev_handle *udh, int reg, int value);
+bool usrp_read_fpga_reg (struct usb_dev_handle *udh, int reg, int *value);
+bool usrp_set_fpga_reset (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_tx_enable (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_rx_enable (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_tx_reset (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_rx_reset (struct usb_dev_handle *udh, bool on);
+bool usrp_set_led (struct usb_dev_handle *udh, int which, bool on);
+
+bool usrp_check_rx_overrun (struct usb_dev_handle *udh, bool *overrun_p);
+bool usrp_check_tx_underrun (struct usb_dev_handle *udh, bool *underrun_p);
+
+// i2c_read and i2c_write are limited to a maximum len of 64 bytes.
+
+bool usrp_i2c_write (struct usb_dev_handle *udh, int i2c_addr,
+                    const void *buf, int len);
+
+bool usrp_i2c_read (struct usb_dev_handle *udh, int i2c_addr,
+                   void *buf, int len);
+
+// spi_read and spi_write are limited to a maximum of 64 bytes
+// See usrp_spi_defs.h for more info
+
+bool usrp_spi_write (struct usb_dev_handle *udh,
+                    int optional_header, int enables, int format,
+                    const void *buf, int len);
+
+bool usrp_spi_read (struct usb_dev_handle *udh,
+                    int optional_header, int enables, int format,
+                    void *buf, int len);
+
+
+bool usrp_9862_write (struct usb_dev_handle *udh,
+                     int which_codec,                  // [0,  1]
+                     int regno,                        // [0, 63]
+                     int value);                       // [0, 255]     
+
+bool usrp_9862_read (struct usb_dev_handle *udh,
+                    int which_codec,                   // [0,  1]
+                    int regno,                         // [0, 63]
+                    unsigned char *value);             // [0, 255]
+
+/*!
+ * \brief Write multiple 9862 regs at once.
+ *
+ * \p buf contains alternating register_number, register_value pairs.
+ * \p len must be even and is the length of buf in bytes.
+ */
+bool usrp_9862_write_many (struct usb_dev_handle *udh, int which_codec,
+                          const unsigned char *buf, int len);
+                          
+
+/*!
+ * \brief write specified regs to all 9862's in the system
+ */
+bool usrp_9862_write_many_all (struct usb_dev_handle *udh,
+                              const unsigned char *buf, int len);
+                          
+
+// Write 24LC024 / 24LC025 EEPROM on motherboard or daughterboard.
+// Which EEPROM is determined by i2c_addr.  See i2c_addr.h
+
+bool usrp_eeprom_write (struct usb_dev_handle *udh, int i2c_addr,
+                       int eeprom_offset, const void *buf, int len);
+
+
+// Read 24LC024 / 24LC025 EEPROM on motherboard or daughterboard.
+// Which EEPROM is determined by i2c_addr.  See i2c_addr.h
+
+bool usrp_eeprom_read (struct usb_dev_handle *udh, int i2c_addr,
+                      int eeprom_offset, void *buf, int len);
+
+
+// Slot specific i/o routines
+
+/*!
+ * \brief write to the specified aux dac.
+ *
+ * \p slot: which Tx or Rx slot to write.
+ *    N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's
+ *          SLOT_TX_B and SLOT_RX_B share the same AUX DAC's
+ *
+ * \p which_dac: [0,3]  RX slots must use only 0 and 1.
+ *                     TX slots must use only 2 and 3.
+ *
+ * AUX DAC 3 is really the 9862 sigma delta output.
+ *
+ * \p value to write to aux dac.  All dacs take straight
+ * binary values.  Although dacs 0, 1 and 2 are 8-bit and dac 3 is 12-bit,
+ * the interface is in terms of 12-bit values [0,4095]
+ */
+bool usrp_write_aux_dac (struct usb_dev_handle *uhd, int slot,
+                        int which_dac, int value);
+
+/*!
+ * \brief Read the specified aux adc
+ *
+ * \p slot: which Tx or Rx slot to read aux dac
+ * \p which_adc: [0,1]  which of the two adcs to read
+ * \p *value: return value, 12-bit straight binary.
+ */
+bool usrp_read_aux_adc (struct usb_dev_handle *udh, int slot,
+                       int which_adc, int *value);
+
+
+/*!
+ * \brief usrp daughterboard id to name mapping
+ */
+const std::string usrp_dbid_to_string (int dbid);
+
+
+enum usrp_dbeeprom_status_t { UDBE_OK, UDBE_BAD_SLOT, UDBE_NO_EEPROM, 
UDBE_INVALID_EEPROM };
+
+struct usrp_dboard_eeprom {
+  unsigned short       id;             // d'board identifier code
+  unsigned short       oe;             // fpga output enables:
+                                       //   If bit set, i/o pin is an output 
from FPGA.
+  short                        offset[2];      // ADC/DAC offset correction
+};
+
+/*!
+ * \brief Read and return parsed daughterboard eeprom
+ */
+usrp_dbeeprom_status_t
+usrp_read_dboard_eeprom (struct usb_dev_handle *udh,
+                        int slot_id, usrp_dboard_eeprom *eeprom);
+
+/*!
+ * \brief write ADC/DAC offset calibration constants to d'board eeprom
+ */
+bool usrp_write_dboard_offsets (struct usb_dev_handle *udh, int slot_id,
+                               short offset0, short offset1);
+
+/*!
+ * \brief return a usrp's serial number.
+ *
+ * Note that this only works on a configured usrp.
+ * \returns non-zero length string iff successful.
+ */
+std::string usrp_serial_number(struct usb_dev_handle *udh);
+
+#endif /* _USRP_PRIMS_H_ */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_prims.h
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_prims.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_prims.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_prims.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_prims.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_prims.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_prims.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_prims.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_prims.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_prims.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_prims.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_prims.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_prims.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_prims.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_prims.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_prims.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_prims.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_prims.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_prims.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_prims.h:11235-11360
Added: svn:eol-style
   + native

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_slots.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_slots.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_slots.h
                               (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_slots.h
       2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_USRP_SLOTS_H
+#define INCLUDED_USRP_SLOTS_H
+
+// daughterboard slot numbers used in some calls
+
+static const int SLOT_TX_A = 0;
+static const int SLOT_RX_A = 1;
+static const int SLOT_TX_B = 2;
+static const int SLOT_RX_B = 3;
+
+#endif /* INCLUDED_USRP_SLOTS_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_slots.h
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_slots.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_slots.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_slots.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_slots.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_slots.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_slots.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_slots.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_slots.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_slots.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_slots.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_slots.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_slots.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_slots.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_slots.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_slots.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_slots.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_slots.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_slots.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_slots.h:11235-11360
Added: svn:eol-style
   + native

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_standard.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_standard.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_standard.h
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_standard.h
    2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,452 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,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_USRP_STANDARD_H
+#define INCLUDED_USRP_STANDARD_H
+
+#include <usrp/usrp_basic.h>
+#include <boost/shared_ptr.hpp>
+#include <usrp/usrp_tune_result.h>
+
+class usrp_standard_tx;
+class usrp_standard_rx;
+
+typedef boost::shared_ptr<usrp_standard_tx> usrp_standard_tx_sptr;
+typedef boost::shared_ptr<usrp_standard_rx> usrp_standard_rx_sptr;
+
+/*!
+ * \ingroup usrp
+ */
+class usrp_standard_common
+{
+  int  d_fpga_caps;            // capability register val
+
+protected:
+  usrp_standard_common(usrp_basic *parent);
+
+public:
+  /*!
+   *\brief does the FPGA implement the final Rx half-band filter?
+   * If it doesn't, the maximum decimation factor with proper gain 
+   * is 1/2 of what it would otherwise be.
+   */
+  bool has_rx_halfband() const;
+
+  /*!
+   * \brief number of digital downconverters implemented in the FPGA
+   * This will be 0, 1, 2 or 4.
+   */
+  int nddcs() const;
+
+  /*!
+   *\brief does the FPGA implement the initial Tx half-band filter?
+   */
+  bool has_tx_halfband() const;
+
+  /*!
+   * \brief number of digital upconverters implemented in the FPGA
+   * This will be 0, 1, or 2.
+   */
+  int nducs() const;
+
+  /*!
+   * \brief Calculate the frequency to use for setting the digital up or down 
converter.
+   *
+   * \param target_freq is the desired RF frequency (Hz).
+   * \param baseband_freq is the RF frequency that corresponds to DC in the IF 
coming from the d'board.
+   * \param  fs is the sampling frequency.
+   * \param[out] dxc_freq the frequency to program into the DDC (or DUC).
+   * \param[out] inverted is true if we're operating in an inverted Nyquist 
zone.
+   */
+  static void calc_dxc_freq(double target_freq, double baseband_freq, double 
fs,
+                           double *dxc_freq, bool *inverted);
+};
+
+/*!
+ * \brief The C++ interface the receive side of the USRP
+ * \ingroup usrp
+ *
+ * This is the recommended interface to USRP receive functionality
+ * for applications that use the USRP but not GNU Radio.
+ */
+class usrp_standard_rx : public usrp_basic_rx, public usrp_standard_common
+{
+ private:
+  static const int     MAX_CHAN = 4;
+  unsigned int         d_decim_rate;
+  int                  d_nchan;
+  int                  d_sw_mux;
+  int                  d_hw_mux;
+  double               d_rx_freq[MAX_CHAN];
+
+ protected:
+  usrp_standard_rx (int which_board,
+                   unsigned int decim_rate,
+                   int nchan = 1,
+                   int mux = -1,
+                   int mode = 0,
+                   int fusb_block_size = 0,
+                   int fusb_nblocks = 0,
+                   const std::string fpga_filename = "",
+                   const std::string firmware_filename = ""
+                   );  // throws if trouble
+
+  bool write_hw_mux_reg ();
+
+ public:
+
+  enum {
+    FPGA_MODE_NORMAL     = 0x00,
+    FPGA_MODE_LOOPBACK   = 0x01,
+    FPGA_MODE_COUNTING   = 0x02,
+    FPGA_MODE_COUNTING_32BIT   = 0x04
+  };
+
+  ~usrp_standard_rx ();
+
+  /*!
+   * \brief invokes constructor, returns shared_ptr or shared_ptr equivalent 
of 0 if trouble
+   *
+   * \param which_board             Which USRP board on usb (not particularly 
useful; use 0)
+   * \param decim_rate      decimation factor
+   * \param nchan           number of channels
+   * \param mux                     Rx mux setting, \sa set_mux
+   * \param mode            mode
+   * \param fusb_block_size  fast usb xfer block size.  Must be a multiple of 
512. 
+   *                         Use zero for a reasonable default.
+   * \param fusb_nblocks     number of fast usb URBs to allocate.  Use zero 
for a reasonable default. 
+   * \param fpga_filename    Name of rbf file to load
+   * \param firmware_filename Name of ihx file to load
+   */
+  static usrp_standard_rx_sptr make(int which_board,
+                                   unsigned int decim_rate,
+                                   int nchan = 1,
+                                   int mux = -1,
+                                   int mode = 0,
+                                   int fusb_block_size = 0,
+                                   int fusb_nblocks = 0,
+                                   const std::string fpga_filename = "",
+                                   const std::string firmware_filename = ""
+                                   );
+  /*!
+   * \brief Set decimator rate.  \p rate MUST BE EVEN and in [8, 256].
+   *
+   * The final complex sample rate across the USB is
+   *   adc_freq () / decim_rate () * nchannels ()
+   */
+  bool set_decim_rate  (unsigned int rate);
+
+  /*!
+   * \brief Set number of active channels.  \p nchannels must be 1, 2 or 4.
+   *
+   * The final complex sample rate across the USB is
+   *   adc_freq () / decim_rate () * nchannels ()
+   */
+  bool set_nchannels (int nchannels);
+
+  /*!
+   * \brief Set input mux configuration.
+   *
+   * This determines which ADC (or constant zero) is connected to 
+   * each DDC input.  There are 4 DDCs.  Each has two inputs.
+   *
+   * <pre>
+   * Mux value:
+   *
+   *    3                   2                   1                       
+   *  1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+   * +-------+-------+-------+-------+-------+-------+-------+-------+
+   * |   Q3  |   I3  |   Q2  |   I2  |   Q1  |   I1  |   Q0  |   I0  |
+   * +-------+-------+-------+-------+-------+-------+-------+-------+
+   *
+   * Each 4-bit I field is either 0,1,2,3
+   * Each 4-bit Q field is either 0,1,2,3 or 0xf (input is const zero)
+   * All Q's must be 0xf or none of them may be 0xf
+   * </pre>
+   */
+  bool set_mux  (int mux);
+
+  /*!
+   * Determine the appropriate Rx mux value as a function of the subdevice 
choosen
+   * and the characteristics of the respective daughterboard.
+   */
+  int determine_rx_mux_value(const usrp_subdev_spec &ss);
+  int determine_rx_mux_value(const usrp_subdev_spec &ss_a, const 
usrp_subdev_spec &ss_b);
+
+  /*!
+   * \brief set the frequency of the digital down converter.
+   *
+   * \p channel must be in the range [0,3].  \p freq is the center
+   * frequency in Hz.  \p freq may be either negative or postive.
+   * The frequency specified is quantized.  Use rx_freq to retrieve
+   * the actual value used.
+   */
+  bool set_rx_freq (int channel, double freq);  
+
+  /*!
+   * \brief set fpga mode
+   */
+  bool set_fpga_mode (int mode);
+
+  /*!
+   * \brief Set the digital down converter phase register.
+   *
+   * \param channel    which ddc channel [0, 3]
+   * \param phase      32-bit integer phase value.
+   */
+  bool set_ddc_phase(int channel, int phase);
+
+  /*!
+   * \brief Specify Rx data format.
+   *
+   * \param format     format specifier
+   *
+   * Rx data format control register
+   *
+   *     3                   2                   1                       
+   *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+   *  +-----------------------------------------+-+-+---------+-------+
+   *  |          Reserved (Must be zero)        |B|Q|  WIDTH  | SHIFT |
+   *  +-----------------------------------------+-+-+---------+-------+
+   *
+   *  SHIFT specifies arithmetic right shift [0, 15]
+   *  WIDTH specifies bit-width of I & Q samples across the USB [1, 16] (not 
all valid)
+   *  Q     if set deliver both I & Q, else just I
+   *  B     if set bypass half-band filter.
+   *
+   * Right now the acceptable values are:
+   *
+   *   B  Q  WIDTH  SHIFT
+   *   0  1    16     0
+   *   0  1     8     8
+   *
+   * More valid combos to come.
+   *
+   * Default value is 0x00000300  16-bits, 0 shift, deliver both I & Q.
+   */
+  bool set_format(unsigned int format);
+
+  static unsigned int make_format(int width=16, int shift=0,
+                                 bool want_q=true, bool bypass_halfband=false);
+  static int format_width(unsigned int format);
+  static int format_shift(unsigned int format);
+  static bool format_want_q(unsigned int format);
+  static bool format_bypass_halfband(unsigned int format);
+
+  /*!
+   * \brief High-level "tune" method.  Works for the single channel case.
+   *
+   * This method adjusts both the daughterboard LO and the DDC so that
+   * target_freq ends up at DC in the complex baseband samples.
+   *
+   * \param chan  which DDC channel we're controlling (almost always 0).
+   * \param db    the daughterboard we're controlling.
+   * \param target_freq the RF frequency we want at DC in the complex baseband.
+   * \param[out] result details how the hardware was configured.
+   *
+   * \returns true iff everything was successful.
+   */
+  bool tune(int chan, db_base_sptr db, double target_freq, usrp_tune_result 
*result);
+  
+
+  // ACCESSORS
+  unsigned int decim_rate () const;
+  double rx_freq (int channel) const;
+  int nchannels () const;
+  int mux () const;
+  unsigned int format () const;
+
+  // called in base class to derived class order
+  bool start ();
+  bool stop ();
+};
+
+// ----------------------------------------------------------------
+
+/*!
+ * \brief The C++ interface the transmit side of the USRP
+ * \ingroup usrp
+ *
+ * This is the recommended interface to USRP transmit functionality
+ * for applications that use the USRP but not GNU Radio.
+ *
+ * Uses digital upconverter (coarse & fine modulators) in AD9862...
+ */
+class usrp_standard_tx : public usrp_basic_tx, public usrp_standard_common
+{
+ public:
+  enum coarse_mod_t {
+    CM_NEG_FDAC_OVER_4,                // -32 MHz
+    CM_NEG_FDAC_OVER_8,                // -16 MHz
+    CM_OFF,
+    CM_POS_FDAC_OVER_8,                // +16 MHz
+    CM_POS_FDAC_OVER_4         // +32 MHz
+  };
+
+ protected:
+  static const int     MAX_CHAN = 2;
+  unsigned int         d_interp_rate;
+  int                  d_nchan;
+  int                  d_sw_mux;
+  int                  d_hw_mux;
+  double               d_tx_freq[MAX_CHAN];
+  coarse_mod_t         d_coarse_mod[MAX_CHAN];
+  unsigned char                d_tx_modulator_shadow[MAX_CHAN];
+
+  virtual bool set_coarse_modulator (int channel, coarse_mod_t cm);
+  usrp_standard_tx::coarse_mod_t coarse_modulator (int channel) const;
+
+ protected:
+  usrp_standard_tx (int which_board,
+                   unsigned int interp_rate,
+                   int nchan = 1,
+                   int mux = -1,
+                   int fusb_block_size = 0,
+                   int fusb_nblocks = 0,
+                   const std::string fpga_filename = "",
+                   const std::string firmware_filename = ""
+                   );  // throws if trouble
+
+  bool write_hw_mux_reg ();
+
+ public:
+  ~usrp_standard_tx ();
+
+  /*!
+   * \brief invokes constructor, returns shared_ptr or shared_ptr equivalent 
of 0 if trouble
+   *
+   * \param which_board             Which USRP board on usb (not particularly 
useful; use 0)
+   * \param interp_rate             interpolation factor
+   * \param nchan           number of channels
+   * \param mux                     Tx mux setting, \sa set_mux
+   * \param fusb_block_size  fast usb xfer block size.  Must be a multiple of 
512. 
+   *                         Use zero for a reasonable default.
+   * \param fusb_nblocks     number of fast usb URBs to allocate.  Use zero 
for a reasonable default. 
+   * \param fpga_filename    Name of rbf file to load
+   * \param firmware_filename Name of ihx file to load
+   */
+  static usrp_standard_tx_sptr make(int which_board,
+                                   unsigned int interp_rate,
+                                   int nchan = 1,
+                                   int mux = -1,
+                                   int fusb_block_size = 0,
+                                   int fusb_nblocks = 0,
+                                   const std::string fpga_filename = "",
+                                   const std::string firmware_filename = ""
+                                   );
+
+  /*!
+   * \brief Set interpolator rate.  \p rate must be in [4, 512] and a multiple 
of 4.
+   *
+   * The final complex sample rate across the USB is
+   *   dac_freq () / interp_rate () * nchannels ()
+   */
+  virtual bool set_interp_rate (unsigned int rate);
+
+  /*!
+   * \brief Set number of active channels.  \p nchannels must be 1 or 2.
+   *
+   * The final complex sample rate across the USB is
+   *   dac_freq () / decim_rate () * nchannels ()
+   */
+  bool set_nchannels  (int nchannels);
+
+  /*!
+   * \brief Set output mux configuration.
+   *
+   * <pre>
+   *     3                   2                   1                       
+   *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+   *  +-------------------------------+-------+-------+-------+-------+
+   *  |                               | DAC3  | DAC2  | DAC1  |  DAC0 |
+   *  +-------------------------------+-------+-------+-------+-------+
+   * 
+   *  There are two interpolators with complex inputs and outputs.
+   *  There are four DACs.
+   * 
+   *  Each 4-bit DACx field specifies the source for the DAC and
+   *  whether or not that DAC is enabled.  Each subfield is coded
+   *  like this: 
+   * 
+   *     3 2 1 0
+   *    +-+-----+
+   *    |E|  N  |
+   *    +-+-----+
+   * 
+   *  Where E is set if the DAC is enabled, and N specifies which
+   *  interpolator output is connected to this DAC.
+   * 
+   *   N   which interp output
+   *  ---  -------------------
+   *   0   chan 0 I
+   *   1   chan 0 Q
+   *   2   chan 1 I
+   *   3   chan 1 Q
+   * </pre>
+   */
+  bool set_mux  (int mux);
+
+  /*!
+   * Determine the appropriate Tx mux value as a function of the subdevice 
choosen
+   * and the characteristics of the respective daughterboard.
+   */
+  int determine_tx_mux_value(const usrp_subdev_spec &ss);
+  int determine_tx_mux_value(const usrp_subdev_spec &ss_a, const 
usrp_subdev_spec &ss_b);
+
+  /*!
+   * \brief set the frequency of the digital up converter.
+   *
+   * \p channel must be in the range [0,1].  \p freq is the center
+   * frequency in Hz.  It must be in the range [-44M, 44M].
+   * The frequency specified is quantized.  Use tx_freq to retrieve
+   * the actual value used.
+   */
+  virtual bool set_tx_freq (int channel, double freq);  // chan: [0,1]
+
+  // ACCESSORS
+  unsigned int interp_rate () const;
+  double tx_freq (int channel) const;
+  int nchannels () const;
+  int mux () const;
+
+  /*!
+   * \brief High-level "tune" method.  Works for the single channel case.
+   *
+   * This method adjusts both the daughterboard LO and the DUC so that
+   * DC in the complex baseband samples ends up at RF target_freq.
+   *
+   * \param chan  which DUC channel we're controlling (usually == which_side).
+   * \param db    the daughterboard we're controlling.
+   * \param target_freq the RF frequency we want our baseband translated to.
+   * \param[out] result details how the hardware was configured.
+   *
+   * \returns true iff everything was successful.
+   */
+  bool tune(int chan, db_base_sptr db, double target_freq, usrp_tune_result 
*result);
+
+
+  // called in base class to derived class order
+  bool start ();
+  bool stop ();
+};
+
+#endif /* INCLUDED_USRP_STANDARD_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_standard.h
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_standard.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_standard.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_standard.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_standard.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_standard.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_standard.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_standard.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_standard.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_standard.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_standard.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_standard.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_standard.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_standard.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_standard.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_standard.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_standard.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_standard.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_standard.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_standard.h:11235-11360
Added: svn:eol-style
   + native

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_subdev_spec.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_subdev_spec.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_subdev_spec.h
                         (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_subdev_spec.h
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,50 @@
+/* -*- 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef INCLUDED_USRP_SUBDEV_SPEC_H
+#define INCLUDED_USRP_SUBDEV_SPEC_H
+
+/*!
+ * \brief specify a daughterboard and subdevice on a daughterboard.
+ *
+ * In the USRP1, there are two sides, A and B.
+ *
+ * A daughterboard generally implements a single subdevice, but may in
+ * general implement any number of subdevices.  At this time, all 
daughterboards
+ * with the exception of the Basic Rx and LF Rx implement a single subdevice.
+ *
+ * The Basic Rx and LF Rx implement 2 subdevices (soon 3).  Subdevice
+ * 0 routes input RX-A to the DDC I input and routes a constant zero
+ * to the DDC Q input.  Similarly, subdevice 1 routes input RX-B to
+ * the DDC I input and routes a constant zero to the DDC Q
+ * input.  Subdevice 2 (when implemented) will route RX-A to the DDC I
+ * input and RX-B to the DDC Q input.
+ */
+
+struct usrp_subdev_spec {
+  unsigned int side;           // 0 -> A; 1 -> B
+  unsigned int subdev;         // which subdevice (usually zero)
+
+  usrp_subdev_spec(unsigned int _side = 0, unsigned int _subdev = 0)
+    : side(_side), subdev(_subdev) {}
+};
+
+#endif /* INCLUDED_USRP_SUBDEV_SPEC_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_subdev_spec.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_subdev_spec.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_subdev_spec.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_subdev_spec.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_subdev_spec.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_subdev_spec.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_subdev_spec.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_subdev_spec.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_subdev_spec.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_subdev_spec.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_subdev_spec.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_subdev_spec.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_subdev_spec.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_subdev_spec.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_subdev_spec.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_subdev_spec.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_subdev_spec.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_subdev_spec.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_subdev_spec.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_subdev_spec.h:11235-11360
Added: svn:eol-style
   + native

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_tune_result.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_tune_result.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_tune_result.h
                         (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_tune_result.h
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,44 @@
+/* -*- 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_USRP_TUNE_RESULT_H
+#define INCLUDED_USRP_TUNE_RESULT_H
+
+class usrp_tune_result
+{
+public:
+  // RF frequency that corresponds to DC in the IF
+  double baseband_freq;
+
+  // frequency programmed into the DDC/DUC
+  double dxc_freq;
+
+  // residual frequency (typically < 0.01 Hz)
+  double residual_freq;
+
+  // is the spectrum inverted?
+  bool inverted;
+
+  usrp_tune_result(double baseband=0, double dxc=0, double residual=0, bool 
_inverted=false)
+    : baseband_freq(baseband), dxc_freq(dxc),
+      residual_freq(residual), inverted(_inverted) {}
+};
+
+#endif /* INCLUDED_USRP_TUNE_RESULT_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/include/usrp/usrp_tune_result.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/usrp_tune_result.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/usrp_tune_result.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/usrp_tune_result.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/usrp_tune_result.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/usrp_tune_result.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/usrp_tune_result.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/usrp_tune_result.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/usrp_tune_result.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/usrp_tune_result.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/usrp_tune_result.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/usrp_tune_result.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/usrp_tune_result.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/usrp_tune_result.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/usrp_tune_result.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/usrp_tune_result.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/usrp_tune_result.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/usrp_tune_result.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/usrp_tune_result.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/usrp_tune_result.h:11235-11360
Added: svn:eol-style
   + native

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/Makefile.am 
2009-07-08 19:50:21 UTC (rev 11380)
+++ gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/Makefile.am 
2009-07-08 22:36:06 UTC (rev 11381)
@@ -20,5 +20,5 @@
 
 include $(top_srcdir)/Makefile.common
 
-SUBDIRS = legacy inband
+SUBDIRS = legacy #inband
 

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/Makefile.am
  2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/Makefile.am
  2009-07-08 22:36:06 UTC (rev 11381)
@@ -47,7 +47,7 @@
        usrp_dbid.dat                   
 
 BUILT_SOURCES =                        \
-       usrp_dbid.h
+       $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h
 
 BUILT_SOURCES += usrp_dbid.cc \
                 usrp_dbid.py
@@ -140,32 +140,11 @@
 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(ra_wb_CODE)
 endif
 
-include_HEADERS =                      \
-       db_base.h                       \
-       db_basic.h                      \
-       db_dbs_rx.h                     \
-       db_dtt754.h                     \
-       db_dtt768.h                     \
-       db_flexrf.h                     \
-       db_flexrf_mimo.h                \
-       db_tv_rx.h                      \
-       db_util.h                       \
-       db_xcvr2450.h                   \
-       usrp_basic.h                    \
-       usrp_bytesex.h                  \
-       usrp_config.h                   \
-       usrp_dbid.h                     \
-       usrp_prims.h                    \
-       usrp_slots.h                    \
-       usrp_standard.h                 \
-       usrp_subdev_spec.h              \
-       usrp_tune_result.h              
-
 noinst_HEADERS =                       \
        ad9862.h                        \
        db_base_impl.h                  \
        db_boards.h                     \
-       db_wbx.h                        \
+       db_util.h                       \
        fusb.h                          \
        fusb_darwin.h                   \
        fusb_generic.h                  \
@@ -174,6 +153,7 @@
        fusb_win32.h                    \
        md5.h                           \
        rate_to_regval.h                \
+       usrp_config.h                   \
        usrp_local_sighandler.h         
 
 if PYTHON

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base.cc
   2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base.cc
   2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,5 +1,5 @@
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
@@ -19,7 +19,7 @@
 // Boston, MA 02110-1301, USA.
 //
 
-#include <db_base.h>
+#include <usrp/db_base.h>
 #include <db_base_impl.h>
 
 #if 0

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base_impl.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base_impl.h
       2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_base_impl.h
       2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -21,12 +21,12 @@
 #ifndef INCLUDED_DB_BASE_IMPL_H
 #define INCLUDED_DB_BASE_IMPL_H
 
-#include <db_base.h>
+#include <usrp/db_base.h>
 #include <db_util.h>
-#include <usrp_basic.h>
+#include <usrp/usrp_basic.h>
 #include <fpga_regs_standard.h>
 #include <fpga_regs_common.h>
-#include <usrp_prims.h>
+#include <usrp/usrp_prims.h>
 #include <usrp_spi_defs.h>
 #include <stdexcept>
 

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_basic.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_basic.cc
  2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_basic.cc
  2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,5 +1,5 @@
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
@@ -18,10 +18,9 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_basic.h>
+#include <usrp/db_basic.h>
 #include <db_base_impl.h>
 
-
 db_basic_tx::db_basic_tx(boost::shared_ptr<usrp_basic> usrp, int which)
   : db_base(usrp, which)
 {

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.cc
 2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.cc
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
@@ -21,16 +21,15 @@
 //
 
 #include <db_boards.h>
-#include <usrp_dbid.h>
-#include <db_basic.h>
-#include <db_tv_rx.h>
-#include <db_dbs_rx.h>
-#include <db_flexrf.h>
-#include <db_flexrf_mimo.h>
-#include <db_xcvr2450.h>
-#include <db_wbx.h>
-#include <db_dtt754.h>
-#include <db_dtt768.h>
+#include <usrp/usrp_dbid.h>
+#include <usrp/db_basic.h>
+#include <usrp/db_tv_rx.h>
+#include <usrp/db_dbs_rx.h>
+#include <usrp/db_flexrf.h>
+#include <usrp/db_flexrf_mimo.h>
+#include <usrp/db_xcvr2450.h>
+#include <usrp/db_dtt754.h>
+#include <usrp/db_dtt768.h>
 #include <cstdio>
 
 std::vector<db_base_sptr>

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.h
  2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_boards.h
  2009-07-08 22:36:06 UTC (rev 11381)
@@ -23,8 +23,8 @@
 #ifndef DB_BOARDS_H
 #define DB_BOARDS_H
 
-#include <db_base.h>
-#include <usrp_basic.h>
+#include <usrp/db_base.h>
+#include <usrp/usrp_basic.h>
 
 std::vector<db_base_sptr> instantiate_dbs(int dbid, usrp_basic_sptr usrp, int 
which_side);
 

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dbs_rx.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dbs_rx.cc
 2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dbs_rx.cc
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -18,7 +18,7 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_dbs_rx.h>
+#include <usrp/db_dbs_rx.h>
 #include <db_base_impl.h>
 #include <cmath>
 #include <cstdio>

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt754.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt754.cc
 2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt754.cc
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -19,7 +19,7 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_dtt754.h>
+#include <usrp/db_dtt754.h>
 #include <db_base_impl.h>
 
 int

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt768.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt768.cc
 2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_dtt768.cc
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -19,7 +19,7 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_dtt768.h>
+#include <usrp/db_dtt768.h>
 #include <db_base_impl.h>
 
 int

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf.cc
 2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf.cc
 2009-07-08 22:36:06 UTC (rev 11381)
@@ -18,7 +18,7 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_flexrf.h>
+#include <usrp/db_flexrf.h>
 #include <db_base_impl.h>
 
 // d'board i/o pin defs

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf_mimo.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf_mimo.cc
    2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_flexrf_mimo.cc
    2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -19,10 +19,10 @@
  * Boston, MA 02110-1301, USA.
  */ 
 
-#include <db_flexrf_mimo.h>
+#include <usrp/db_flexrf_mimo.h>
 #include <fpga_regs_standard.h>
 #include <fpga_regs_common.h>
-#include <usrp_prims.h>
+#include <usrp/usrp_prims.h>
 #include <usrp_spi_defs.h>
 
 

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_tv_rx.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_tv_rx.cc
  2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_tv_rx.cc
  2009-07-08 22:36:06 UTC (rev 11381)
@@ -18,7 +18,7 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_tv_rx.h>
+#include <usrp/db_tv_rx.h>
 #include <db_base_impl.h>
 
 /*****************************************************************************/

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_xcvr2450.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_xcvr2450.cc
       2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_xcvr2450.cc
       2009-07-08 22:36:06 UTC (rev 11381)
@@ -18,7 +18,7 @@
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
-#include <db_xcvr2450.h>
+#include <usrp/db_xcvr2450.h>
 #include <db_base_impl.h>
 #include <cmath>
 #include <boost/thread.hpp>

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/gen_usrp_dbid.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/gen_usrp_dbid.py
     2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/gen_usrp_dbid.py
     2009-07-08 22:36:06 UTC (rev 11381)
@@ -25,7 +25,7 @@
         f.write('%-16s = %s\n' % (x[1], x[2]))
 
 def gen_dbid_h(r):
-    f = open('usrp_dbid.h', 'w')
+    f = open('../../include/usrp/usrp_dbid.h', 'w')
     comment_char = '//'
     write_header(f, comment_char)
     f.write(comment_char); f.write('\n')
@@ -64,8 +64,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#include <usrp_prims.h>
-#include <usrp_dbid.h>
+#include <usrp/usrp_prims.h>
+#include <usrp/usrp_dbid.h>
 #include <stdio.h>
 
 #define NELEM(x) sizeof(x)/sizeof(x[0])

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.cc
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_wbx.cc)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.cc
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.cc
      2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,953 @@
+/* -*- 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 asversion 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.
+
+#include <db_wbx.h>
+#include <fpga_regs_standard.h>
+#include <fpga_regs_common.h>
+#include <usrp_prims.h>
+#include <usrp_spi_defs.h>
+#include <stdexcept>
+#include <cmath>
+
+// d'board i/o pin defs
+
+// TX IO Pins
+#define TX_POWER        (1 << 0)  // TX Side Power
+#define RX_TXN          (1 << 1)  // T/R antenna switch for TX/RX port
+#define TX_ENB_MIX      (1 << 2)  // Enable IQ mixer
+#define TX_ENB_VGA      (1 << 3)
+
+// RX IO Pins
+#define RX2_RX1N        (1 << 0)  // antenna switch between RX2 and TX/RX port
+#define RXENABLE        (1 << 1)  // enables mixer
+#define PLL_LOCK_DETECT (1 << 2)  // Muxout pin from PLL -- MUST BE INPUT
+#define MReset          (1 << 3)  // NB6L239 Master Reset, asserted low
+#define SELA0           (1 << 4)  // NB6L239 SelA0
+#define SELA1           (1 << 5)  // NB6L239 SelA1
+#define SELB0           (1 << 6)  // NB6L239 SelB0
+#define SELB1           (1 << 7)  // NB6L239 SelB1
+#define PLL_ENABLE      (1 << 8)  // CE Pin on PLL
+#define AUX_SCLK        (1 << 9)  // ALT SPI SCLK
+#define AUX_SDO         (1 << 10) // ALT SPI SDO
+#define AUX_SEN         (1 << 11) // ALT SPI SEN
+
+
+wbx_base::wbx_base(usrp_basic_sptr usrp, int which)
+  : db_base(usrp, which)
+{
+  /*
+   * @param usrp: instance of usrp.source_c
+   * @param which: which side: 0 or 1 corresponding to side A or B respectively
+   * @type which: int
+   */
+
+  d_first = true;
+  d_spi_format = SPI_FMT_MSB | SPI_FMT_HDR_0;
+
+  // FIXME -- the write reg functions don't work with 0xffff for masks
+  
_rx_write_oe(int(PLL_ENABLE|MReset|SELA0|SELA1|SELB0|SELB1|RX2_RX1N|RXENABLE), 
0x7fff);
+  _rx_write_io((PLL_ENABLE|MReset|0|RXENABLE), 
(PLL_ENABLE|MReset|RX2_RX1N|RXENABLE));
+
+  _tx_write_oe((TX_POWER|RX_TXN|TX_ENB_MIX|TX_ENB_VGA), 0x7fff);
+  _tx_write_io((0|RX_TXN), (TX_POWER|RX_TXN|TX_ENB_MIX|TX_ENB_VGA));  // TX 
off, TR switch set to RX
+
+  if(d_which == 0) {
+    d_spi_enable = SPI_ENABLE_RX_A;
+  }
+  else {
+    d_spi_enable = SPI_ENABLE_RX_B;
+  }
+
+  set_auto_tr(false);
+        
+}
+
+wbx_base::~wbx_base()
+{        
+  shutdown();
+}
+
+
+void
+wbx_base::shutdown()
+{
+  if (!d_is_shutdown){
+    d_is_shutdown = true;
+    // do whatever there is to do to shutdown
+
+    write_io(d_which, d_power_off, POWER_UP);   // turn off power to board
+    _write_oe(d_which, 0, 0xffff);   // turn off all outputs
+    set_auto_tr(false); // disable auto transmit
+  }
+}
+
+bool
+wbx_base::_lock_detect()
+{
+  /*
+   * @returns: the value of the VCO/PLL lock detect bit.
+   * @rtype: 0 or 1
+   */
+
+  if(_rx_read_io() & PLL_LOCK_DETECT) {
+    return true;
+  }
+  else {     // Give it a second chance
+    if(_rx_read_io() & PLL_LOCK_DETECT) {
+      return true;
+    }
+    else {
+      return false;
+    }
+  }
+}
+
+bool 
+wbx_base::_tx_write_oe(int value, int mask)
+{
+  int reg = (d_which == 0 ? FR_OE_0 : FR_OE_2);
+  return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 
0xffff));
+}
+
+bool 
+wbx_base::_rx_write_oe(int value, int mask)
+{
+  int reg = (d_which == 0 ? FR_OE_1 : FR_OE_3);
+  return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 
0xffff));
+}
+
+bool
+wbx_base::_tx_write_io(int value, int mask)
+{
+  int reg = (d_which == 0 ? FR_IO_0 : FR_IO_2);
+  return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 
0xffff));
+}
+
+bool
+wbx_base::_rx_write_io(int value, int mask)
+{
+  int reg = (d_which == 0 ? FR_IO_1 : FR_IO_3);
+  return d_usrp->_write_fpga_reg(reg, ((mask & 0xffff) << 16) | (value & 
0xffff));
+}
+
+bool
+wbx_base::_rx_read_io()
+{
+  int reg = (d_which == 0 ? FR_RB_IO_RX_A_IO_TX_A : FR_RB_IO_RX_B_IO_TX_B);
+  int t = d_usrp->_read_fpga_reg(reg);
+  return (t >> 16) & 0xffff;
+}
+
+bool
+wbx_base::_tx_read_io()
+{
+  int reg = (d_which == 0 ? FR_RB_IO_RX_A_IO_TX_A : FR_RB_IO_RX_B_IO_TX_B);
+  int t = d_usrp->_read_fpga_reg(reg);
+  return (t & 0xffff);
+}
+
+bool
+wbx_base::_compute_regs(double freq)
+{
+  /*
+   * Determine values of registers, along with actual freq.
+   * 
+   * @param freq: target frequency in Hz
+   * @type freq: double
+   * @returns: (R, N, func, init, actual_freq)
+   * @rtype: tuple(int, int, int, int, double)
+   * 
+   * Override this in derived classes.
+   */
+  throw std::runtime_error("_compute_regs called from base class\n");
+}
+
+double
+wbx_base::_refclk_freq()
+{
+  return (double)(d_usrp->fpga_master_clock_freq())/_refclk_divisor();
+}
+
+int
+wbx_base::_refclk_divisor()
+{
+  /*
+   * Return value to stick in REFCLK_DIVISOR register
+   */
+  return 1;
+}
+
+struct freq_result_t
+wbx_base::set_freq(double freq)
+{
+  /*
+   * @returns (ok, actual_baseband_freq) where:
+   * ok is True or False and indicates success or failure,
+   * actual_baseband_freq is the RF frequency that corresponds to DC in the IF.
+   */
+  throw std::runtime_error("set_freq called from base class\n");
+}
+
+float
+wbx_base::gain_min()
+{
+  throw std::runtime_error("gain_min called from base class\n");
+}
+
+float
+wbx_base::gain_max()
+{
+  throw std::runtime_error("gain_max called from base class\n");
+}
+
+float
+wbx_base::gain_db_per_step()
+{
+  throw std::runtime_error("gain_db_per_step called from base class\n");
+}
+
+bool
+wbx_base::set_gain(float gain)
+{
+  /*
+   * Set the gain.
+   * 
+   * @param gain:  gain in decibels
+   * @returns True/False
+   */
+  throw std::runtime_error("set_gain called from base class\n");
+}
+
+bool
+wbx_base::_set_pga(float pga_gain)
+{
+  bool ok;
+  if(d_which == 0) {
+    ok  = d_usrp->set_pga(0, pga_gain);
+    ok |= d_usrp->set_pga(1, pga_gain);
+  }
+  else {
+    ok  = d_usrp->set_pga(2, pga_gain);
+    ok |= d_usrp->set_pga(3, pga_gain);
+  }
+  return ok;
+}
+
+bool
+wbx_base::is_quadrature()
+{
+  /*
+   * Return True if this board requires both I & Q analog channels.
+   * 
+   * This bit of info is useful when setting up the USRP Rx mux register.
+   */
+  return true;
+}
+
+
+/****************************************************************************/
+
+
+wbx_base_tx::wbx_base_tx(usrp_basic_sptr usrp, int which)
+  : wbx_base(usrp, which)
+{        
+  /*
+   * @param usrp: instance of usrp.sink_c
+   * @param which: 0 or 1 corresponding to side TX_A or TX_B respectively.
+   */
+  
+  // power up the transmit side, NO -- but set antenna to receive
+  d_usrp->write_io(d_which, (TX_POWER), (TX_POWER|RX_TXN));
+  d_lo_offset = 0e6;
+  
+  // Gain is not set by the PGA, but the PGA must be set at max gain in the TX
+  _set_pga(d_usrp->pga_max());
+}
+
+wbx_base_tx::~wbx_base_tx()
+{
+  // Power down and leave the T/R switch in the R position
+  d_usrp->write_io(d_which, (RX_TXN), (TX_POWER|RX_TXN|TX_ENB_MIX|TX_ENB_VGA));
+}
+
+void
+wbx_base_tx::set_auto_tr(bool on)
+{
+  if(on) {
+    set_atr_mask (RX_TXN);
+    set_atr_txval(0);
+    set_atr_rxval(RX_TXN);
+  }
+  else {
+    set_atr_mask (0);
+    set_atr_txval(0);
+    set_atr_rxval(0);
+  }
+}
+
+void
+wbx_base_tx::set_enable(bool on)
+{
+  /*
+   * Enable transmitter if on is True
+   */
+
+  int mask = RX_TXN|TX_ENB_MIX|TX_ENB_VGA;
+  //printf("HERE!!!!\n");
+  if(on) {
+    d_usrp->write_io(d_which, TX_ENB_MIX|TX_ENB_VGA, mask);
+  }
+  else {
+    d_usrp->write_io(d_which, RX_TXN, mask);
+  }
+}
+
+void
+wbx_base_tx::set_lo_offset(double offset)
+{
+  /*
+   * Set amount by which LO is offset from requested tuning frequency.
+   * 
+   * @param offset: offset in Hz
+   */
+  
+  d_lo_offset = offset;
+}
+
+double
+wbx_base_tx::lo_offset()
+{
+  /*
+   * Get amount by which LO is offset from requested tuning frequency.
+   * 
+   * @returns Offset in Hz
+   */
+
+  return d_lo_offset;
+}
+
+
+/****************************************************************************/
+
+
+wbx_base_rx::wbx_base_rx(usrp_basic_sptr usrp, int which)
+  : wbx_base(usrp, which)
+{
+  /*
+   * @param usrp: instance of usrp.source_c
+   * @param which: 0 or 1 corresponding to side RX_A or RX_B respectively.
+   */
+  
+  // set up for RX on TX/RX port
+  select_rx_antenna("TX/RX");
+  
+  bypass_adc_buffers(true);
+
+  d_lo_offset = 0.0;
+}
+
+wbx_base_rx::~wbx_base_rx()
+{
+  // Power down
+  d_usrp->write_io(d_which, 0, (RXENABLE));
+}
+  
+void
+wbx_base_rx::set_auto_tr(bool on)
+{
+  if(on) {
+    // FIXME: where does ENABLE come from?
+    //set_atr_mask (ENABLE);
+    set_atr_txval(     0);
+    //set_atr_rxval(ENABLE);
+  }
+  else {
+    set_atr_mask (0);
+    set_atr_txval(0);
+    set_atr_rxval(0);
+  }
+}
+
+void
+wbx_base_rx::select_rx_antenna(int which_antenna)
+{
+  /*
+   * Specify which antenna port to use for reception.
+   * @param which_antenna: either 'TX/RX' or 'RX2'
+   */
+  
+  if(which_antenna == 0) {
+    d_usrp->write_io(d_which, 0,        RX2_RX1N);
+  }
+  else if(which_antenna == 1) {
+    d_usrp->write_io(d_which, RX2_RX1N, RX2_RX1N);
+  }
+  else {
+    throw std::invalid_argument("which_antenna must be either 'TX/RX' or 
'RX2'\n");
+  }
+}
+
+void
+wbx_base_rx::select_rx_antenna(const std::string &which_antenna)
+{
+  if(which_antenna == "TX/RX") {
+    select_rx_antenna(0);
+  }
+  else if(which_antenna == "RX2") {
+    select_rx_antenna(1);
+  }
+  else {
+    throw std::invalid_argument("which_antenna must be either 'TX/RX' or 
'RX2'\n");
+  }
+}
+
+bool
+wbx_base_rx::set_gain(float gain)
+{
+  /*
+   * Set the gain.
+   * 
+   * @param gain:  gain in decibels
+   * @returns True/False
+   */
+  
+  float pga_gain, agc_gain;
+  float maxgain = gain_max() - d_usrp->pga_max();
+  float mingain = gain_min();
+  if(gain > maxgain) {
+    pga_gain = gain-maxgain;
+    assert(pga_gain <= d_usrp->pga_max());
+    agc_gain = maxgain;
+  }
+  else {
+    pga_gain = 0;
+    agc_gain = gain;
+  }
+   
+  float V_maxgain = .2;
+  float V_mingain = 1.2;
+  float V_fullscale = 3.3;
+  float dac_value = (agc_gain*(V_maxgain-V_mingain)/(maxgain-mingain) + 
V_mingain)*4096/V_fullscale;
+
+  assert(dac_value>=0 && dac_value<4096);
+
+  return d_usrp->write_aux_dac(d_which, 0, (int)(dac_value)) && 
_set_pga((int)(pga_gain));
+}
+
+void
+wbx_base_rx::set_lo_offset(double offset)
+{
+  /*
+   * Set amount by which LO is offset from requested tuning frequency.
+   * 
+   * @param offset: offset in Hz
+   */
+  d_lo_offset = offset;
+}
+
+double
+wbx_base_rx::lo_offset()
+{
+  /*
+   * Get amount by which LO is offset from requested tuning frequency.
+   * 
+   * @returns Offset in Hz
+   */
+  return d_lo_offset;
+}
+
+bool
+wbx_base_rx::i_and_q_swapped()
+{
+  /*
+   * Return True if this is a quadrature device and ADC 0 is Q.
+   */
+  return false;
+}
+
+
+/****************************************************************************/
+
+_ADF410X_common::_ADF410X_common()
+{
+  // R-Register Common Values
+  d_R_RSV = 0;    // bits 23,22,21
+  d_LDP = 1;      // bit 20     Lock detect in 5 cycles
+  d_TEST = 0;     // bit 19,18  Normal
+  d_ABP = 0;      // bit 17,16  2.9ns
+    
+  // N-Register Common Values
+  d_N_RSV = 0;    // 23,22
+  d_CP_GAIN = 0;  // 21
+    
+  // Function Register Common Values
+  d_P = 0;        // bits 23,22    0 = 8/9, 1 = 16/17, 2 = 32/33, 3 = 64/65
+  d_PD2 = 0;      // bit  21       Normal operation
+  d_CP2 = 4;      // bits 20,19,18 CP Gain = 5mA
+  d_CP1 = 4;      // bits 17,16,15 CP Gain = 5mA
+  d_TC = 0;       // bits 14-11    PFD Timeout
+  d_FL = 0;       // bit 10,9      Fastlock Disabled
+  d_CP3S = 0;     // bit 8         CP Enabled
+  d_PDP = 0;      // bit 7         Phase detector polarity, Positive=1
+  d_MUXOUT = 1;   // bits 6:4      Digital Lock Detect
+  d_PD1 = 0;      // bit 3         Normal operation
+  d_CR = 0;       // bit 2         Normal operation
+}
+
+_ADF410X_common::~_ADF410X_common()
+{
+}
+
+bool 
+_ADF410X_common::_compute_regs(double freq, int &retR, int &retcontrol, 
+                              int &retN, double &retfreq)
+{
+  /*
+   * Determine values of R, control, and N registers, along with actual freq.
+   * 
+   * @param freq: target frequency in Hz
+   * @type freq: double
+   * @returns: (R, N, control, actual_freq)
+   * @rtype: tuple(int, int, int, double)
+   */
+  
+  //  Band-specific N-Register Values
+  double phdet_freq = _refclk_freq()/d_R_DIV;
+  printf("phdet_freq = %f\n", phdet_freq);
+
+  double desired_n = round(freq*d_freq_mult/phdet_freq);
+  printf("desired_n %f\n", desired_n);
+
+  double actual_freq = desired_n * phdet_freq;
+  printf("actual freq %f\n", actual_freq);
+
+  double B = floor(desired_n/_prescaler());
+  double A = desired_n - _prescaler()*B;
+  printf("A %f B %f\n", A, B);
+
+  d_B_DIV = int(B);    // bits 20:8;
+  d_A_DIV = int(A);    // bit 6:2;
+
+  if(d_B_DIV < d_A_DIV) {
+    retR = 0;
+    retN = 0;
+    retcontrol = 0;
+    retfreq = 0;
+    return false;
+  }
+
+  retR = (d_R_RSV<<21) | (d_LDP<<20) | (d_TEST<<18) |
+    (d_ABP<<16) | (d_R_DIV<<2);
+        
+  retN = (d_N_RSV<<22) | (d_CP_GAIN<<21) | (d_B_DIV<<8) | (d_A_DIV<<2);
+
+  retcontrol = (d_P<<22) | (d_PD2<<21) | (d_CP2<<18) | (d_CP1<<15) | 
+    (d_TC<<11) | (d_FL<<9) | (d_CP3S<<8) | (d_PDP<<7) |
+    (d_MUXOUT<<4) | (d_PD1<<3) | (d_CR<<2);
+  
+  retfreq = actual_freq/d_freq_mult;
+  
+  return true;
+}
+
+void 
+_ADF410X_common::_write_all(int R, int N, int control)
+{
+  /*
+   * Write all PLL registers:
+   *   R counter latch,
+   *   N counter latch,
+   *   Function latch,
+   *   Initialization latch
+   * 
+   * Adds 10ms delay between writing control and N if this is first call.
+   * This is the required power-up sequence.
+   * 
+   * @param R: 24-bit R counter latch
+   * @type R: int
+   * @param N: 24-bit N counter latch
+   * @type N: int
+   * @param control: 24-bit control latch
+   * @type control: int
+   */
+  static bool first = true;
+
+  timespec t;
+  t.tv_sec = 0;
+  t.tv_nsec = 10000000;
+  
+  _write_R(R);
+  _write_func(control);
+  _write_init(control);
+  if(first) {
+    //time.sleep(0.010);
+    nanosleep(&t, NULL);
+    first = false;
+  }
+  _write_N(N);
+}
+
+void
+_ADF410X_common::_write_R(int R)
+{
+  _write_it((R & ~0x3) | 0);
+}
+
+void
+_ADF410X_common::_write_N(int N)
+{
+  _write_it((N & ~0x3) | 1);
+}
+
+void
+_ADF410X_common::_write_func(int func)
+{
+  _write_it((func & ~0x3) | 2);
+}
+
+void
+_ADF410X_common::_write_init(int init)
+{
+  _write_it((init & ~0x3) | 3);
+}
+
+void
+_ADF410X_common::_write_it(int v)
+{
+  char c[3];
+  c[0] = (char)((v >> 16) & 0xff);
+  c[1] = (char)((v >>  8) & 0xff);
+  c[2] = (char)((v & 0xff));
+  std::string s(c, 3);
+  //d_usrp->_write_spi(0, d_spi_enable, d_spi_format, s);
+  usrp()->_write_spi(0, d_spi_enable, d_spi_format, s);
+}
+
+int
+_ADF410X_common::_prescaler()
+{
+  if(d_P == 0) {
+    return 8;
+  }
+  else if(d_P == 1) {
+    return 16;
+  }
+  else if(d_P == 2) {
+    return 32;
+  }
+  else if(d_P == 3) {
+    return 64;
+  }
+  else {
+    throw std::invalid_argument("Prescaler out of range\n");
+  }
+}
+
+double
+_ADF410X_common::_refclk_freq()
+{
+  throw std::runtime_error("_refclk_freq called from base class.");
+}
+
+bool
+_ADF410X_common::_rx_write_io(int value, int mask)
+{
+  throw std::runtime_error("_rx_write_io called from base class.");
+}
+
+bool
+_ADF410X_common::_lock_detect()
+{
+  throw std::runtime_error("_lock_detect called from base class.");
+}
+
+usrp_basic* 
+_ADF410X_common::usrp()
+{
+  throw std::runtime_error("usrp() called from base class.");
+}
+
+
+/****************************************************************************/
+
+
+_lo_common::_lo_common()
+  : _ADF410X_common()
+{
+  // Band-specific R-Register Values
+  d_R_DIV = 4;    // bits 15:2
+  
+  // Band-specific C-Register values
+  d_P = 0;        // bits 23,22   0 = Div by 8/9
+  d_CP2 = 4;      // bits 19:17
+  d_CP1 = 4;      // bits 16:14
+  
+  // Band specifc N-Register Values
+  d_DIVSEL = 0;   // bit 23
+  d_DIV2 = 0;     // bit 22
+  d_CPGAIN = 0;   // bit 21
+  d_freq_mult = 1;
+  
+  d_div = 1;
+  d_aux_div = 2;
+  d_main_div = 0;
+}
+
+_lo_common::~_lo_common()
+{
+}
+
+double
+_lo_common::freq_min()
+{
+  return 50e6;
+}
+
+double
+_lo_common::freq_max()
+{
+  return 1000e6;
+}
+
+void
+_lo_common::set_divider(int main_or_aux, int divisor)
+{
+  if(main_or_aux == 0) {
+    if((divisor != 1) || (divisor != 2) || (divisor != 4) || (divisor != 8)) {
+      throw std::invalid_argument("Main Divider Must be 1, 2, 4, or 8\n");
+    }
+    d_main_div = (int)(log10(divisor)/log10(2.0));
+  }
+  else if(main_or_aux == 1) {
+    if((divisor != 2) || (divisor != 4) || (divisor != 8) || (divisor != 16)) {
+      throw std::invalid_argument("Aux Divider Must be 2, 4, 8 or 16\n");
+    }
+    d_main_div = (int)(log10(divisor/2.0)/log10(2.0));
+  }   
+  else {
+    throw std::invalid_argument("main_or_aux must be 'main' or 'aux'\n");
+  }
+  
+  int vala = d_main_div*SELA0;
+  int valb = d_aux_div*SELB0;
+  int mask = SELA0|SELA1|SELB0|SELB1;
+  
+  _rx_write_io((vala | valb), mask);
+}
+
+void
+_lo_common::set_divider(const std::string &main_or_aux, int divisor)
+{
+  if(main_or_aux == "main") {
+    set_divider(0, divisor);
+  }
+  else if(main_or_aux == "aux") {
+    set_divider(1, divisor);
+  }
+  else {
+    throw std::invalid_argument("main_or_aux must be 'main' or 'aux'\n");
+  }
+}
+
+struct freq_result_t
+_lo_common::set_freq(double freq)
+{
+  struct freq_result_t ret;
+  
+  if(freq < 20e6 or freq > 1200e6) {
+    throw std::invalid_argument("Requested frequency out of range\n");
+  }
+
+  int div = 1;
+  double lo_freq = freq * 2;
+  while((lo_freq < 1e9) && (div < 8)) {
+    div = div * 2;
+    lo_freq = lo_freq * 2;
+  }
+  
+  printf("For RF freq of %f, we set DIV=%d and LO Freq=%f\n", freq, div, 
lo_freq);
+
+  set_divider("main", div);
+  set_divider("aux", div*2);
+  
+  int R, N, control;
+  double actual_freq;
+  _compute_regs(lo_freq, R, N, control, actual_freq);
+  
+  printf("R %d N %d control %d actual freq %f\n", R, N, control, actual_freq);
+  if(R==0) {
+    ret.ok = false;
+    ret.baseband_freq = 0.0;
+    return ret;
+  }
+  _write_all(R, N, control);
+  
+  ret.ok = _lock_detect();
+  ret.baseband_freq = actual_freq/div/2;
+  return ret;
+}
+        
+
+/****************************************************************************/
+
+
+db_wbx_lo_tx::db_wbx_lo_tx(usrp_basic_sptr usrp, int which)
+  : _lo_common(),
+    wbx_base_tx(usrp, which)
+{
+}
+
+db_wbx_lo_tx::~db_wbx_lo_tx()
+{
+}
+
+float
+db_wbx_lo_tx::gain_min()
+{
+  return -56.0;
+}
+
+float
+db_wbx_lo_tx::gain_max()
+{
+  return 0.0;
+}
+
+float
+db_wbx_lo_tx::gain_db_per_step()
+{
+  return 0.1;
+}
+
+bool
+db_wbx_lo_tx::set_gain(float gain)
+{
+  /*
+   * Set the gain.
+   * 
+   * @param gain:  gain in decibels
+   * @returns True/False
+   */
+
+  float txvga_gain;
+  float maxgain = gain_max();
+  float mingain = gain_min();
+  if(gain > maxgain) {
+    txvga_gain = maxgain;
+  }
+  else if(gain < mingain) {
+    txvga_gain = mingain;
+  }
+  else {
+    txvga_gain = gain;
+  }
+
+  float V_maxgain = 1.4;
+  float V_mingain = 0.1;
+  float V_fullscale = 3.3;
+  float dac_value = ((txvga_gain-mingain)*(V_maxgain-V_mingain)/
+                    (maxgain-mingain) + V_mingain)*4096/V_fullscale;
+
+  assert(dac_value>=0 && dac_value<4096);
+  printf("DAC value %f\n", dac_value);
+
+  return d_usrp->write_aux_dac(d_which, 1, (int)(dac_value));
+}
+
+double
+db_wbx_lo_tx::_refclk_freq()
+{
+  return wbx_base::_refclk_freq();
+}
+
+bool
+db_wbx_lo_tx::_rx_write_io(int value, int mask)
+{
+  return wbx_base::_rx_write_io(value, mask);
+}
+
+bool
+db_wbx_lo_tx::_lock_detect()
+{
+  return wbx_base::_lock_detect();
+}
+
+usrp_basic* 
+db_wbx_lo_tx::usrp()
+{
+  return d_usrp;
+}
+
+
+/****************************************************************************/
+
+
+db_wbx_lo_rx::db_wbx_lo_rx(usrp_basic_sptr usrp, int which)
+  : _lo_common(),
+    wbx_base_rx(usrp, which)    
+{
+}
+
+db_wbx_lo_rx::~db_wbx_lo_rx()
+{
+}
+
+float
+db_wbx_lo_rx::gain_min()
+{
+  return d_usrp->pga_min();
+}
+
+float
+db_wbx_lo_rx::gain_max()
+{
+  return d_usrp->pga_max() + 45;
+}
+
+float
+db_wbx_lo_rx::gain_db_per_step()
+{
+  return 0.05;
+}
+
+double
+db_wbx_lo_rx::_refclk_freq()
+{
+  return wbx_base::_refclk_freq();
+}
+
+bool
+db_wbx_lo_rx::_rx_write_io(int value, int mask)
+{
+  return wbx_base::_rx_write_io(value, mask);
+}
+
+bool
+db_wbx_lo_rx::_lock_detect()
+{
+  return wbx_base::_lock_detect();
+}
+
+usrp_basic* 
+db_wbx_lo_rx::usrp()
+{
+  return d_usrp;
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.cc
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_wbx.cc:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_wbx.cc:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_wbx.cc:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_wbx.cc:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_wbx.cc:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_wbx.cc:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_wbx.cc:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_wbx.cc:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_wbx.cc:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_wbx.cc:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_wbx.cc:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_wbx.cc:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_wbx.cc:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_wbx.cc:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_wbx.cc:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_wbx.cc:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_wbx.cc:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_wbx.cc:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_wbx.cc:11235-11360

Copied: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.h
 (from rev 11377, 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/db_wbx.h)
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.h
                               (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.h
       2009-07-08 22:36:06 UTC (rev 11381)
@@ -0,0 +1,221 @@
+/* -*- 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 asversion 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 DB_WBX_H
+#define DB_WBX_H
+
+#include <db_base.h>
+#include <boost/shared_ptr.hpp>
+
+
+/*
+  A few comments about the WBX boards:
+  They are half-duplex.  I.e., transmit and receive are mutually exclusive.
+  There is a single LO for both the Tx and Rx sides.
+  The the shared control signals are hung off of the Rx side.
+  The shared io controls are duplexed onto the Rx side pins.
+  The wbx_high d'board always needs to be in 'auto_tr_mode'
+*/
+
+
+class wbx_base : public db_base
+{
+protected:
+  void shutdown();
+
+  /*
+   * Abstract base class for all wbx boards.
+   * 
+   * Derive board specific subclasses from db_wbx_base_{tx,rx}
+   */
+
+public:
+  wbx_base(usrp_basic_sptr usrp, int which);
+  ~wbx_base();
+  
+  struct freq_result_t set_freq(double freq);
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool set_gain(float gain);  
+  bool is_quadrature();
+
+
+protected:
+  virtual bool _lock_detect();
+
+  // FIXME: After testing, replace these with usrp_basic::common_write_io/oe
+  bool _tx_write_oe(int value, int mask);
+  bool _rx_write_oe(int value, int mask);
+  bool _tx_write_io(int value, int mask);
+  bool _rx_write_io(int value, int mask);
+  virtual bool _rx_read_io();
+  bool _tx_read_io();
+  bool  _compute_regs(double freq);
+  virtual double _refclk_freq();
+  int _refclk_divisor();
+
+  bool _set_pga(float pga_gain);
+
+  bool d_first;
+  int d_spi_format;
+  int d_spi_enable;
+  double d_lo_offset;
+};
+
+
+/****************************************************************************/
+
+
+class wbx_base_tx : public wbx_base
+{
+public:
+  wbx_base_tx(usrp_basic_sptr usrp, int which);
+  ~wbx_base_tx();
+
+  bool set_auto_tr(bool on);
+  bool set_enable(bool on);
+};
+
+
+/****************************************************************************/
+
+
+class wbx_base_rx : public wbx_base
+{
+public:
+  wbx_base_rx(usrp_basic_sptr usrp, int which);
+  ~wbx_base_rx();
+  
+  bool set_auto_tr(bool on);
+  bool select_rx_antenna(int which_antenna);
+  bool select_rx_antenna(const std::string &which_antenna);
+  bool set_gain(float gain);
+  bool i_and_q_swapped();
+};
+
+
+/****************************************************************************/
+
+
+class _ADF410X_common
+{
+public:
+  _ADF410X_common();
+  virtual ~_ADF410X_common();
+  
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+  void _write_all(int R, int N, int control);
+  void _write_R(int R);
+  void _write_N(int N);
+  void _write_func(int func);
+  void _write_init(int init);
+  int  _prescaler();
+  virtual void _write_it(int v);
+  virtual double _refclk_freq();
+  virtual bool _rx_write_io(int value, int mask);
+  virtual bool _lock_detect();
+
+protected:
+  virtual usrp_basic* usrp();
+
+  int d_R_RSV, d_LDP, d_TEST, d_ABP;
+  int d_N_RSV, d_CP_GAIN;
+  int d_P, d_PD2, d_CP2, d_CP1, d_TC, d_FL;
+  int d_CP3S, d_PDP, d_MUXOUT, d_PD1, d_CR;
+  int d_R_DIV, d_A_DIV, d_B_DIV;
+  int d_freq_mult;
+
+  int d_spi_format;
+  int d_spi_enable;
+};
+
+
+/****************************************************************************/
+
+
+class _lo_common : public _ADF410X_common
+{
+public:
+  _lo_common();
+  ~_lo_common();
+
+  double freq_min();
+  double freq_max();
+  
+  void set_divider(int main_or_aux, int divisor);
+  void set_divider(const std::string &main_or_aux, int divisor);
+
+  struct freq_result_t set_freq(double freq);
+
+protected:
+  int d_R_DIV, d_P, d_CP2, d_CP1;
+  int d_DIVSEL, d_DIV2, d_CPGAIN;
+  int d_div, d_aux_div, d_main_div;
+};
+        
+
+/****************************************************************************/
+
+
+class db_wbx_lo_tx : public _lo_common, public wbx_base_tx
+{
+public:
+  db_wbx_lo_tx(usrp_basic_sptr usrp, int which);
+  ~db_wbx_lo_tx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool  set_gain(float gain);
+
+  double _refclk_freq();
+  bool _rx_write_io(int value, int mask);
+  bool _lock_detect();
+
+protected:
+  usrp_basic* usrp();
+};
+        
+
+/****************************************************************************/
+
+
+class db_wbx_lo_rx : public _lo_common, public  wbx_base_rx
+{
+public:
+  db_wbx_lo_rx(usrp_basic_sptr usrp, int which);
+  ~db_wbx_lo_rx();
+
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+
+  double _refclk_freq();
+  bool _rx_write_io(int value, int mask);
+  bool _lock_detect();
+
+protected:
+  usrp_basic* usrp();
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/limbo/db_wbx.h
___________________________________________________________________
Added: svn:mergeinfo
   + 
/gnuradio/branches/developers/eb/t348/usrp/host/lib/legacy/db_wbx.h:10638-10648
/gnuradio/branches/developers/eb/t364/usrp/host/lib/legacy/db_wbx.h:11016-11017
/gnuradio/branches/developers/eb/t367/usrp/host/lib/legacy/db_wbx.h:11021-11025
/gnuradio/branches/developers/eb/t371/usrp/host/lib/legacy/db_wbx.h:10958-10971
/gnuradio/branches/developers/eb/t378/usrp/host/lib/legacy/db_wbx.h:10683-10688
/gnuradio/branches/developers/jblum/grc/usrp/host/lib/legacy/db_wbx.h:10680-10938,11187-11273,11310-11357
/gnuradio/branches/developers/jblum/gui_guts/usrp/host/lib/legacy/db_wbx.h:10464-10658
/gnuradio/branches/developers/jblum/vlen/usrp/host/lib/legacy/db_wbx.h:10667-10677
/gnuradio/branches/developers/jblum/wxgui/usrp/host/lib/legacy/db_wbx.h:11125-11183
/gnuradio/branches/developers/jcorgan/cpphier/usrp/host/lib/legacy/db_wbx.h:10818-10858
/gnuradio/branches/developers/jcorgan/deb/usrp/host/lib/legacy/db_wbx.h:10949-10959,11013-11022,11046-11059,11075-11077
/gnuradio/branches/developers/jcorgan/fw-optimize/usrp/host/lib/legacy/db_wbx.h:10428-10429
/gnuradio/branches/developers/jcorgan/gpio2/usrp/host/lib/legacy/db_wbx.h:10713-10765
/gnuradio/branches/developers/jcorgan/iad2/usrp/host/lib/legacy/db_wbx.h:10771-10887
/gnuradio/branches/developers/jcorgan/np/usrp/host/lib/legacy/db_wbx.h:11124-11148
/gnuradio/branches/developers/jcorgan/t161/usrp/host/lib/legacy/db_wbx.h:10876-10880
/gnuradio/branches/developers/michaelld/am_swig_4/usrp/host/lib/legacy/db_wbx.h:10555-10595
/gnuradio/branches/developers/michaelld/two_mods/usrp/host/lib/legacy/db_wbx.h:10540-10546
/gnuradio/branches/developers/trondeau/qt/usrp/host/lib/legacy/db_wbx.h:11235-11360

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_basic.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_basic.cc
        2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_basic.cc
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003,2004,2008 Free Software Foundation, Inc.
+ * Copyright 2003,2004,2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -24,8 +24,8 @@
 #include "config.h"
 #endif
 
-#include "usrp_basic.h"
-#include "usrp_prims.h"
+#include <usrp/usrp_basic.h>
+#include "usrp/usrp_prims.h"
 #include "usrp_interfaces.h"
 #include "fpga_regs_common.h"
 #include "fpga_regs_standard.h"

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_prims.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_prims.cc
        2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_prims.cc
        2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003,2004,2006 Free Software Foundation, Inc.
+ * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -24,7 +24,7 @@
 #include "config.h"
 #endif
 
-#include "usrp_prims.h"
+#include "usrp/usrp_prims.h"
 #include "usrp_commands.h"
 #include "usrp_ids.h"
 #include "usrp_i2c_addr.h"

Modified: 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_standard.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_standard.cc
     2009-07-08 19:50:21 UTC (rev 11380)
+++ 
gnuradio/branches/developers/jcorgan/usrp-headers/usrp/host/lib/legacy/usrp_standard.cc
     2009-07-08 22:36:06 UTC (rev 11381)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -20,9 +20,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#include <usrp_standard.h>
+#include <usrp/usrp_standard.h>
 
-#include "usrp_prims.h"
+#include "usrp/usrp_prims.h"
 #include "fpga_regs_common.h"
 #include "fpga_regs_standard.h"
 #include <stdexcept>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]