summaryrefslogtreecommitdiff
path: root/usrp/host/lib/legacy/usrp_basic.h
diff options
context:
space:
mode:
authorjcorgan2009-01-05 18:05:17 +0000
committerjcorgan2009-01-05 18:05:17 +0000
commit54625297142c1ed5ac4665d48ae6dea997b7b7eb (patch)
tree0a5cf4125c20e4a4597b0d4748e375b5c8beba1b /usrp/host/lib/legacy/usrp_basic.h
parentb54ab8fc36e242e0ae9c0fad99e1eda5d6423bd1 (diff)
downloadgnuradio-54625297142c1ed5ac4665d48ae6dea997b7b7eb.tar.gz
gnuradio-54625297142c1ed5ac4665d48ae6dea997b7b7eb.tar.bz2
gnuradio-54625297142c1ed5ac4665d48ae6dea997b7b7eb.zip
Allow setting of non-standard FPGA master clock frequency for USRP1
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10193 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp/host/lib/legacy/usrp_basic.h')
-rw-r--r--usrp/host/lib/legacy/usrp_basic.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/usrp/host/lib/legacy/usrp_basic.h b/usrp/host/lib/legacy/usrp_basic.h
index c5e3d2824..2caac7b66 100644
--- a/usrp/host/lib/legacy/usrp_basic.h
+++ b/usrp/host/lib/legacy/usrp_basic.h
@@ -1,4 +1,3 @@
-
/* -*- c++ -*- */
/*
* Copyright 2003,2004,2008 Free Software Foundation, Inc.
@@ -69,6 +68,7 @@ protected:
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];
@@ -177,7 +177,16 @@ public:
/*!
* \brief return frequency of master oscillator on USRP
*/
- long fpga_master_clock_freq () const { return 64000000; }
+ 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