[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9426 - gnuradio/branches/developers/trondeau/dbs/usrp
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9426 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy |
Date: |
Tue, 26 Aug 2008 20:15:39 -0600 (MDT) |
Author: trondeau
Date: 2008-08-26 20:15:39 -0600 (Tue, 26 Aug 2008)
New Revision: 9426
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.cc
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.h
Log:
compiling but still untested WBX class; kind of unsatisfying work-around of
inheritence issues.
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.cc
2008-08-27 02:05:25 UTC (rev 9425)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.cc
2008-08-27 02:15:39 UTC (rev 9426)
@@ -246,18 +246,7 @@
return true;
}
-void
-wbx_base::_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);
-}
-
/****************************************************************************/
@@ -627,15 +616,13 @@
void
_ADF410X_common::_write_it(int v)
{
- throw std::runtime_error("_write_it called from base class.\n");
- /*
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);
- */
+ //d_usrp->_write_spi(0, d_spi_enable, d_spi_format, s);
+ usrp()->_write_spi(0, d_spi_enable, d_spi_format, s);
}
int
@@ -658,7 +645,31 @@
}
}
+float
+_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.");
+}
+
+
/****************************************************************************/
@@ -845,6 +856,31 @@
return d_usrp->write_aux_dac(d_which, 1, (int)(dac_value));
}
+float
+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;
+}
+
+
/****************************************************************************/
@@ -876,3 +912,26 @@
return 0.05;
}
+float
+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;
+}
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.h
2008-08-27 02:05:25 UTC (rev 9425)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_wbx.h
2008-08-27 02:15:39 UTC (rev 9426)
@@ -54,20 +54,19 @@
float gain_db_per_step();
bool set_gain(float gain);
bool is_quadrature();
- void _write_it(int v);
protected:
- bool _lock_detect();
+ 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);
- bool _rx_read_io();
+ virtual bool _rx_read_io();
bool _tx_read_io();
bool _compute_regs(float freq);
- float _refclk_freq();
+ virtual float _refclk_freq();
int _refclk_divisor();
bool _set_pga(float pga_gain);
@@ -130,10 +129,15 @@
void _write_N(int N);
void _write_func(int func);
void _write_init(int init);
+ int _prescaler();
virtual void _write_it(int v);
- int _prescaler();
+ virtual float _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;
@@ -183,6 +187,13 @@
float gain_max();
float gain_db_per_step();
bool set_gain(float gain);
+
+ float _refclk_freq();
+ bool _rx_write_io(int value, int mask);
+ bool _lock_detect();
+
+protected:
+ usrp_basic* usrp();
};
@@ -198,6 +209,13 @@
float gain_min();
float gain_max();
float gain_db_per_step();
+
+ float _refclk_freq();
+ bool _rx_write_io(int value, int mask);
+ bool _lock_detect();
+
+protected:
+ usrp_basic* usrp();
};
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9426 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy,
trondeau <=