2 * Copyright 2010 Michael Ossmann
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street,
17 * Boston, MA 02110-1301, USA.
20 #define u8 unsigned char
21 #define u16 unsigned int
22 #define u32 unsigned long
25 * There is one channel per column of the display. The radio is tuned to one
26 * channel at a time and RSSI is displayed for that channel.
28 #define NUM_CHANNELS 132
31 * wide mode (default): 44 MHz on screen, 333 kHz per channel
32 * narrow mode: 6.6 MHz on screen, 50 kHz per channel
39 * short mode (default): displays RSSI >> 2
40 * tall mode: displays RSSI
45 /* vertical scrolling */
48 #define MAX_VSCROLL 208
51 /* frequencies in MHz */
52 #define DEFAULT_FREQ 915
55 #define ULTRAWIDE_STEP 20
56 #define WIDE_MARGIN 13
57 #define NARROW_MARGIN 3
58 #define ULTRAWIDE_MARGIN 42
60 /* frequency bands supported by device */
65 /* band limits in MHz */
73 /* band transition points in MHz */
77 /* VCO transition points in Hz */
78 #define MID_300 318000000
79 #define MID_400 424000000
80 #define MID_900 848000000
82 /* channel spacing in Hz */
83 #define WIDE_SPACING 199952
84 #define NARROW_SPACING 49988
85 #define ULTRAWIDE_SPACING 666504
87 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
88 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
91 /* Keeping track of all this for each channel allows us to tune faster. */
93 /* frequency setting */
98 /* frequency calibration */
103 /* signal strength */
110 void putchar(char c);
116 void set_radio_freq(u32 freq);
117 void calibrate_freq(u32 freq, u8 ch);
118 u16 set_center_freq(u16 freq);
120 void set_width(u8 w);
121 void poll_keyboard();