commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11517 - in gnuradio/branches/developers/eb/vrt: gr-ut


From: jblum
Subject: [Commit-gnuradio] r11517 - in gnuradio/branches/developers/eb/vrt: gr-utils/src/python gr-vrt/src vrt/include/vrt vrt/lib
Date: Wed, 29 Jul 2009 19:55:04 -0600 (MDT)

Author: jblum
Date: 2009-07-29 19:55:03 -0600 (Wed, 29 Jul 2009)
New Revision: 11517

Modified:
   gnuradio/branches/developers/eb/vrt/gr-utils/src/python/qr_fft.py
   gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc
   gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h
   gnuradio/branches/developers/eb/vrt/vrt/include/vrt/quadradio.h
   gnuradio/branches/developers/eb/vrt/vrt/lib/quadradio.cc
Log:
added methods to set cal and lo freq

Modified: gnuradio/branches/developers/eb/vrt/gr-utils/src/python/qr_fft.py
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-utils/src/python/qr_fft.py   
2009-07-29 22:23:41 UTC (rev 11516)
+++ gnuradio/branches/developers/eb/vrt/gr-utils/src/python/qr_fft.py   
2009-07-30 01:55:03 UTC (rev 11517)
@@ -31,6 +31,7 @@
 import wx
 import sys
 import numpy
+import time
 
 class app_top_block(stdgui2.std_top_block, pubsub.pubsub):
     def __init__(self, frame, panel, vbox, argv):
@@ -203,6 +204,9 @@
         hbox.Add((5,0), 0)
         vbox.Add(hbox, 0, wx.EXPAND)
         ##### db control stuff #####
+        self.subscribe('cal_div_lo_freq', lambda x: self.u.set_lo_freq(x) and 
time.sleep(0.01))
+        self.subscribe('cal_div_lo_freq', self.u.set_center_freq) #TODO should 
be combined with set lo freq
+        self.subscribe('cal_div_cal_freq', lambda x: self.u.set_cal_freq(x) 
and time.sleep(0.01))
         self.subscribe('db_ctrl_atten0', self.u.set_attenuation0)
         self.subscribe('db_ctrl_atten1', self.u.set_attenuation1)
         #self.subscribe('db_ctrl_10db', self.u.set_10dB_atten)
@@ -212,15 +216,45 @@
         self.subscribe('db_ctrl_bandsel', self.u.set_band_select)
         self.subscribe('db_ctrl_type', self.u.select_rx_antenna)
         self.subscribe('db_test_signal', self.u.set_test_signal)
+        self['db_ctrl_bandsel'] = 'A'
+        self['cal_div_lo_freq'] = 2.1e9
+        self['cal_div_cal_freq'] = 2.102e9
         self['db_ctrl_atten0'] = 0
         self['db_ctrl_atten1'] = 0
         #self['db_ctrl_10db'] = False
         self['db_ctrl_adcgain'] = False
         self['db_ctrl_dcoffset'] = False
         self['db_ctrl_diggain'] = 0.0
-        self['db_ctrl_bandsel'] = 'A'
         self['db_ctrl_type'] = 'rf'
         self['db_test_signal'] = vrt.VRT_TEST_SIG_NORMAL
+        #slider and box for freqs
+        for key, name in (('cal_div_lo_freq', 'LO Freq'), ('cal_div_cal_freq', 
'Cal Freq')):
+            hbox = wx.BoxSizer(wx.HORIZONTAL)
+            hbox.AddSpacer(10)
+            forms.text_box(
+                label=name,
+                ps=self,
+                key=key,
+                sizer=hbox,
+                parent=panel,
+                proportion=0,
+                converter=forms.float_converter()
+            )
+            hbox.AddSpacer(20)
+            forms.slider(
+                ps=self,
+                key=key,
+                minimum=0,   #TODO get bounds from cal_div, from vrt...
+                maximum=int(3.5e9),
+                step_size=int(5e6),
+                cast=float,
+                sizer=hbox,
+                parent=panel,
+                proportion=2,
+            )
+            hbox.AddSpacer(10)
+            vbox.Add(hbox, 0, wx.EXPAND)
+        ############################################
         hbox = wx.BoxSizer(wx.HORIZONTAL)
         hbox.AddSpacer(10)
         #create slider for atten

Modified: 
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc 
2009-07-29 22:23:41 UTC (rev 11516)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.cc 
2009-07-30 01:55:03 UTC (rev 11517)
@@ -158,6 +158,18 @@
   return d_qr->set_mem32(addr, value);
 }
 
+bool
+vrt_quadradio_source_32fc::set_lo_freq(double freq)
+{
+  return d_qr->set_lo_freq(freq);
+}
+
+bool
+vrt_quadradio_source_32fc::set_cal_freq(double freq)
+{
+  return d_qr->set_cal_freq(freq);
+}
+
 /*--------------------------------------------------------------------*/
 #define IQ_IMBAL_NUM_TAPS 30
 #define IQ_IMBAL_REG_NO 162

Modified: 
gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h
===================================================================
--- gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h  
2009-07-29 22:23:41 UTC (rev 11516)
+++ gnuradio/branches/developers/eb/vrt/gr-vrt/src/vrt_quadradio_source_32fc.h  
2009-07-30 01:55:03 UTC (rev 11517)
@@ -106,6 +106,8 @@
   bool set_hsadc_conf(int which_dboard, int regno, int value);
   bool set_lsdac(int which_dboard, int which_dac, int value);
   bool set_mem32(int addr, int value);
+  bool set_lo_freq(double freq);
+  bool set_cal_freq(double freq);
 };
 
 

Modified: gnuradio/branches/developers/eb/vrt/vrt/include/vrt/quadradio.h
===================================================================
--- gnuradio/branches/developers/eb/vrt/vrt/include/vrt/quadradio.h     
2009-07-29 22:23:41 UTC (rev 11516)
+++ gnuradio/branches/developers/eb/vrt/vrt/include/vrt/quadradio.h     
2009-07-30 01:55:03 UTC (rev 11517)
@@ -109,6 +109,8 @@
     bool set_hsadc_conf(int which_dboard, int regno, int value);
     bool set_lsdac(int which_dboard, int which_dac, int value);
     bool set_mem32(int addr, int value);       // poke a 32-bit value
+    bool set_lo_freq(double freq);
+    bool set_cal_freq(double freq);
 
   };
 

Modified: gnuradio/branches/developers/eb/vrt/vrt/lib/quadradio.cc
===================================================================
--- gnuradio/branches/developers/eb/vrt/vrt/lib/quadradio.cc    2009-07-29 
22:23:41 UTC (rev 11516)
+++ gnuradio/branches/developers/eb/vrt/vrt/lib/quadradio.cc    2009-07-30 
01:55:03 UTC (rev 11517)
@@ -372,3 +372,29 @@
 
   return send_and_check(d_ctrl_fd, cmd, sizeof(cmd));
 }
+
+bool
+vrt::quadradio::set_lo_freq(double freq)
+{
+  uint64_t lo_freq = uint64_t(freq * (uint64_t(1)<<20)); //q20 format
+  uint32_t cmd[4];
+  cmd[0] = htonl(0);              // verb: set
+  cmd[1] = htonl(6);              // id: lo freq
+  cmd[2] = htonl((lo_freq >> 32) & 0xffffffff);
+  cmd[3] = htonl((lo_freq >> 0) & 0xffffffff);
+
+  return send_and_check(d_ctrl_fd, cmd, sizeof(cmd));
+}
+
+bool
+vrt::quadradio::set_cal_freq(double freq)
+{
+  uint64_t cal_freq = uint64_t(freq * (uint64_t(1)<<20)); //q20 format
+  uint32_t cmd[4];
+  cmd[0] = htonl(0);              // verb: set
+  cmd[1] = htonl(7);              // id: cal freq
+  cmd[2] = htonl((cal_freq >> 32) & 0xffffffff);
+  cmd[3] = htonl((cal_freq >> 0) & 0xffffffff);
+
+  return send_and_check(d_ctrl_fd, cmd, sizeof(cmd));
+}





reply via email to

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