commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10235 - gnuradio/branches/developers/gnychis/inband_d


From: gnychis
Subject: [Commit-gnuradio] r10235 - gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband
Date: Thu, 15 Jan 2009 15:44:15 -0700 (MST)

Author: gnychis
Date: 2009-01-15 15:44:15 -0700 (Thu, 15 Jan 2009)
New Revision: 10235

Modified:
   
gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband/usrp_usb_interface.cc
Log:
TX tuning code present and compiles, but untested

Modified: 
gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband/usrp_usb_interface.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband/usrp_usb_interface.cc
       2009-01-15 21:49:29 UTC (rev 10234)
+++ 
gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband/usrp_usb_interface.cc
       2009-01-15 22:44:15 UTC (rev 10235)
@@ -291,8 +291,6 @@
                                 16,          // nblocks for async transfers
                                 d_rbf
                                 );
-
-  d_ub_tx = d_utx;
   
   if(d_utx==0) {
     if (verbose)
@@ -302,7 +300,25 @@
     return;
   }
 
-  if(!d_utx->set_tx_freq (0,d_rf_freq) || !d_utx->set_tx_freq(1,d_rf_freq)) {  
// try setting center freq to 0
+  d_ub_tx = d_utx;
+  usrp_subdev_spec tspec = pick_tx_subdevice();
+  db_base_sptr tsubdev = d_ub_tx->selected_subdev(tspec);
+  printf("TX Subdevice name is %s\n", tsubdev->name().c_str());
+  printf("TX Subdevice freq range: (%g, %g)\n",
+     tsubdev->freq_min(), tsubdev->freq_max());
+  unsigned int mux = d_utx->determine_tx_mux_value(tspec);
+  printf("mux: %#08x\n",  mux);
+  d_utx->set_mux(mux);
+  int tgain = tsubdev->gain_max();
+  tsubdev->set_gain(tgain);
+  float input_rate = d_ub_tx->converter_rate() / d_utx->interp_rate();
+  printf("baseband rate: %g\n",  input_rate);
+  usrp_tune_result r;
+  double target_freq = d_rf_freq;
+  bool ok = d_utx->tune(tsubdev->which(), tsubdev, target_freq, &r);
+  tsubdev->set_enable(true);
+
+  if(!ok) {
     if (verbose)
       std::cout << "[USRP_USB_INTERFACE] Failed to set center frequency on 
TX\n";
     reply_data = pmt_list2(invocation_handle, PMT_F);
@@ -310,15 +326,14 @@
     return;
   }
 
-  if(!d_utx->set_mux(0xBA98)) {
-    if (verbose)
-      std::cout << "[USRP_USB_INTERFACE] Failed to set TX mux\n";
-    reply_data = pmt_list2(invocation_handle, PMT_F);
-    d_cs->send(s_response_usrp_open, reply_data);
-    return;
-  }
+  printf("target_freq:     %f\n", target_freq);
+  printf("ok:              %s\n", ok ? "true" : "false");
+  printf("r.baseband_freq: %f\n", r.baseband_freq);
+  printf("r.dxc_freq:      %f\n", r.dxc_freq);
+  printf("r.residual_freq: %f\n", r.residual_freq);
+  printf("r.inverted:      %d\n", r.inverted);
 
-  d_utx->start();
+  //d_utx->start();
 
   if (verbose)
     std::cout << "[USRP_USB_INTERFACE] Setup TX channel\n";





reply via email to

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