summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/apps/hf_radio/input.py
diff options
context:
space:
mode:
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>2006-08-03 04:51:51 +0000
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>2006-08-03 04:51:51 +0000
commit5d69a524f81f234b3fbc41d49ba18d6f6886baba (patch)
treeb71312bf7f1e8d10fef0f3ac6f28784065e73e72 /gnuradio-examples/python/apps/hf_radio/input.py
Houston, we have a trunk.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3122 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/apps/hf_radio/input.py')
-rw-r--r--gnuradio-examples/python/apps/hf_radio/input.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnuradio-examples/python/apps/hf_radio/input.py b/gnuradio-examples/python/apps/hf_radio/input.py
new file mode 100644
index 0000000000..3a62a68cc7
--- /dev/null
+++ b/gnuradio-examples/python/apps/hf_radio/input.py
@@ -0,0 +1,41 @@
+# Basic USRP setup and control.
+# It's only ever been tried with a basic rx daughter card.
+#
+# Imagine that the gnuradio boilerplate is here.
+#
+# M. Revnell 2005-Dec
+
+from gnuradio import gr, gru, optfir
+from gnuradio import usrp
+import usrp_dbid
+import math
+
+# Put special knowlege of usrp here.
+
+class input:
+ def __init__( self, decim ):
+ self.freq = -2.5e6
+ self.src = usrp.source_c( )
+ self.subdev = usrp.pick_subdev( self.src,
+ (usrp_dbid.BASIC_RX,
+ usrp_dbid.TV_RX))
+
+ print self.subdev
+
+ self.subdevice = usrp.selected_subdev( self.src,
+ self.subdev )
+
+ self.mux = usrp.determine_rx_mux_value( self.src,
+ self.subdev )
+ self.decim = decim
+
+ self.adc_rate = self.src.adc_rate()
+ self.usrp_rate = self.adc_rate / self.decim
+ self.src.set_decim_rate( self.decim )
+ self.src.set_mux( self.mux )
+ usrp.tune( self.src, 0, self.subdevice, self.freq )
+
+ def set_freq( self, x ):
+ r = usrp.tune( self.src, 0, self.subdevice, -x )
+ if r:
+ self.freq = -x