OSDN Git Service

[UI] Add some features, for using akc6955.
[openi2cradio/OpenI2CRadio.git] / menu.h
1 /*
2  * OpenI2CRADIO
3  * Menu sub-routines.
4  * Copyright (C) 2013-06-21 K.Ohta <whatisthis.sowhat ai gmail.com>
5  * License: GPL2+LE
6  *
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.
15  *
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,
19  *  MA 02110-1301, USA.
20  *
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.
27  */
28
29 #ifndef MENU_H
30 #define MENU_H
31
32 #include <stdarg.h>
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36 #include <sdcc-lib.h>
37 #include <pic18fregs.h> /* ONLY FOR PIC18x */
38 #include <delay.h>
39
40 #include "iodef.h"
41 #include "idle.h"
42 #include "i2c_io.h"
43 #include "akc6955.h"
44 #include "lcd_acm1602.h"
45 #include "ui.h"
46 #include "eeprom.h"
47 #include "ioports.h"
48
49 #ifdef  __cplusplus
50 extern "C" {
51 #endif
52 #define USER_BAND_NUM 4
53     typedef struct {
54         unsigned char mode3k; // mode3k if am
55         unsigned char start;
56         unsigned char stop;
57         unsigned int freq;
58     } _userband_t;
59     /*
60      * main.c
61      */
62     extern unsigned int amfreq;
63     extern unsigned int fmfreq;
64     extern unsigned int amfreq_bank[AKC6955_BAND_AMEND];
65     extern unsigned int fmfreq_bank[AKC6955_BAND_FMEND];
66     extern unsigned char amband;
67     extern unsigned char fmband;
68     extern unsigned char fm;
69     extern unsigned char am_mode3k;
70     extern unsigned char am_userbandnum;
71     extern unsigned char fm_userbandnum;
72     extern unsigned char threshold;
73     extern unsigned char lowboost;
74     extern unsigned char stereo;
75     extern _userband_t am_usrbands[USER_BAND_NUM];
76     extern _userband_t fm_usrbands[USER_BAND_NUM];
77     extern banddesc am_userband_freq[USER_BAND_NUM];
78     extern banddesc fm_userband_freq[USER_BAND_NUM];
79     extern unsigned char volume;
80     extern unsigned char prevolume;
81     extern unsigned char fmbandwidth;
82
83     extern int backlight_long;
84     extern unsigned int ui_idlecount;
85
86
87     extern unsigned char stereoflag;
88     extern unsigned char tuneflag;
89     extern unsigned char cnrlevel;
90     extern int diffstat;
91     extern unsigned int batlevel_6955;
92     extern unsigned int battlevel;
93
94     extern int recv_signal;
95     extern int backlight_counter;
96     extern unsigned char backlight_level;
97     extern unsigned char pollkeybuf[33];
98     extern unsigned char scanflag;
99
100     extern void update_display(void);
101     extern void update_status(void);
102     extern void save_eeprom(void);
103     extern unsigned char load_eeprom(void);
104     extern void setfreq_updown(unsigned char ctlword);
105     extern void setdefault(void);
106
107     /*
108      * menu.c
109      */
110     extern void main_menu(void);
111     extern void input_userband(void);
112     extern void set_userband(void);
113     extern void call_userband(unsigned char num);
114     extern void setband_direct(void);
115     extern void setfreq_direct(void);
116     extern void set_stereo(void);
117
118     extern void scan_start(void);
119     extern void set_volume(void);
120     extern void toggle_amfm(void);
121     extern void updown_help(void);
122     extern void mainmenu_help(void);
123     extern void print_freq(unsigned char y);
124     extern void setup_akc6955(void);
125
126 #ifdef  __cplusplus
127 }
128 #endif
129
130 #endif  /* MENU_H */
131