[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6038 - gnuradio/trunk/gr-usrp/src
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r6038 - gnuradio/trunk/gr-usrp/src |
Date: |
Fri, 20 Jul 2007 13:35:09 -0600 (MDT) |
Author: jcorgan
Date: 2007-07-20 13:35:08 -0600 (Fri, 20 Jul 2007)
New Revision: 6038
Modified:
gnuradio/trunk/gr-usrp/src/db_base.py
gnuradio/trunk/gr-usrp/src/db_flexrf.py
Log:
Reworked LO offset handling.
Modified: gnuradio/trunk/gr-usrp/src/db_base.py
===================================================================
--- gnuradio/trunk/gr-usrp/src/db_base.py 2007-07-20 00:08:22 UTC (rev
6037)
+++ gnuradio/trunk/gr-usrp/src/db_base.py 2007-07-20 19:35:08 UTC (rev
6038)
@@ -53,7 +53,6 @@
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 @@
"""
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
Modified: gnuradio/trunk/gr-usrp/src/db_flexrf.py
===================================================================
--- gnuradio/trunk/gr-usrp/src/db_flexrf.py 2007-07-20 00:08:22 UTC (rev
6037)
+++ gnuradio/trunk/gr-usrp/src/db_flexrf.py 2007-07-20 19:35:08 UTC (rev
6038)
@@ -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 @@
# 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 @@
"""
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 @@
# 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 @@
"""
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,9 +307,8 @@
self.select_rx_antenna('TX/RX')
self.bypass_adc_buffers(True)
+ self.set_lo_offset(-4e6)
- self.lo_offset = -4e6
-
def __del__(self):
# print "flexrf_base_rx.__del__"
# Power down
@@ -361,23 +360,6 @@
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):
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6038 - gnuradio/trunk/gr-usrp/src,
jcorgan <=