3 * Copyright 2003 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
24 * SWIG interface defs for Microtune 4937 and eval board with Eric's daughterboard
28 * \brief abstract class for controlling microtune 4937 tuner module
30 class microtune_4937 {
34 virtual ~microtune_4937 ();
36 // returns actual freq or 0 if error (easier interface for SWIG)
37 double set_RF_freq (double freq);
40 * \returns true iff PLL is locked
45 * \returns the output frequency (IF center freq) of the tuner in Hz.
47 double get_output_freq ();
51 //! \returns true iff successful
52 virtual bool i2c_write (int addr, const unsigned char *buf, int nbytes) = 0;
54 //! \returns number of bytes read or -1 if error
55 virtual int i2c_read (int addr, unsigned char *buf, int max_bytes) = 0;
57 int d_reference_divider;
58 bool d_fast_tuning_p; /* if set, higher charge pump current:
59 faster tuning, worse phase noise
60 for distance < 10kHz to the carrier */
64 * \brief concrete class for controlling microtune 4937 eval board attached to parallel port
66 class microtune_eval_board : public microtune_4937 {
68 microtune_eval_board (int which_pp = 0);
69 ~microtune_eval_board ();
71 //! is the eval board present?
72 bool board_present_p ();
75 * \brief set RF and IF AGC control voltages ([0, 5] volts)
77 void set_RF_AGC_voltage (float volts);
78 void set_IF_AGC_voltage (float volts);
81 * \brief set RF and IF AGC levels together (scale [0, 1000])
83 * This provides a simple linear interface for adjusting both
84 * the RF and IF gain in consort. This is the easy to use interface.
85 * 0 corresponds to minimum gain. 1000 corresponds to maximum gain.
87 void set_AGC (float value_0_1000);
90 //! \returns true iff successful
91 virtual bool i2c_write (int addr, const unsigned char *buf, int nbytes);
93 //! \returns number of bytes read or -1 if error
94 virtual int i2c_read (int addr, unsigned char *buf, int max_bytes);