commit-gnuradio
[Top][All Lists]
Advanced

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

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


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

Author: gnychis
Date: 2009-01-15 22:56:39 -0700 (Thu, 15 Jan 2009)
New Revision: 10236

Modified:
   
gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband/usrp_usb_interface.cc
Log:
adding code to tune RX side

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 22:44:15 UTC (rev 10235)
+++ 
gnuradio/branches/developers/gnychis/inband_dboard/usrp/host/lib/inband/usrp_usb_interface.cc
       2009-01-16 05:56:39 UTC (rev 10236)
@@ -355,25 +355,38 @@
     d_cs->send(s_response_usrp_open, reply_data);
     return;
   }
-
-  if(!d_urx->set_rx_freq (0, -d_rf_freq) || !d_urx->set_rx_freq(1, 
-d_rf_freq)) {
-    if (verbose)
-      std::cout << "[usrp_server] Failed to set center frequency on RX\n";
-    reply_data = pmt_list2(invocation_handle, PMT_F);
-    d_cs->send(s_response_usrp_open, reply_data);
-    return;
-  }
   
-  // Two channels ... this really needs to end up being set correctly by
-  // querying for what dboards are connected
-  if(!d_urx->set_mux(0x32103210)) {
+  d_ub_rx = d_urx;
+  usrp_subdev_spec rspec = pick_rx_subdevice();
+  db_base_sptr rsubdev = d_ub_rx->selected_subdev(rspec);
+  printf("RX Subdevice name is %s\n", rsubdev->name().c_str());
+  printf("RX Subdevice freq range: (%g, %g)\n",
+     rsubdev->freq_min(), rsubdev->freq_max());
+  mux = d_urx->determine_rx_mux_value(rspec);
+  printf("mux: %#08x\n",  mux);
+  d_urx->set_mux(mux);
+  int rgain = rsubdev->gain_max();
+  rsubdev->set_gain(rgain);
+  input_rate = d_ub_rx->converter_rate() / d_urx->decim_rate();
+  printf("baseband rate: %g\n",  input_rate);
+  ok = d_urx->tune(rsubdev->which(), rsubdev, target_freq, &r);
+  rsubdev->set_enable(true);
+  
+  if(!ok) {
     if (verbose)
-      std::cout << "[USRP_USB_INTERFACE] Failed to set RX mux\n";
+      std::cout << "[USRP_USB_INTERFACE] Failed to set center frequency on 
RX\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);
+
   if (verbose)
     std::cout << "[USRP_USB_INTERFACE] Setup RX channel\n";
     





reply via email to

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