commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10202 - gnuradio/trunk/usrp/host/lib/legacy


From: jcorgan
Subject: [Commit-gnuradio] r10202 - gnuradio/trunk/usrp/host/lib/legacy
Date: Thu, 8 Jan 2009 19:33:11 -0700 (MST)

Author: jcorgan
Date: 2009-01-08 19:33:04 -0700 (Thu, 08 Jan 2009)
New Revision: 10202

Modified:
   gnuradio/trunk/usrp/host/lib/legacy/db_xcvr2450.cc
Log:
More XCVR2450 fixes.

Modified: gnuradio/trunk/usrp/host/lib/legacy/db_xcvr2450.cc
===================================================================
--- gnuradio/trunk/usrp/host/lib/legacy/db_xcvr2450.cc  2009-01-08 23:50:42 UTC 
(rev 10201)
+++ gnuradio/trunk/usrp/host/lib/legacy/db_xcvr2450.cc  2009-01-09 02:33:04 UTC 
(rev 10202)
@@ -95,6 +95,7 @@
   tx_set_atr_txval(TX_SAFE_IO);
   tx_set_atr_rxval(TX_SAFE_IO);
   tx_set_atr_mask(TX_OE_MASK);
+
   rx_write_io(RX_SAFE_IO, RX_OE_MASK);
   rx_write_oe(RX_OE_MASK, ~0);
   rx_set_atr_rxval(RX_SAFE_IO);
@@ -273,9 +274,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_OE_2;
+  else
     reg = FR_OE_0;
-  else
-    reg = FR_OE_2;
   return usrp()->_write_fpga_reg(reg, (mask << 16) | value);
 }
    
@@ -284,9 +285,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_IO_2;
+  else
     reg = FR_IO_0;
-  else
-    reg = FR_IO_2;
   return usrp()->_write_fpga_reg(reg, (mask << 16) | value);
 }
 
@@ -295,9 +296,9 @@
 {
   int val;
   if(d_which)
+    val = FR_RB_IO_RX_B_IO_TX_B;
+  else
     val = FR_RB_IO_RX_A_IO_TX_A;
-  else
-    val = FR_RB_IO_RX_B_IO_TX_B;
   int t = usrp()->_read_fpga_reg(val);
   return t & 0xffff;
 }
@@ -307,9 +308,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_OE_3;
+  else
     reg = FR_OE_1;
-  else
-    reg = FR_OE_3;
   return usrp()->_write_fpga_reg(reg, (mask << 16) | value);
 }
 
@@ -318,9 +319,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_IO_3;
+  else
     reg = FR_IO_1;
-  else
-    reg = FR_IO_3;
   return usrp()->_write_fpga_reg(reg, (mask << 16) | value);
 }
 
@@ -329,9 +330,9 @@
 {
   int val;
   if(d_which)
+    val = FR_RB_IO_RX_B_IO_TX_B;
+  else
     val = FR_RB_IO_RX_A_IO_TX_A;
-  else
-    val = FR_RB_IO_RX_B_IO_TX_B;
   int t = usrp()->_read_fpga_reg(val);
   return (t >> 16) & 0xffff;
 }
@@ -341,9 +342,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_ATR_MASK_2;
+  else
     reg = FR_ATR_MASK_0;
-  else
-    reg = FR_ATR_MASK_2;
   return usrp()->_write_fpga_reg(reg, v);
 }
 
@@ -352,9 +353,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_ATR_TXVAL_2;
+  else
     reg = FR_ATR_TXVAL_0;
-  else
-    reg = FR_ATR_TXVAL_2;
   return usrp()->_write_fpga_reg(reg, v);
 }
 
@@ -363,9 +364,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_ATR_RXVAL_2;
+  else
     reg = FR_ATR_RXVAL_0;
-  else
-    reg = FR_ATR_RXVAL_2;
   return usrp()->_write_fpga_reg(reg, v);
 }
 
@@ -374,9 +375,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_ATR_MASK_3;
+  else
     reg = FR_ATR_MASK_1;
-  else
-    reg = FR_ATR_MASK_3;
   return usrp()->_write_fpga_reg(reg, v);
 }
 
@@ -385,9 +386,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_ATR_TXVAL_3;
+  else
     reg = FR_ATR_TXVAL_1;
-  else
-    reg = FR_ATR_TXVAL_3;
   return usrp()->_write_fpga_reg(reg, v);
 }
 
@@ -396,9 +397,9 @@
 {
   int reg;
   if(d_which)
+    reg = FR_ATR_RXVAL_3;
+  else
     reg = FR_ATR_RXVAL_1;
-  else
-    reg = FR_ATR_RXVAL_3;
   return usrp()->_write_fpga_reg(reg, v);
 }
 
@@ -418,24 +419,24 @@
   
   int rx_hp, tx_antsel, rx_antsel, tx_pa_sel;
   if(d_rx_hp_pin)
+    rx_hp = RX_HP;
+  else
     rx_hp = 0;
-  else
-    rx_hp = RX_HP;
   
   if(d_tx_ant)
+    tx_antsel = ANTSEL_TX2_RX1;
+  else
     tx_antsel = ANTSEL_TX1_RX2;
-  else
-    tx_antsel = ANTSEL_TX2_RX1;
 
   if(d_rx_ant)
+    rx_antsel = ANTSEL_TX2_RX1;
+  else
     rx_antsel = ANTSEL_TX1_RX2;
-  else
-    rx_antsel = ANTSEL_TX2_RX1;
 
   if(d_five_gig)
+    tx_pa_sel = LB_PA_OFF;
+  else
     tx_pa_sel = HB_PA_OFF;
-  else
-    tx_pa_sel = LB_PA_OFF;
 
   int io_rx_while_rx = EN|rx_hp|RX_EN;
   int io_rx_while_tx = EN|rx_hp;
@@ -446,8 +447,8 @@
   tx_set_atr_rxval(io_tx_while_rx);
   tx_set_atr_txval(io_tx_while_tx);
         
-  //printf("GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X",
-  //  io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx);
+  //printf("GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X\n",
+  //       io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx);
 }
   
 
@@ -488,7 +489,7 @@
   d_frac_div = int((div-d_int_div)*65536.0);
   double actual_freq = phdet_freq*(d_int_div+(d_frac_div/65536.0))/scaler;
   
-  //printf("RF=%f VCO=%f R=%d PHD=%f DIV=%3.5f I=%3d F=%5d ACT=%f",
+  //printf("RF=%f VCO=%f R=%d PHD=%f DIV=%3.5f I=%3d F=%5d ACT=%f\n",
   //    target_freq, vco_freq, d_ref_div, phdet_freq,
   //    div, d_int_div, d_frac_div, actual_freq);
 
@@ -505,16 +506,16 @@
       d_highband = 0;
       set_reg_bandselpll();
       args.ok = lock_detect();
-      printf("swap to 0 at %f, ok %d\n", target_freq, args.ok);
+      //printf("swap to 0 at %f, ok %d\n", target_freq, args.ok);
     }
     if((target_freq >= 5.25e9) && (target_freq <= 5.275e9)) {
       d_highband = 1;
       set_reg_bandselpll();
       args.ok = lock_detect();
-      printf("swap to 1 at %f, ok %d\n", target_freq, args.ok);
+      //printf("swap to 1 at %f, ok %d\n", target_freq, args.ok);
     }
     if(!args.ok){
-      printf("Fail %f\n", target_freq);
+      //printf("Fail %f\n", target_freq);
     }
   }
   return args;
@@ -601,14 +602,14 @@
 
   for(itr = _xcvr2450_inst.begin(); itr != _xcvr2450_inst.end(); itr++) {
     if(*(*itr) == key) {
-      printf("Using existing xcvr2450 instance\n");
+      //printf("Using existing xcvr2450 instance\n");
       inst = *itr;
       break;
     }
   }
   
   if(itr == _xcvr2450_inst.end()) {
-    printf("Creating new xcvr2450 instance\n");
+    //printf("Creating new xcvr2450 instance\n");
     inst = xcvr2450_sptr(new xcvr2450(usrp, which));
     _xcvr2450_inst.push_back(inst);
   }
@@ -681,7 +682,7 @@
 db_xcvr2450_tx::db_xcvr2450_tx(usrp_basic_sptr usrp, int which)
   : db_xcvr2450_base(usrp, which)
 {
-  printf("db_xcvr2450_tx::db_xcvr2450_tx\n");
+  //printf("db_xcvr2450_tx::db_xcvr2450_tx\n");
 }
 
 db_xcvr2450_tx::~db_xcvr2450_tx()
@@ -730,7 +731,7 @@
    * @param which: 0 or 1 corresponding to side RX_A or RX_B respectively.
    */
   
-  printf("db_xcvr2450_rx:d_xcvr_2450_rx\n");
+  //printf("db_xcvr2450_rx:d_xcvr_2450_rx\n");
 }
 
 db_xcvr2450_rx::~db_xcvr2450_rx()





reply via email to

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