4 * Copyright (C) 2013-06-21 K.Ohta <whatisthis.sowhat ai gmail.com>
7 * This program 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 2,
10 * or (at your option) any later version.
11 * This library / program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this library; see the file COPYING. If not, write to the
18 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21 * As a special exception, if you link this(includeed from sdcc) library
22 * with other files, some of which are compiled with SDCC,
23 * to produce an executable, this library does not by itself cause
24 * the resulting executable to be covered by the GNU General Public License.
25 * This exception does not however invalidate any other reasons why
26 * the executable file might be covered by the GNU General Public License.
38 #include <pic18fregs.h> /* ONLY FOR PIC18x */
48 #include "lcd_acm1602.h"
54 #include "eeprom_util.h"
59 #define USER_BAND_NUM 3
61 unsigned char mode3k; // mode3k if am
67 #define USER_MEMORY_NUM 28
68 #define USER_MEMORY_BANKS 24
77 // Frequencyset of 1Sector.
83 _memoryfreq_t memoryfreqs[USER_MEMORY_NUM];
84 unsigned int checksum;
90 unsigned int amfreq_bank[AKC6955_BAND_AMEND];
91 unsigned int fmfreq_bank[AKC6955_BAND_FMEND];
95 unsigned char am_mode3k;
96 unsigned char am_userbandnum;
97 unsigned char fm_userbandnum;
98 unsigned char threshold_amcnr; // Reg 0x08
99 unsigned char threshold_fmcnr; // Reg 0x08
100 unsigned char threshold_width; // Reg 0x08
101 unsigned char threshold_fmstereo; // Reg 0x08
102 _userband_t am_usrbands[USER_BAND_NUM];
103 _userband_t fm_usrbands[USER_BAND_NUM];
104 banddesc am_userband_freq[USER_BAND_NUM];
105 banddesc fm_userband_freq[USER_BAND_NUM];
106 unsigned char stereo;
107 unsigned char volume;
108 unsigned char prevolume;
109 unsigned char fmbandwidth;
110 unsigned char lowboost;
113 unsigned int ui_idlecount;
114 unsigned int memorynum;
115 // _memoryfreq_t memoryfreqs[USER_MEMORY_NUM];
116 unsigned int pagenum;
120 extern __radioset_t setup;
121 extern __freqset_t freqset;
122 extern __freqset_t freqset_temp;
123 extern unsigned char scanflag;
125 extern unsigned char stereoflag;
126 extern unsigned char tuneflag;
127 extern unsigned char cnrlevel;
129 extern unsigned int batlevel_6955;
130 extern unsigned int battlevel;
132 extern int recv_signal;
133 extern int backlight_counter;
134 extern unsigned char backlight_level;
135 extern unsigned char pollkeybuf[33];
136 extern unsigned char scanflag;
141 extern void setfreq_updown(unsigned char ctlword);
142 extern void setdefault(void);
147 extern void input_userband(void);
148 extern void set_userband(void);
149 extern void call_userband(unsigned char num);
154 extern void scan_start(void);
158 extern void set_volume(void);
163 extern void setdefault(void);
164 extern void valinit(void);
170 extern void toggle_amfm(void);
171 extern void set_stereomode(void);
172 extern void set_stereo(void);
173 extern void setband_direct(void);
174 extern void setfreq_direct(void);
175 extern void menu_poweroff(void);
176 extern void setup_akc6955(void);
177 extern void main_menu(void);
182 extern void setup_menu(void);
183 extern void menu_load(void);
184 extern void menu_save(void);