[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7230 - in gnuradio/branches/developers/jcorgan/t127:
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r7230 - in gnuradio/branches/developers/jcorgan/t127: . usrp/host/lib/legacy usrpdb/src |
Date: |
Wed, 19 Dec 2007 12:53:55 -0700 (MST) |
Author: jcorgan
Date: 2007-12-19 12:53:54 -0700 (Wed, 19 Dec 2007)
New Revision: 7230
Added:
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.cc
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.h
Modified:
gnuradio/branches/developers/jcorgan/t127/Makefile.common
gnuradio/branches/developers/jcorgan/t127/configure.ac
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/Makefile.am
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h
gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i
Log:
Work in progress.
Modified: gnuradio/branches/developers/jcorgan/t127/Makefile.common
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/Makefile.common 2007-12-19
06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/Makefile.common 2007-12-19
19:53:54 UTC (rev 7230)
@@ -72,6 +72,10 @@
# This is a dependency for many swig operations
GNURADIO_I = $(top_srcdir)/gnuradio-core/src/lib/swig/gnuradio.i
+# How to link in the USPRDB library from inside the tree
+USRPDB_INCLUDES = -I$(top_srcdir)/usrpdb/src
+USRPDB_LA = $(top_builddir)/usrpdb/src/libusrpdb.la
+
# How to link in the USRP library from inside the tree
USRP_INCLUDES = -I$(top_srcdir)/usrp/host/lib/legacy \
-I$(top_srcdir)/usrp/firmware/include
Modified: gnuradio/branches/developers/jcorgan/t127/configure.ac
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/configure.ac 2007-12-19
06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/configure.ac 2007-12-19
19:53:54 UTC (rev 7230)
@@ -224,8 +224,8 @@
GRC_GNURADIO_CORE
GRC_PMT
GRC_MBLOCK dnl this must come after GRC_PMT
-GRC_USRP
GRC_USRPDB
+GRC_USRP dnl this must come after USRPDB
GRC_GR_USRP dnl this must come after GRC_USRP
GRC_GR_AUDIO_ALSA
GRC_GR_AUDIO_JACK
Modified:
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/Makefile.am
2007-12-19 06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/Makefile.am
2007-12-19 19:53:54 UTC (rev 7230)
@@ -20,7 +20,7 @@
include $(top_srcdir)/Makefile.common
-INCLUDES = $(USRP_INCLUDES) $(OMNITHREAD_INCLUDES)
+INCLUDES = $(USRPDB_INCLUDES) $(USRP_INCLUDES) $(OMNITHREAD_INCLUDES)
lib_LTLIBRARIES = libusrp.la
@@ -28,6 +28,7 @@
libusrp_la_LIBADD = \
$(USB_LIBS) \
+ $(USRPDB_LIBS) \
../../misc/libmisc.la
EXTRA_DIST = \
@@ -94,7 +95,8 @@
usrp_dbid.cc \
usrp_local_sighandler.cc \
usrp_prims.cc \
- usrp_standard.cc
+ usrp_standard.cc \
+ usrp_hwa_rx.cc
if FUSB_TECH_generic
@@ -124,7 +126,8 @@
usrp_dbid.h \
usrp_prims.h \
usrp_slots.h \
- usrp_standard.h
+ usrp_standard.h \
+ usrp_hwa_rx.h
noinst_HEADERS = \
ad9862.h \
Added:
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.cc
(rev 0)
+++
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.cc
2007-12-19 19:53:54 UTC (rev 7230)
@@ -0,0 +1,176 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <usrp_hwa_rx.h>
+#include <stdexcept>
+#include <iostream>
+
+#define USRP_HWA_RX_DEBUG 1
+
+usrpdb_hwa_sptr
+usrp_make_hwa(usrp_basic_rx *u, int side)
+{
+ return usrpdb_hwa_sptr(new usrp_hwa_rx(u, side));
+}
+
+usrp_hwa_rx::usrp_hwa_rx(usrp_basic_rx *u, int side)
+ : d_u(u),
+ d_side(side)
+{
+}
+
+usrp_hwa_rx::~usrp_hwa_rx()
+{
+ // don't delete
+ d_u = 0;
+}
+
+unsigned int
+usrp_hwa_rx::side()
+{
+ return d_side;
+}
+
+float
+usrp_hwa_rx::fpga_master_clock_freq()
+{
+ return (float)d_u->fpga_master_clock_freq();
+}
+
+float
+usrp_hwa_rx::dac_pga_gain()
+{
+ throw std::runtime_error("not implemented");
+}
+
+float
+usrp_hwa_rx::dac_pga_min()
+{
+ throw std::runtime_error("not implemented");
+}
+
+float
+usrp_hwa_rx::dac_pga_max()
+{
+ throw std::runtime_error("not implemented");
+}
+
+float
+usrp_hwa_rx::dac_pga_db_per_step()
+{
+ throw std::runtime_error("not implemented");
+}
+
+void
+usrp_hwa_rx::set_dac_pga(float gain)
+{
+ throw std::runtime_error("not implemented");
+}
+
+float
+usrp_hwa_rx::adc_pga_gain()
+{
+ throw std::runtime_error("not implemented");
+}
+
+float
+usrp_hwa_rx::adc_pga_min()
+{
+ return d_u->pga_min();
+}
+
+float
+usrp_hwa_rx::adc_pga_max()
+{
+ return d_u->pga_max();
+}
+
+float
+usrp_hwa_rx::adc_pga_db_per_step()
+{
+ return d_u->pga_db_per_step();
+}
+
+void
+usrp_hwa_rx::set_adc_pga(float gain)
+{
+ if (USRP_HWA_RX_DEBUG)
+ std::cout << "usrp_hwa_rx: setting ADC PGA gain to " << gain << std::endl;
+
+ bool ok = false;
+ ok &= d_u->set_pga(2*d_side+0, gain);
+ ok &= d_u->set_pga(2*d_side+1, gain);
+ if (!ok)
+ throw std::runtime_error("unable to set pga gain");
+}
+
+void
+usrp_hwa_rx::bypass_adc_buffers(bool bypass)
+{
+ if (USRP_HWA_RX_DEBUG)
+ std::cout << "usrp_hwa_rx: bypassing ADC buffers: " << bypass << std::endl;
+
+ bool ok = false;
+ ok &= d_u->set_adc_buffer_bypass(2*d_side+0, bypass);
+ ok &= d_u->set_adc_buffer_bypass(2*d_side+1, bypass);
+ if (!ok)
+ throw std::runtime_error("unable to bypass ADC buffers");
+}
+
+void
+usrp_hwa_rx::write_oe(unsigned short mask, unsigned short val)
+{
+}
+
+void
+usrp_hwa_rx::set_refclk_divisor(int divisor)
+{
+}
+
+void
+usrp_hwa_rx::enable_refclk(bool enable)
+{
+}
+
+float
+usrp_hwa_rx::refclk_frequency()
+{
+}
+
+void
+usrp_hwa_rx::write_i2c(char addr, std::vector<unsigned char> seq)
+{
+}
+
+std::vector<unsigned char>
+usrp_hwa_rx::read_i2c(char addr, int len)
+{
+}
+
+void
+usrp_hwa_rx::write_aux_dac(int val)
+{
+}
Added:
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.h
===================================================================
---
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.h
(rev 0)
+++
gnuradio/branches/developers/jcorgan/t127/usrp/host/lib/legacy/usrp_hwa_rx.h
2007-12-19 19:53:54 UTC (rev 7230)
@@ -0,0 +1,67 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_USRP_HWA_RX_H
+#define INCLUDED_USRP_HWA_RX_H
+
+#include <usrpdb_hwa.h>
+#include "usrp_basic.h"
+
+usrpdb_hwa_sptr usrp_make_hwa(usrp_basic_rx *u, int side);
+
+class usrp_hwa_rx : public usrpdb_hwa
+{
+private:
+ usrp_hwa_rx(usrp_basic_rx *u, int side);
+ friend usrpdb_hwa_sptr usrp_make_hwa(usrp_basic_rx *u, int side);
+
+ usrp_basic_rx *d_u;
+ int d_side;
+
+public:
+ virtual ~usrp_hwa_rx();
+
+ virtual unsigned int side();
+ virtual float fpga_master_clock_freq();
+ virtual float dac_pga_gain();
+ virtual float dac_pga_min();
+ virtual float dac_pga_max();
+ virtual float dac_pga_db_per_step();
+ virtual void set_dac_pga(float gain);
+ virtual float adc_pga_gain();
+ virtual float adc_pga_min();
+ virtual float adc_pga_max();
+ virtual float adc_pga_db_per_step();
+ virtual void set_adc_pga(float gain);
+ virtual void bypass_adc_buffers(bool bypass);
+ virtual void write_oe(unsigned short mask, unsigned short val);
+ virtual void set_refclk_divisor(int divisor);
+ virtual void enable_refclk(bool enable);
+ virtual float refclk_frequency();
+ virtual void write_i2c(char addr, std::vector<unsigned char> seq);
+ virtual std::vector<unsigned char> read_i2c(char addr, int len);
+ virtual void write_aux_dac(int val);
+};
+
+typedef boost::shared_ptr<usrpdb_hwa> usrpdb_hwa_sptr;
+
+#endif /* INCLUDED_USRPDB_HWA_H */
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
2007-12-19 06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.h
2007-12-19 19:53:54 UTC (rev 7230)
@@ -33,7 +33,7 @@
virtual ~usrpdb_hwa() = 0;
virtual unsigned int side() = 0;
- virtual float fpga_master_clock_frequency() = 0;
+ virtual float fpga_master_clock_freq() = 0;
virtual float dac_pga_gain() = 0;
virtual float dac_pga_min() = 0;
virtual float dac_pga_max() = 0;
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i
2007-12-19 06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i
2007-12-19 19:53:54 UTC (rev 7230)
@@ -34,24 +34,24 @@
usrpdb_hwa();
virtual ~usrpdb_hwa() = 0;
- virtual unsigned int side() = 0;
- virtual float fpga_master_clock_frequency() = 0;
- virtual float dac_pga_gain() = 0;
- virtual float dac_pga_min() = 0;
- virtual float dac_pga_max() = 0;
- virtual float dac_pga_db_per_step() = 0;
- virtual void set_dac_pga(float gain) = 0;
- virtual float adc_pga_gain() = 0;
- virtual float adc_pga_min() = 0;
- virtual float adc_pga_max() = 0;
- virtual float adc_pga_db_per_step() = 0;
- virtual void set_adc_pga(float gain) = 0;
- virtual void bypass_adc_buffers(bool bypass) = 0;
- virtual void write_oe(unsigned short mask, unsigned short value) = 0;
- virtual void set_refclk_divisor(int divisor) = 0;
- virtual void enable_refclk(bool enable) = 0;
- virtual float refclk_frequency() = 0;
- virtual void write_i2c(char addr, std::vector<unsigned char> seq) = 0;
- virtual std::vector<unsigned char> read_i2c(char addr, int len) = 0;
- virtual void write_aux_dac(int val) = 0;
+ virtual unsigned int side();
+ virtual float fpga_master_clock_freq();
+ virtual float dac_pga_gain() throw (std::runtime_error);
+ virtual float dac_pga_min() throw (std::runtime_error);
+ virtual float dac_pga_max() throw (std::runtime_error);
+ virtual float dac_pga_db_per_step() throw (std::runtime_error);
+ virtual void set_dac_pga(float gain) throw (std::runtime_error);
+ virtual float adc_pga_gain() throw (std::runtime_error);
+ virtual float adc_pga_min() throw (std::runtime_error);
+ virtual float adc_pga_max() throw (std::runtime_error);
+ virtual float adc_pga_db_per_step() throw (std::runtime_error);
+ virtual void set_adc_pga(float gain) throw (std::runtime_error);
+ virtual void bypass_adc_buffers(bool bypass);
+ virtual void write_oe(unsigned short mask, unsigned short value);
+ virtual void set_refclk_divisor(int divisor);
+ virtual void enable_refclk(bool enable);
+ virtual float refclk_frequency();
+ virtual void write_i2c(char addr, std::vector<unsigned char> seq);
+ virtual std::vector<unsigned char> read_i2c(char addr, int len);
+ virtual void write_aux_dac(int val);
};
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc
2007-12-19 06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc
2007-12-19 19:53:54 UTC (rev 7230)
@@ -66,7 +66,7 @@
}
float
-usrpdb_hwa_qa::fpga_master_clock_frequency()
+usrpdb_hwa_qa::fpga_master_clock_freq()
{
// mimic USRP1
return 64e6;
@@ -179,7 +179,7 @@
float
usrpdb_hwa_qa::refclk_frequency()
{
- return fpga_master_clock_frequency()/d_refclk_divisor;
+ return fpga_master_clock_freq()/d_refclk_divisor;
}
void
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h
2007-12-19 06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h
2007-12-19 19:53:54 UTC (rev 7230)
@@ -47,7 +47,7 @@
~usrpdb_hwa_qa();
unsigned int side();
- virtual float fpga_master_clock_frequency();
+ float fpga_master_clock_freq();
float dac_pga_gain();
float dac_pga_min();
float dac_pga_max();
@@ -62,10 +62,10 @@
void write_oe(unsigned short mask, unsigned short val);
void set_refclk_divisor(int divisor);
void enable_refclk(bool enable);
- virtual float refclk_frequency();
+ float refclk_frequency();
void write_i2c(char addr, std::vector<unsigned char> seq);
std::vector<unsigned char> read_i2c(char addr, int len);
- virtual void write_aux_dac(int val);
+ void write_aux_dac(int val);
};
#endif /* INCLUDED_USRPDB_HWA_QA_H */
Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i
2007-12-19 06:13:16 UTC (rev 7229)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i
2007-12-19 19:53:54 UTC (rev 7230)
@@ -28,32 +28,3 @@
%ignore hwa_qa;
usrpdb_hwa_sptr usrpdb_make_qa_hwa(int side);
-
-class usrpdb_hwa_qa : public usrpdb_hwa
-{
- usrpdb_hwa_qa(int side);
-
-public:
- ~usrpdb_hwa_qa();
-
- unsigned int side();
- virtual float fpga_master_clock_frequency();
- float dac_pga_gain();
- float dac_pga_min();
- float dac_pga_max();
- float dac_pga_db_per_step();
- void set_dac_pga(float gain);
- float adc_pga_gain();
- float adc_pga_min();
- float adc_pga_max();
- float adc_pga_db_per_step();
- void set_adc_pga(float gain);
- void bypass_adc_buffers(bool bypass);
- void write_oe(int mask, int val);
- void set_refclk_divisor(int divisor);
- void enable_refclk(bool enable);
- virtual float refclk_frequency();
- void write_i2c(char addr, std::vector<unsigned char> seq);
- std::vector<unsigned char> read_i2c(char addr, int len);
- virtual void write_aux_dac(int val);
-};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7230 - in gnuradio/branches/developers/jcorgan/t127: . usrp/host/lib/legacy usrpdb/src,
jcorgan <=