[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9232 - gnuradio/branches/developers/trondeau/dbs/usrp
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9232 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy |
Date: |
Sun, 10 Aug 2008 17:32:13 -0600 (MDT) |
Author: trondeau
Date: 2008-08-10 17:32:12 -0600 (Sun, 10 Aug 2008)
New Revision: 9232
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.cc
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.h
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.cc
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.h
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
Log:
Changing from freq_range to freq_min/max and dropping freq step value. Will
build freq_range() into Swig file instead.
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.cc
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.cc
2008-08-10 23:32:12 UTC (rev 9232)
@@ -120,16 +120,18 @@
return d_usrp->_write_fpga_reg(FR_ATR_RX_DELAY, v);
}
-std::vector<float>
-db_base::freq_range()
+float
+db_base::freq_min()
{
- // Return range of frequencies in Hz that can be tuned by this d'board.
-
- // @returns (min_freq, max_freq, step_size)
- // @rtype tuple
throw 0;
}
+float
+db_base::freq_max()
+{
+ throw 0;
+}
+
struct freq_result_t
db_base::set_freq(float target_freq)
{
@@ -144,15 +146,25 @@
throw 0;
}
-std::vector<float> db_base::gain_range()
+
+float
+db_base::gain_min()
{
- // Return range of gain that can be set by this d'board.
- //
- // @returns (min_gain, max_gain, step_size)
- // Where gains are expressed in decibels (your mileage may vary)
throw 0;
}
+float
+db_base::gain_max()
+{
+ throw 0;
+}
+
+float
+db_base::gain_db_per_step()
+{
+ throw 0;
+}
+
bool
db_base::set_gain(float gain)
{
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.h
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_base.h
2008-08-10 23:32:12 UTC (rev 9232)
@@ -78,9 +78,12 @@
////////////////////////////////////////////////////////
// derived classes should override the following methods
- virtual std::vector<float> freq_range();
+ virtual float gain_min();
+ virtual float gain_max();
+ virtual float gain_db_per_step();
+ virtual float freq_min();
+ virtual float freq_max();
virtual struct freq_result_t set_freq(float target_freq);
- virtual std::vector<float> gain_range();
virtual bool set_gain(float gain);
virtual bool is_quadrature();
virtual bool i_and_q_swapped();
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
2008-08-10 23:32:12 UTC (rev 9232)
@@ -35,28 +35,22 @@
if(0) {
// Doing this would give us a different default than the historical
values...
- std::vector<float> g = gain_range(); // initialize gain
- set_gain(float(g[0]+g[1]) / 2);
+ set_gain(float(gain_min() + gain_max()) / 2); // initialize gain
}
}
-std::vector<float>
-db_basic_tx::freq_range()
+float
+db_basic_tx::freq_min()
{
- // Return range of frequencies in Hz that can be tuned by this d'board.
- //
- // @returns (min_freq, max_freq, step_size)
- // @rtype tuple
- //
- // We say we can do pretty much anything...
-
- std::vector<float> f(3,0);
- f[0] = -90e9;
- f[1] = 90e9;
- f[2] = 1e-6;
- return f;
+ return -90e9;
}
+float
+db_basic_tx::freq_max()
+{
+ return 90e9;
+}
+
struct freq_result_t
db_basic_tx::set_freq(float target_freq)
{
@@ -75,21 +69,24 @@
return args;
}
-std::vector<float>
-db_basic_tx::gain_range()
+float
+db_basic_tx::gain_min()
{
- // Return range of gain that can be set by this d'board.
- //
- // @returns (min_gain, max_gain, step_size)
- // Where gains are expressed in decibels (your mileage may vary)
-
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max();
- g[2] = d_usrp->pga_db_per_step();
- return g;
+ return d_usrp->pga_min();
}
+float
+db_basic_tx::gain_max()
+{
+ return d_usrp->pga_max();
+}
+
+float
+db_basic_tx::gain_db_per_step()
+{
+ return d_usrp->pga_db_per_step();
+}
+
bool
db_basic_tx::set_gain(float gain)
{
@@ -130,28 +127,22 @@
bypass_adc_buffers(true);
if(0) { // Doing this would give us a different default than the
historical values...
- std::vector<float> g = gain_range(); // initialize gain
- set_gain(float(g[0]+g[1]) / 2.0);
+ set_gain(float(gain_min() + gain_max()) / 2.0); // initialize gain
}
}
-std::vector<float>
-db_basic_rx::freq_range()
+float
+db_basic_rx::freq_min()
{
- // Return range of frequencies in Hz that can be tuned by this d'board.
- //
- // @returns (min_freq, max_freq, step_size)
- // @rtype tuple
- //
- // We say we can do pretty much anything...
-
- std::vector<float> f(3,0);
- f[0] = -90e9;
- f[1] = 90e9;
- f[2] = 1e-6;
- return f;
+ return -90e9;
}
+float
+db_basic_rx::freq_max()
+{
+ return 90e9;
+}
+
struct freq_result_t
db_basic_rx::set_freq(float target_freq)
{
@@ -170,21 +161,24 @@
return args;
}
-std::vector<float>
-db_basic_rx::gain_range()
+float
+db_basic_rx::gain_min()
{
- // Return range of gain that can be set by this d'board.
- //
- // @returns (min_gain, max_gain, step_size)
- // Where gains are expressed in decibels (your mileage may vary)
-
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max();
- g[2] = d_usrp->pga_db_per_step();
- return g;
+ return d_usrp->pga_min();
}
+float
+db_basic_rx::gain_max()
+{
+ return d_usrp->pga_max();
+}
+
+float
+db_basic_rx::gain_db_per_step()
+{
+ return d_usrp->pga_db_per_step();
+}
+
bool
db_basic_rx::set_gain(float gain)
{
@@ -220,23 +214,17 @@
// @param which: which side: 0 or 1 corresponding to RX_A or RX_B
respectively
}
-std::vector<float>
-db_lf_tx::freq_range()
+float
+db_lf_tx::freq_min()
{
- // Return range of frequencies in Hz that can be tuned by this d'board.
- //
- // @returns (min_freq, max_freq, step_size)
- // @rtype tuple
- //
- // We cover the first nyquist zone only
-
- std::vector<float> f(3,0);
- f[0] = -32e6;
- f[1] = 32e6;
- f[2] = 1e-6;
- return f;
+ return -32e6;
}
+float
+db_lf_tx::freq_max()
+{
+ return 32e6;
+}
/******************************************************************************/
@@ -252,20 +240,16 @@
// @type subdev: int
}
-std::vector<float>
-db_lf_rx::freq_range()
+float
+db_lf_rx::freq_min()
{
- // Return range of frequencies in Hz that can be tuned by this d'board.
- //
- // @returns (min_freq, max_freq, step_size)
- // @rtype tuple
- //
- // We cover the first nyquist zone only
-
- std::vector<float> f(3,0);
- f[0] = 0.0;
- f[1] = 32e6;
- f[2] = 1e-6;
- return f;
+ return 0.0;
}
+float
+db_lf_rx::freq_max()
+{
+ return 32e6;
+}
+
+
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
2008-08-10 23:32:12 UTC (rev 9232)
@@ -33,11 +33,14 @@
public:
db_basic_tx(usrp_basic *usrp, int which);
- std::vector<float> freq_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
+ float freq_min();
+ float freq_max();
struct freq_result_t set_freq(float target_freq);
- std::vector<float> gain_range();
- bool set_gain(float gain);
- bool is_quadrature();
+ bool set_gain(float gain);
+ bool is_quadrature();
};
@@ -49,11 +52,14 @@
public:
db_basic_rx(usrp_basic *usrp, int which, int subdev);
- std::vector<float> freq_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
+ float freq_min();
+ float freq_max();
struct freq_result_t set_freq(float target_freq);
- std::vector<float> gain_range();
- bool set_gain(float gain);
- bool is_quadrature();
+ bool set_gain(float gain);
+ bool is_quadrature();
private:
int d_subdev;
@@ -68,7 +74,8 @@
public:
db_lf_rx(usrp_basic *usrp, int which, int subdev);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
};
@@ -80,7 +87,8 @@
public:
db_lf_tx(usrp_basic *usrp, int which);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
};
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.cc
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.cc
2008-08-10 23:32:12 UTC (rev 9232)
@@ -40,8 +40,7 @@
d_usrp->_write_oe(d_which, 0, 0xffff); // turn off all outputs
_enable_refclk(false); // disable refclk
- std::vector<float> g = gain_range(); // initialize gain
- set_gain(float(g[0]+g[1]) / 2.0);
+ set_gain(float(gain_min() + gain_max()) / 2.0); // initialize gain
set_auto_tr(false);
@@ -214,23 +213,24 @@
return args;
}
-std::vector<float>
-flexrf_base::gain_range()
+float
+flexrf_base::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
- */
- std::vector<float> g(3,0);
+ return d_usrp->pga_min();
+}
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max();
- g[2] = d_usrp->pga_db_per_step();
- return g;
+float
+flexrf_base::gain_max()
+{
+ return d_usrp->pga_max();
}
+float
+flexrf_base::gain_db_per_step()
+{
+ return d_usrp->pga_db_per_step();
+}
+
bool
flexrf_base::set_gain(float gain)
{
@@ -353,25 +353,24 @@
d_usrp->write_io(d_which, v, mask);
}
-std::vector<float>
-flexrf_base_tx::gain_range()
+float
+flexrf_base_tx::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
-
- Flex Tx boards require that the PGA be maxed out to properly bias their
circuitry.
- */
+ return d_usrp->pga_max();
+}
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_max(); // FIXME: min?
- g[1] = d_usrp->pga_max();
- g[2] = 1;
- return g;
+float
+flexrf_base_tx::gain_max()
+{
+ return d_usrp->pga_max();
}
+float
+flexrf_base_tx::gain_db_per_step()
+{
+ return 1;
+}
+
bool
flexrf_base_tx::set_gain(float gain)
{
@@ -493,8 +492,8 @@
float pga_gain, agc_gain;
float V_maxgain, V_mingain, V_fullscale, dac_value;
- float maxgain = gain_range()[1] - d_usrp->pga_max();
- float mingain = gain_range()[0];
+ 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());
@@ -629,12 +628,18 @@
}
}
-std::vector<float>
-_AD4360_common::freq_range()
+float
+_AD4360_common::freq_min()
{
throw 0;
}
+float
+_AD4360_common::freq_max()
+{
+ throw 0;
+}
+
//----------------------------------------------------------------------
_2400_common::_2400_common(bool tx)
@@ -655,16 +660,18 @@
d_freq_mult = 1;
}
-std::vector<float>
-_2400_common::freq_range() // FIXME
+float
+_2400_common::freq_min()
{
- std::vector<float> f(3,0);
- f[0] = 2300e6;
- f[1] = 2700e6;
- f[2] = 4e6;
- return f;
+ return 2300e6;
}
+float
+_2400_common::freq_max()
+{
+ return 2700e6;
+}
+
//----------------------------------------------------------------------
_1200_common::_1200_common(bool tx)
@@ -685,16 +692,18 @@
d_freq_mult = 2;
}
-std::vector<float>
-_1200_common::freq_range() // FIXME
+float
+_1200_common::freq_min()
{
- std::vector<float> f(3,0);
- f[0] = 1150e6;
- f[1] = 1350e6;
- f[2] = 4e6;
- return f;
+ return 1150e6;
}
+float
+_1200_common::freq_max()
+{
+ return 1350e6;
+}
+
//-------------------------------------------------------------------------
_1800_common::_1800_common(bool tx)
@@ -715,16 +724,18 @@
d_CPGAIN = 0; // bit 21
}
-std::vector<float>
-_1800_common::freq_range() // FIXME
+float
+_1800_common::freq_min()
{
- std::vector<float> f(3,0);
- f[0] = 1600e6;
- f[1] = 2000e6;
- f[2] = 4e6;
- return f;
+ return 1600e6;
}
+float
+_1800_common::freq_max()
+{
+ return 2000e6;
+}
+
//-------------------------------------------------------------------------
_900_common::_900_common(bool tx)
@@ -745,16 +756,18 @@
d_CPGAIN = 0; // bit 21
}
-std::vector<float>
-_900_common::freq_range() // FIXME
+float
+_900_common::freq_min()
{
- std::vector<float> f(3,0);
- f[0] = 800e6;
- f[1] = 1000e6;
- f[2] = 4e6;
- return f;
+ return 800e6;
}
+float
+_900_common::freq_max()
+{
+ return 1000e6;
+}
+
//-------------------------------------------------------------------------
_400_common::_400_common(bool tx)
@@ -781,16 +794,18 @@
d_CPGAIN = 0; // bit 21
}
-std::vector<float>
-_400_common::freq_range()
+float
+_400_common::freq_min()
{
- std::vector<float> f(3,0);
- f[0] = 400e6;
- f[1] = 500e6;
- f[2] = 1e3;
- return f;
+ return 400e6;
}
+float
+_400_common::freq_max()
+{
+ return 500e6;
+}
+
//------------------------------------------------------------
db_flexrf_2400_tx::db_flexrf_2400_tx(usrp_basic *usrp, int which)
@@ -807,12 +822,18 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_2400_tx::freq_range()
+float
+db_flexrf_2400_tx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_2400_tx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_2400_tx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -834,34 +855,43 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_2400_rx::gain_range()
+float
+db_flexrf_2400_rx::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
- */
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max()+70;
- g[2] = 0.05;
- return g;
+ return d_usrp->pga_min();
}
+float
+db_flexrf_2400_rx::gain_max()
+{
+ return d_usrp->pga_max()+70;
+}
+
+float
+db_flexrf_2400_rx::gain_db_per_step()
+{
+ return 0.05;
+}
+
+
bool
db_flexrf_2400_rx::i_and_q_swapped()
{
return true;
}
-std::vector<float>
-db_flexrf_2400_rx::freq_range()
+float
+db_flexrf_2400_rx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_2400_rx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_2400_rx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -897,12 +927,18 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_1200_tx::freq_range()
+float
+db_flexrf_1200_tx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_1200_tx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_1200_tx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -925,34 +961,42 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_1200_rx::gain_range()
+float
+db_flexrf_1200_rx::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
- */
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max()+70;
- g[2] = 0.05;
- return g;
+ return d_usrp->pga_min();
}
+float
+db_flexrf_1200_rx::gain_max()
+{
+ return d_usrp->pga_max()+70;
+}
+
+float
+db_flexrf_1200_rx::gain_db_per_step()
+{
+ return 0.05;
+}
+
bool
db_flexrf_1200_rx::i_and_q_swapped()
{
return true;
}
-std::vector<float>
-db_flexrf_1200_rx::freq_range()
+float
+db_flexrf_1200_rx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_1200_rx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_1200_rx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -988,12 +1032,18 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_1800_tx::freq_range()
+float
+db_flexrf_1800_tx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_1800_tx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_1800_tx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -1016,34 +1066,42 @@
}
-std::vector<float>
-db_flexrf_1800_rx::gain_range()
+float
+db_flexrf_1800_rx::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
- */
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max()+70;
- g[2] = 0.05;
- return g;
+ return d_usrp->pga_min();
}
+float
+db_flexrf_1800_rx::gain_max()
+{
+ return d_usrp->pga_max()+70;
+}
+
+float
+db_flexrf_1800_rx::gain_db_per_step()
+{
+ return 0.05;
+}
+
bool
db_flexrf_1800_rx::i_and_q_swapped()
{
return true;
}
-std::vector<float>
-db_flexrf_1800_rx::freq_range()
+float
+db_flexrf_1800_rx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_1800_rx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_1800_rx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -1079,12 +1137,18 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_900_tx::freq_range()
+float
+db_flexrf_900_tx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_900_tx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_900_tx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -1105,34 +1169,42 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_900_rx::gain_range()
+float
+db_flexrf_900_rx::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
- */
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max()+70;
- g[2] = 0.05;
- return g;
+ return 0.05;
}
+float
+db_flexrf_900_rx::gain_max()
+{
+ return d_usrp->pga_max()+70;
+}
+
+float
+db_flexrf_900_rx::gain_db_per_step()
+{
+ return 0.05;
+}
+
bool
db_flexrf_900_rx::i_and_q_swapped()
{
return true;
}
-std::vector<float>
-db_flexrf_900_rx::freq_range()
+float
+db_flexrf_900_rx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_900_rx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_900_rx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -1168,12 +1240,18 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_400_tx::freq_range()
+float
+db_flexrf_400_tx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_400_tx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_400_tx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
@@ -1195,34 +1273,43 @@
delete d_common;
}
-std::vector<float>
-db_flexrf_400_rx::gain_range()
+float
+db_flexrf_400_rx::gain_min()
{
- /*
- Return range of gain that can be set by this d'board.
-
- @returns (min_gain, max_gain, step_size)
- Where gains are expressed in decibels (your mileage may vary)
- */
- std::vector<float> g(3,0);
- g[0] = d_usrp->pga_min();
- g[1] = d_usrp->pga_max()+45;
- g[2] = 0.035;
- return g;
+ return d_usrp->pga_min();
}
+float
+db_flexrf_400_rx::gain_max()
+{
+ return d_usrp->pga_max()+45;
+}
+
+float
+db_flexrf_400_rx::gain_db_per_step()
+{
+ return 0.035;
+}
+
+
bool
db_flexrf_400_rx::i_and_q_swapped()
{
return true;
}
-std::vector<float>
-db_flexrf_400_rx::freq_range()
+float
+db_flexrf_400_rx::freq_min()
{
- return d_common->freq_range();
+ return d_common->freq_min();
}
+float
+db_flexrf_400_rx::freq_max()
+{
+ return d_common->freq_max();
+}
+
bool
db_flexrf_400_rx::_compute_regs(float freq, int &retR, int &retcontrol, int
&retN, float &retfreq)
{
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.h
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_flexrf.h
2008-08-10 23:32:12 UTC (rev 9232)
@@ -48,7 +48,9 @@
~flexrf_base();
struct freq_result_t set_freq(float freq);
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool set_gain(float gain);
bool is_quadrature();
float lo_offset();
@@ -87,7 +89,9 @@
void set_auto_tr(bool on);
void set_enable(bool on);
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool set_gain(float gain);
protected:
@@ -118,7 +122,8 @@
_AD4360_common(bool tx);
virtual ~_AD4360_common();
- virtual std::vector<float> freq_range();
+ virtual float freq_min();
+ virtual float freq_max();
bool _compute_regs(float refclk_freq, float freq, int &retR,
int &retcontrol, int &retN, float &retfreq);
@@ -147,8 +152,9 @@
public:
_2400_common(bool tx);
~_2400_common() {}
-
- std::vector<float> freq_range();
+
+ float freq_min();
+ float freq_max();
};
//----------------------------------------------------------------------
@@ -159,7 +165,8 @@
_1200_common(bool tx);
~_1200_common() {}
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
};
//-------------------------------------------------------------------------
@@ -170,7 +177,8 @@
_1800_common(bool tx);
~_1800_common() {}
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
};
//-------------------------------------------------------------------------
@@ -181,7 +189,8 @@
_900_common(bool tx);
~_900_common() {}
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
};
//-------------------------------------------------------------------------
@@ -192,7 +201,8 @@
_400_common(bool tx);
~_400_common() {}
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
};
@@ -206,7 +216,8 @@
// Wrapper calls to d_common functions
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
protected:
_2400_common *d_common;
@@ -218,10 +229,13 @@
db_flexrf_2400_rx(usrp_basic *usrp, int which);
~db_flexrf_2400_rx();
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool i_and_q_swapped();
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
int _compute_control_reg();
int _refclk_divisor();
@@ -240,7 +254,8 @@
// Wrapper calls to d_common functions
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
protected:
_1200_common *d_common;
@@ -253,10 +268,13 @@
db_flexrf_1200_rx(usrp_basic *usrp, int which);
~db_flexrf_1200_rx();
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool i_and_q_swapped();
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
int _compute_control_reg();
int _refclk_divisor();
@@ -275,7 +293,8 @@
// Wrapper calls to d_common functions
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
protected:
_1800_common *d_common;
@@ -287,10 +306,13 @@
db_flexrf_1800_rx(usrp_basic *usrp, int which);
~db_flexrf_1800_rx();
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool i_and_q_swapped();
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
int _compute_control_reg();
int _refclk_divisor();
@@ -309,7 +331,8 @@
// Wrapper calls to d_common functions
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
protected:
_900_common *d_common;
@@ -321,10 +344,13 @@
db_flexrf_900_rx(usrp_basic *usrp, int which);
~db_flexrf_900_rx();
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool i_and_q_swapped();
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
int _compute_control_reg();
int _refclk_divisor();
@@ -344,7 +370,8 @@
// Wrapper calls to d_common functions
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
protected:
_400_common *d_common;
@@ -356,10 +383,13 @@
db_flexrf_400_rx(usrp_basic *usrp, int which);
~db_flexrf_400_rx();
- std::vector<float> gain_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
bool i_and_q_swapped();
- std::vector<float> freq_range();
+ float freq_min();
+ float freq_max();
bool _compute_regs(float freq, int &retR, int &retcontrol, int &retN, float
&retfreq);
int _compute_control_reg();
int _refclk_divisor();
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
2008-08-10 23:32:12 UTC (rev 9232)
@@ -125,8 +125,7 @@
d_fast_tuning = false;
d_inverted = false; // FIXME get rid of this
- std::vector<float> g = gain_range(); // initialize gain
- set_gain(float(g[0]+g[1]) / 2.0);
+ set_gain(float(gain_min() + gain_max()) / 2.0); // initialize gain
bypass_adc_buffers(false);
}
@@ -149,7 +148,6 @@
int dacword = int(4096*voltage/1.22/3.3); // 1.22 = opamp gain
assert(dacword>=0 && dacword<4096);
- printf("db_tv_rx::set_rfagc usrp: %x\n", d_usrp);
d_usrp->write_aux_dac(d_which, 1, dacword);
}
@@ -178,21 +176,18 @@
}
}
-std::vector<float>
-db_tv_rx::freq_range()
+float
+db_tv_rx::freq_min()
{
- // Return range of frequencies in Hz that can be tuned by this d'board.
- //
- // @returns (min_freq, max_freq, step_size)
- // @rtype tuple
-
- std::vector<float> f(3,0);
- f[0] = 50e6;
- f[1] = 860e6;
- f[2] = 10e3;
- return f;
+ return 50e6;
}
+float
+db_tv_rx::freq_max()
+{
+ return 860e6;
+}
+
struct freq_result_t
db_tv_rx::set_freq(float target_freq)
{
@@ -207,8 +202,9 @@
freq_result_t args = {0, 0};
- std::vector<float> r = freq_range();
- if((target_freq < r[0]) || (target_freq > r[1])) {
+ float fmin = freq_min();
+ float fmax = freq_max();
+ if((target_freq < fmin) || (target_freq > fmax)) {
return args;
}
@@ -235,21 +231,24 @@
return args;
}
-std::vector<float>
-db_tv_rx::gain_range()
+float
+db_tv_rx::gain_min()
{
- // Return range of gain that can be set by this d'board.
- //
- // @returns (min_gain, max_gain, step_size)
- // Where gains are expressed in decibels (your mileage may vary)
-
- std::vector<float> g(3,0);
- g[0] = 0;
- g[1] = 115;
- g[2] = 1;
- return g;
+ return 0;
}
+float
+db_tv_rx::gain_max()
+{
+ return 115;
+}
+
+float
+db_tv_rx::gain_db_per_step()
+{
+ return 1;
+}
+
bool
db_tv_rx::set_gain(float gain)
{
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
2008-08-10 22:45:14 UTC (rev 9231)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
2008-08-10 23:32:12 UTC (rev 9232)
@@ -42,13 +42,15 @@
db_tv_rx(usrp_basic *usrp, int which,
float first_IF, float second_IF);
- std::vector<float> freq_range();
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
+ float freq_min();
+ float freq_max();
struct freq_result_t set_freq(float target_freq);
- std::vector<float> gain_range();
- bool set_gain(float gain);
- bool is_quadrature();
-
- bool spectrum_inverted();
+ bool set_gain(float gain);
+ bool is_quadrature();
+ bool spectrum_inverted();
};
std::string int_seq_to_str(std::vector<int> &seq);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9232 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy,
trondeau <=