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
This commit is contained in:
jcorgan 2009-01-05 18:05:17 +00:00
parent 27ef52aac9
commit 509e84becd
2 changed files with 12 additions and 3 deletions

View File

@ -112,7 +112,7 @@ usrp_basic::usrp_basic (int which_board,
: d_udh (0),
d_usb_data_rate (16000000), // SWAG, see below
d_bytes_per_poll ((int) (POLLING_INTERVAL * d_usb_data_rate)),
d_verbose (false), d_db(2)
d_verbose (false), d_fpga_master_clock_freq(64000000), d_db(2)
{
/*
* SWAG: Scientific Wild Ass Guess.

View File

@ -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