commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10384 - gnuradio/branches/developers/jcorgan/u2-wip/u


From: jcorgan
Subject: [Commit-gnuradio] r10384 - gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib
Date: Wed, 4 Feb 2009 10:55:13 -0700 (MST)

Author: jcorgan
Date: 2009-02-04 10:55:12 -0700 (Wed, 04 Feb 2009)
New Revision: 10384

Modified:
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db.h
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_base.h
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_basic.c
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_dbsrx.c
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_init.c
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_rfx.c
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_tvrx.c
   gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_xcvr2450.c
Log:
Implement default LO offset using db_base.lo_offset and db_tune.  Removes 
RFX-specific code.  Tested with LFRX, LFTX, RFX2400 TX, RFX2400 RX, and TVRX.

Modified: gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db.h
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db.h 
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db.h 
2009-02-04 17:55:12 UTC (rev 10384)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -60,6 +60,16 @@
 db_init(void);
 
 /*!
+ * \brief Set daughterboard LO offset frequency.
+ *
+ * \param[in] db is the daughterboard instance
+ * \param[in] offset is the amount to add to tuning requests
+ * \param[out] success or failure
+ */
+bool
+db_set_lo_offset(struct db_base *db, u2_fxpt_freq_t offset);
+
+/*!
  * \brief Two stage tuning.  Given target_freq, tune LO and DDC/DUC
  *
  * \param[in] db is the daughterboard instance

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_base.h
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_base.h    
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_base.h    
2009-02-04 17:55:12 UTC (rev 10384)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@
   u2_fxpt_gain_t       gain_max;       //< max gain that can be set (dB)
   u2_fxpt_gain_t       gain_step_size; //< (dB)
 
-  // u2_fxpt_freq_t    lo_offset;
+  u2_fxpt_freq_t       lo_offset;      //< offset to add to tune frequency
 
   /*
    * Auto T/R control values

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_basic.c
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_basic.c   
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_basic.c   
2009-02-04 17:55:12 UTC (rev 10384)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = false,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.atr_mask =     0,
   .base.atr_txval =    0,
   .base.atr_rxval =    0,

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_dbsrx.c
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_dbsrx.c   
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_dbsrx.c   
2009-02-04 17:55:12 UTC (rev 10384)
@@ -80,7 +80,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = false,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = db_dbsrx_init,
   .base.set_freq = db_dbsrx_set_freq,
   .base.set_gain = db_dbsrx_set_gain,


Property changes on: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_dbsrx.c
___________________________________________________________________
Name: svn:executable
   - *

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_init.c
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_init.c    
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_init.c    
2009-02-04 17:55:12 UTC (rev 10384)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -330,6 +330,12 @@
   }
 }
 
+bool
+db_set_lo_offset(struct db_base *db, u2_fxpt_freq_t offset)
+{
+  db->lo_offset = offset;
+  return true;
+}
 
 bool
 db_tune(struct db_base *db, u2_fxpt_freq_t target_freq, struct tune_result 
*result)
@@ -339,8 +345,8 @@
   u2_fxpt_freq_t dxc_freq;
   u2_fxpt_freq_t actual_dxc_freq;
 
-  // Ask the d'board to tune as closely as it can to target_freq
-  bool ok = db->set_freq(db, target_freq, &result->baseband_freq);
+  // Ask the d'board to tune as closely as it can to target_freq+lo_offset
+  bool ok = db->set_freq(db, target_freq+db->lo_offset, 
&result->baseband_freq);
 
   // Calculate the DDC setting that will downconvert the baseband from the
   // daughterboard to our target frequency.

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_rfx.c
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_rfx.c     
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_rfx.c     
2009-02-04 17:55:12 UTC (rev 10384)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -73,7 +73,6 @@
   unsigned char CP2;
   int freq_mult;
   int spi_mask;  
-  u2_fxpt_freq_t freq_offset;
 };
 
 struct db_rfx_dummy {
@@ -149,7 +148,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = rfx_init_rx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_rx,
@@ -163,8 +162,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_RX_DB,
-  .common.freq_mult = 2,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(0)
+  .common.freq_mult = 2
 };
 
 
@@ -181,7 +179,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6),
   .base.init = rfx_init_tx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_tx,
@@ -195,8 +193,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_TX_DB,
-  .common.freq_mult = 2,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6)
+  .common.freq_mult = 2
 };
 
 struct db_rfx_900_rx db_rfx_900_rx = {
@@ -212,7 +209,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = rfx_init_rx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_rx,
@@ -226,8 +223,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_RX_DB,
-  .common.freq_mult = 2,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(0)
+  .common.freq_mult = 2
 };
 
 
@@ -244,7 +240,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6),
   .base.init = rfx_init_tx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_tx,
@@ -258,8 +254,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_TX_DB,
-  .common.freq_mult = 2,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6)
+  .common.freq_mult = 2
 };
 
 struct db_rfx_1200_rx db_rfx_1200_rx = {
@@ -275,7 +270,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = rfx_init_rx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_rx,
@@ -289,8 +284,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_RX_DB,
-  .common.freq_mult = 2,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(0)
+  .common.freq_mult = 2
 };
 
 
@@ -307,7 +301,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6),
   .base.init = rfx_init_tx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_tx,
@@ -321,8 +315,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_TX_DB,
-  .common.freq_mult = 2,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6)
+  .common.freq_mult = 2
 };
 
 struct db_rfx_1800_rx db_rfx_1800_rx = {
@@ -338,7 +331,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = rfx_init_rx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_rx,
@@ -352,8 +345,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_RX_DB,
-  .common.freq_mult = 1,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(0)
+  .common.freq_mult = 1
 };
 
 
@@ -370,7 +362,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6),
   .base.init = rfx_init_tx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_tx,
@@ -384,8 +376,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_TX_DB,
-  .common.freq_mult = 1,  
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6)
+  .common.freq_mult = 1  
 };
 
 
@@ -402,7 +393,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = rfx_init_rx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_rx,
@@ -416,8 +407,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_RX_DB,
-  .common.freq_mult = 1,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(0)
+  .common.freq_mult = 1
 };
 
 
@@ -434,7 +424,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6),
   .base.init = rfx_init_tx,
   .base.set_freq = rfx_set_freq,
   .base.set_gain = rfx_set_gain_tx,
@@ -448,8 +438,7 @@
   .common.CP1 = 7,
   .common.CP2 = 7,
   .common.spi_mask = SPI_SS_TX_DB,
-  .common.freq_mult = 1,
-  .common.freq_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6)
+  .common.freq_mult = 1
 };
 
 
@@ -488,7 +477,7 @@
 
   *dc = 0;
   struct db_rfx_dummy *db = (struct db_rfx_dummy *) dbb;
-  u2_fxpt_freq_t desired_n = 
(U2_DOUBLE_TO_FXPT_FREQ(1.0)*db->common.freq_mult*(freq+db->common.freq_offset))/phdet_freq;
+  u2_fxpt_freq_t desired_n = 
(U2_DOUBLE_TO_FXPT_FREQ(1.0)*db->common.freq_mult*freq)/phdet_freq;
   int N_DIV = u2_fxpt_freq_round_to_int(desired_n);
   int B = N_DIV/PRESCALER;
   int A = N_DIV - PRESCALER*B;

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_tvrx.c
===================================================================
--- gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_tvrx.c    
2009-02-04 15:55:32 UTC (rev 10383)
+++ gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_tvrx.c    
2009-02-04 17:55:12 UTC (rev 10384)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -88,7 +88,7 @@
   .base.is_quadrature = false,
   .base.i_and_q_swapped = false,
   .base.spectrum_inverted = false,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = tvrx_init,
   .base.set_freq = tvrx_set_freq,
   .base.set_gain = tvrx_set_gain,
@@ -115,7 +115,7 @@
   .base.is_quadrature = false,
   .base.i_and_q_swapped = false,
   .base.spectrum_inverted = true,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = tvrx_init,
   .base.set_freq = tvrx_set_freq,
   .base.set_gain = tvrx_set_gain,
@@ -142,7 +142,7 @@
   .base.is_quadrature = false,
   .base.i_and_q_swapped = false,
   .base.spectrum_inverted = true,
-  //.base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(4e6),
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = tvrx_init,
   .base.set_freq = tvrx_set_freq,
   .base.set_gain = tvrx_set_gain,

Modified: 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_xcvr2450.c
===================================================================
--- 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_xcvr2450.c    
    2009-02-04 15:55:32 UTC (rev 10383)
+++ 
gnuradio/branches/developers/jcorgan/u2-wip/usrp2/firmware/lib/db_xcvr2450.c    
    2009-02-04 17:55:12 UTC (rev 10384)
@@ -107,6 +107,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = false,
   .base.spectrum_inverted = false,
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = xcvr2450_init,
   .base.set_freq = xcvr2450_set_freq,
   .base.set_gain = xcvr2450_set_gain_rx,
@@ -128,6 +129,7 @@
   .base.is_quadrature = true,
   .base.i_and_q_swapped = true,
   .base.spectrum_inverted = false,
+  .base.lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
   .base.init = xcvr2450_init,
   .base.set_freq = xcvr2450_set_freq,
   .base.set_gain = xcvr2450_set_gain_tx,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]