diff options
author | jcorgan | 2007-07-20 19:35:08 +0000 |
---|---|---|
committer | jcorgan | 2007-07-20 19:35:08 +0000 |
commit | e67e6ad3539b8b847a4c011e23d5722c7a74f473 (patch) | |
tree | bc7c74f12349f773f76c13d81ea740e6131e3cc5 /gr-usrp | |
parent | 08b4782777eccd8913ac9dbd7b15508229db034e (diff) | |
download | gnuradio-e67e6ad3539b8b847a4c011e23d5722c7a74f473.tar.gz gnuradio-e67e6ad3539b8b847a4c011e23d5722c7a74f473.tar.bz2 gnuradio-e67e6ad3539b8b847a4c011e23d5722c7a74f473.zip |
Reworked LO offset handling.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6038 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-usrp')
-rw-r--r-- | gr-usrp/src/db_base.py | 16 | ||||
-rw-r--r-- | gr-usrp/src/db_flexrf.py | 58 |
2 files changed, 35 insertions, 39 deletions
diff --git a/gr-usrp/src/db_base.py b/gr-usrp/src/db_base.py index 815a97c29..bcbec40b9 100644 --- a/gr-usrp/src/db_base.py +++ b/gr-usrp/src/db_base.py @@ -53,7 +53,6 @@ class db_base(object): self._refclk_reg = (FR_TX_A_REFCLK,FR_RX_A_REFCLK,FR_TX_B_REFCLK,FR_RX_B_REFCLK)[self._slot] - def dbid(self): return self._u.daughterboard_id(self._which) @@ -240,3 +239,18 @@ class db_base(object): """ pass + def set_lo_offset(self, offset): + """ + Set how much LO is offset from requested frequency + + Should be overriden by daughterboards that care. + """ + pass + + def lo_offset(self, offset): + """ + Get how much LO is offset from requested frequency + + Should be overriden by daughterboards that care. + """ + return 0.0 diff --git a/gr-usrp/src/db_flexrf.py b/gr-usrp/src/db_flexrf.py index 045bc39bd..1591cf944 100644 --- a/gr-usrp/src/db_flexrf.py +++ b/gr-usrp/src/db_flexrf.py @@ -1,5 +1,5 @@ # -# Copyright 2005 Free Software Foundation, Inc. +# Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -169,7 +169,7 @@ class flexrf_base(db_base.db_base): # FPGA's DC removal loop's time constant. We were seeing a # problem when running with discontinuous transmission. # Offsetting the LO made the problem go away. - freq += self.lo_offset + freq += self._lo_offset R, control, N, actual_freq = self._compute_regs(freq) if R==0: @@ -211,6 +211,22 @@ class flexrf_base(db_base.db_base): """ return True + 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 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_tx(flexrf_base): @@ -225,7 +241,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 + self.set_lo_offset(4e6) def __del__(self): #print "flexrf_base_tx.__del__" @@ -275,22 +291,6 @@ 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): """ @@ -307,8 +307,7 @@ class flexrf_base_rx(flexrf_base): self.select_rx_antenna('TX/RX') self.bypass_adc_buffers(True) - - self.lo_offset = -4e6 + self.set_lo_offset(-4e6) def __del__(self): # print "flexrf_base_rx.__del__" @@ -361,23 +360,6 @@ 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 - - # ---------------------------------------------------------------- class _AD4360_common(object): |