From 27669cfcdca0d56642cf5279d372fe149e7b1d26 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Thu, 19 Jul 2007 04:39:37 +0000 Subject: Merged r6015:6026 from jcorgan/radar. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6027 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-usrp/src/db_flexrf.py | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'gr-usrp/src') diff --git a/gr-usrp/src/db_flexrf.py b/gr-usrp/src/db_flexrf.py index 271b14728..045bc39bd 100644 --- a/gr-usrp/src/db_flexrf.py +++ b/gr-usrp/src/db_flexrf.py @@ -225,7 +225,7 @@ class flexrf_base_tx(flexrf_base): # power up the transmit side, but don't enable the mixer self._u._write_oe(self._which,(POWER_UP|RX_TXN|ENABLE), 0xffff) self._u.write_io(self._which, (self.power_on|RX_TXN), (POWER_UP|RX_TXN|ENABLE)) - self.lo_offset = 4e6 # FIXME may want to be a function of d'board + self.lo_offset = 4e6 def __del__(self): #print "flexrf_base_tx.__del__" @@ -275,7 +275,22 @@ class flexrf_base_tx(flexrf_base): """ return self._set_pga(self._u.pga_max()) - + def set_lo_offset(self, offset): + """ + Set amount by which LO is offset from requested tuning frequency. + + @param offset: offset in Hz + """ + self.lo_offset = offset + + def get_lo_offset(self): + """ + Get amount by which LO is offset from requested tuning frequency. + + @returns Offset in Hz + """ + return self.lo_offset + class flexrf_base_rx(flexrf_base): def __init__(self, usrp, which): """ @@ -293,7 +308,7 @@ class flexrf_base_rx(flexrf_base): self.bypass_adc_buffers(True) - self.lo_offset = -4e6 # FIXME may want to be a function of d'board + self.lo_offset = -4e6 def __del__(self): # print "flexrf_base_rx.__del__" @@ -346,6 +361,22 @@ class flexrf_base_rx(flexrf_base): return self._u.write_aux_dac(self._which, 0, int(dac_value)) and \ self._set_pga(int(pga_gain)) + def set_lo_offset(self, offset): + """ + Set amount by which LO is offset from requested tuning frequency. + + @param offset: offset in Hz + """ + self.lo_offset = offset + + def get_lo_offset(self): + """ + Get amount by which LO is offset from requested tuning frequency. + + @returns Offset in Hz + """ + return self.lo_offset + # ---------------------------------------------------------------- -- cgit