commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9819 - in gnuradio/trunk/usrp2/host: include/usrp2 li


From: eb
Subject: [Commit-gnuradio] r9819 - in gnuradio/trunk/usrp2/host: include/usrp2 lib
Date: Wed, 22 Oct 2008 10:18:43 -0600 (MDT)

Author: eb
Date: 2008-10-22 10:18:41 -0600 (Wed, 22 Oct 2008)
New Revision: 9819

Modified:
   gnuradio/trunk/usrp2/host/include/usrp2/usrp2.h
   gnuradio/trunk/usrp2/host/lib/usrp2_impl.cc
   gnuradio/trunk/usrp2/host/lib/usrp2_impl.h
Log:
added rx_decim and tx_interp accessors

Modified: gnuradio/trunk/usrp2/host/include/usrp2/usrp2.h
===================================================================
--- gnuradio/trunk/usrp2/host/include/usrp2/usrp2.h     2008-10-22 14:35:54 UTC 
(rev 9818)
+++ gnuradio/trunk/usrp2/host/include/usrp2/usrp2.h     2008-10-22 16:18:41 UTC 
(rev 9819)
@@ -132,6 +132,9 @@
      */
     bool set_rx_decim(int decimation_factor);
 
+    //! Return current decimation factor
+    int rx_decim();
+
     /*!
      * Set receiver IQ magnitude scaling
      */
@@ -214,6 +217,9 @@
      */
     bool set_tx_interp(int interpolation_factor);
 
+    //! Return current interpolation factor
+    int tx_interp();
+
     /*!
      * Set transmit IQ magnitude scaling
      */

Modified: gnuradio/trunk/usrp2/host/lib/usrp2_impl.cc
===================================================================
--- gnuradio/trunk/usrp2/host/lib/usrp2_impl.cc 2008-10-22 14:35:54 UTC (rev 
9818)
+++ gnuradio/trunk/usrp2/host/lib/usrp2_impl.cc 2008-10-22 16:18:41 UTC (rev 
9819)
@@ -130,7 +130,7 @@
       d_rx_seqno(-1), d_tx_seqno(0), d_next_rid(0),
       d_num_rx_frames(0), d_num_rx_missing(0), d_num_rx_overruns(0), 
d_num_rx_bytes(0), 
       d_num_enqueued(0), d_enqueued_mutex(), 
d_bg_pending_cond(&d_enqueued_mutex),
-      d_channel_rings(NCHANS)
+      d_channel_rings(NCHANS), d_tx_interp(0), d_rx_decim(0)
   {
     if (!d_eth_buf->open(ifc, htons(U2_ETHERTYPE)))
       throw std::runtime_error("Unable to register USRP2 protocol");
@@ -179,6 +179,13 @@
     if (!set_rx_gain((rx_gain_min() + rx_gain_max()) / 2))
       std::cerr << "usrp2::ctor set_rx_gain failed\n";
 
+    // default interp and decim
+    if (!set_tx_interp(12))
+      std::cerr << "usrp2::ctor set_tx_interp failed\n";
+
+    if (!set_rx_decim(12))
+      std::cerr << "usrp2::ctor set_rx_decim failed\n";
+      
     // set workable defaults for scaling
     if (!set_rx_scale_iq(DEFAULT_RX_SCALE, DEFAULT_RX_SCALE))
       std::cerr << "usrp2::ctor set_rx_scale_iq failed\n";
@@ -524,6 +531,8 @@
       return false;
 
     bool success = (ntohx(reply.ok) == 1);
+    if (success)
+      d_rx_decim = decimation_factor;
     return success;
   }
   
@@ -761,6 +770,8 @@
       return false;
 
     bool success = (ntohx(reply.ok) == 1);
+    if (success)
+      d_tx_interp = interpolation_factor;
     return success;
   }
   

Modified: gnuradio/trunk/usrp2/host/lib/usrp2_impl.h
===================================================================
--- gnuradio/trunk/usrp2/host/lib/usrp2_impl.h  2008-10-22 14:35:54 UTC (rev 
9818)
+++ gnuradio/trunk/usrp2/host/lib/usrp2_impl.h  2008-10-22 16:18:41 UTC (rev 
9819)
@@ -80,6 +80,8 @@
     db_info       d_tx_db_info;
     db_info       d_rx_db_info;
 
+    int                   d_tx_interp;         // shadow tx interp 
+    int                   d_rx_decim;          // shadow rx decim
 
     void inc_enqueued() {
       omni_mutex_lock l(d_enqueued_mutex);
@@ -123,6 +125,7 @@
     double rx_freq_min() { return d_rx_db_info.freq_min; }
     double rx_freq_max() { return d_rx_db_info.freq_max; }
     bool set_rx_decim(int decimation_factor);
+    int rx_decim() { return d_rx_decim; }
     bool set_rx_scale_iq(int scale_i, int scale_q);
     bool start_rx_streaming(unsigned int channel, unsigned int 
items_per_frame);
     bool rx_samples(unsigned int channel, rx_sample_handler *handler);
@@ -140,6 +143,7 @@
     double tx_freq_min() { return d_tx_db_info.freq_min; }
     double tx_freq_max() { return d_tx_db_info.freq_max; }
     bool set_tx_interp(int interpolation_factor);
+    int tx_interp() { return d_tx_interp; }
     bool set_tx_scale_iq(int scale_i, int scale_q);
 
     bool tx_32fc(unsigned int channel,





reply via email to

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