commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11582 - in gnuradio/branches/developers/eb/vrt2: gr-u


From: jblum
Subject: [Commit-gnuradio] r11582 - in gnuradio/branches/developers/eb/vrt2: gr-utils/src/python gr-vrt/src vrt/include/vrt vrt/lib
Date: Tue, 11 Aug 2009 21:04:24 -0600 (MDT)

Author: jblum
Date: 2009-08-11 21:04:23 -0600 (Tue, 11 Aug 2009)
New Revision: 11582

Modified:
   gnuradio/branches/developers/eb/vrt2/gr-utils/src/python/qr_fft.py
   gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.cc
   gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.h
   gnuradio/branches/developers/eb/vrt2/vrt/include/vrt/quadradio.h
   gnuradio/branches/developers/eb/vrt2/vrt/lib/quadradio.cc
Log:
created set beamforming host functionality

Modified: gnuradio/branches/developers/eb/vrt2/gr-utils/src/python/qr_fft.py
===================================================================
--- gnuradio/branches/developers/eb/vrt2/gr-utils/src/python/qr_fft.py  
2009-08-12 01:18:44 UTC (rev 11581)
+++ gnuradio/branches/developers/eb/vrt2/gr-utils/src/python/qr_fft.py  
2009-08-12 03:04:23 UTC (rev 11582)
@@ -205,6 +205,7 @@
 
         hbox.Add((5,0), 0)
         vbox.Add(hbox, 0, wx.EXPAND)
+        self.u.set_beamforming([16.7e6, 0, 0, 0]);
         ##### 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

Modified: 
gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.cc
===================================================================
--- 
gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.cc    
    2009-08-12 01:18:44 UTC (rev 11581)
+++ 
gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.cc    
    2009-08-12 03:04:23 UTC (rev 11582)
@@ -199,3 +199,14 @@
       set_setting_reg(IQ_IMBAL_REG_NO, get_iq_imbal_reg(false, false, 
taps[IQ_IMBAL_NUM_TAPS-i-1].imag()));
   }
 }
+
+bool
+vrt_quadradio_source_32fc::set_beamforming(std::vector<gr_complex> gains){
+  int32_t gains_ints[8];
+  for (int i = 0; i < 4; i++){
+    gains_ints[2*i] = int32_t(gains[i].real());
+    gains_ints[2*i+1] = int32_t(gains[i].imag());
+  }
+ return d_qr->set_beamforming(gains_ints);
+}
+

Modified: 
gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.h
===================================================================
--- gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.h 
2009-08-12 01:18:44 UTC (rev 11581)
+++ gnuradio/branches/developers/eb/vrt2/gr-vrt/src/vrt_quadradio_source_32fc.h 
2009-08-12 03:04:23 UTC (rev 11582)
@@ -108,6 +108,7 @@
   bool set_mem32(int addr, int value);
   bool set_lo_freq(double freq);
   bool set_cal_freq(double freq);
+  bool set_beamforming(std::vector<gr_complex> gains);
 };
 
 

Modified: gnuradio/branches/developers/eb/vrt2/vrt/include/vrt/quadradio.h
===================================================================
--- gnuradio/branches/developers/eb/vrt2/vrt/include/vrt/quadradio.h    
2009-08-12 01:18:44 UTC (rev 11581)
+++ gnuradio/branches/developers/eb/vrt2/vrt/include/vrt/quadradio.h    
2009-08-12 03:04:23 UTC (rev 11582)
@@ -109,7 +109,7 @@
     bool set_mem32(int addr, int value);       // poke a 32-bit value
     bool set_lo_freq(double freq);
     bool set_cal_freq(double freq);
-
+    bool set_beamforming(int32_t gains[8]);
     /*
      * The first parameter for these is a bitmask which indicates which
      * daughterboard or daughterboards to apply the operation to.

Modified: gnuradio/branches/developers/eb/vrt2/vrt/lib/quadradio.cc
===================================================================
--- gnuradio/branches/developers/eb/vrt2/vrt/lib/quadradio.cc   2009-08-12 
01:18:44 UTC (rev 11581)
+++ gnuradio/branches/developers/eb/vrt2/vrt/lib/quadradio.cc   2009-08-12 
03:04:23 UTC (rev 11582)
@@ -393,3 +393,16 @@
 
   return send_and_check(d_ctrl_fd, cmd, sizeof(cmd));
 }
+
+bool
+vrt::quadradio::set_beamforming(int32_t gains[8]){
+  uint32_t cmd[2+8];
+  cmd[0] = htonl(0);              // verb: set
+  cmd[1] = htonl(8);              // id: beamformin
+  for (int i = 0; i < 8; i++){
+    //printf("%d\n", gains[i]);
+    cmd[i+2] = htonl(gains[i]); 
+  }
+  return send_and_check(d_ctrl_fd, cmd, sizeof(cmd));
+}
+





reply via email to

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