📄 ht1621_drv.lst
字号:
89 =1 #define KEY_10 ((Byte)0x15) /* 00010101,MAIN POWER */
90 =1 #define KEY_11 ((Byte)0x0d) /* 00001101,VOL- */
91 =1
92 =1 #define KEY_12 ((Byte)0x13) /* 00010011,BAND */
93 =1 #define KEY_13 ((Byte)0x0B) /* 00001011,FF/UP */
94 =1
95 =1 #define KEY_14 ((Byte)0x07) /* 00000111,FR/DOWN */
96 =1
97 =1 #define KEY_REPEAT KEY_0
98 =1 #define KEY_STOP KEY_1
99 =1 #define KEY_ALBUM KEY_2
100 =1 #define KEY_PALY_PAUSE KEY_3
101 =1 #define KEY_S16 KEY_4
102 =1
103 =1 #define KEY_EQ_PROG KEY_5
104 =1 #define KEY_RADIO KEY_6
105 =1 #define KEY_CD KEY_7
106 =1 #define KEY_VOL_INC KEY_8
107 =1
108 =1 #define KEY_TAPE KEY_9
109 =1 #define KEY_MainPower KEY_10
110 =1 #define KEY_VOL_DEC KEY_11
111 =1
112 =1 #define KEY_BAND KEY_12
113 =1 #define KEY_FF KEY_13
114 =1
115 =1 #define KEY_FR KEY_14
116 =1
117 =1 #define Kbd_key_pressed() ((P1&0x1f) != 0x1f)
118 =1
119 =1 /*----- Disp clock task states -----*/
120 =1 #define DISP_IDLE 0
121 =1 #define DISP_INIT 1
122 =1 #define DISP_TICK0 2
123 =1 #define DISP_TICK1 3
124 =1 #define DISP_SEC 4
125 =1 #define DISP_MIN 5
126 =1 #define DISP_MS_BUSY 6
127 =1 #define DISP_PRO 7
128 =1
129 =1 #define KBD_DEBOUNCE_TEMPO 20 /* debounce period: 8 ms */
130 =1 #define KBD_DEBOUNCE_INIT 0
131 =1 #define SCHEDULER_TICK 10
132 =1
133 =1 #define TIM_LOW 0xf0
134 =1 #define TIM_HIGH 0xd8
135 =1 //#define T0_set_TMOD() (TMOD = TMOD | 0x01)
136 =1
137 =1 #define I2C_ID0 0xa0
138 =1 #define I2C_ID1 0xa1
139 =1 #define I2C_ADD 0x00
140 =1
141 =1 /*----- Volume Control Start -----*/
142 =1 #define SC7313_ADD 0x88
C51 COMPILER V8.01 HT1621_DRV 08/07/2006 11:16:11 PAGE 6
143 =1 #define RADIO_IN 0x5c
144 =1 #define CD_IN 0x59 //01011001
145 =1 #define TAPE_IN 0x5e
146 =1
147 =1 /*----- Touch Pad Control Define -----*/
148 =1 #define TOUCH_REQUEST 0x52
149 =1 #define TOUCH_RETURN 0x53
150 =1
151 =1 #define FWVER_REG 0x00
152 =1 #define BUTTON_REG 0x10
153 =1 #define XY_REG 0x20
154 =1 #define ANGLE_REG 0x30
155 =1 #define TPSEN_REG 0x40
156 =1 #define FWID_REG 0xf0
157 =1
158 =1 /*----- DTS system define -----*/
159 =1 #define Mem_StartAdd 0x10
160 =1 #define Mem_EndAdd 0x1f
161 =1
162 =1 #define Mem_test 0
163 =1 #define Mem_5 5
164 =1 #define Mem_10 10
165 =1 #define DTS_Mem_Size Mem_10
166 =1
167 =1 #define DTS_FreStart 878
168 =1 #define DTS_FreEnd 1080
169 =1
170 =1 #if DTS_Mem_Size == Mem_5
=1 #define Mem_Fre0 878
=1 #define Mem_Fre1 900
=1 #define Mem_Fre2 100
=1 #define Mem_Fre3 960
=1 #define Mem_Fre4 1080
=1 #endif
177 =1
178 =1 #if DTS_Mem_Size == Mem_10
179 =1 #define Mem_Fre0 878
180 =1 #define Mem_Fre1 900
181 =1 #define Mem_Fre2 940
182 =1 #define Mem_Fre3 960
183 =1 #define Mem_Fre4 980
184 =1 #define Mem_Fre5 1000
185 =1 #define Mem_Fre6 1020
186 =1 #define Mem_Fre7 1040
187 =1 #define Mem_Fre8 1060
188 =1 #define Mem_Fre9 1080
189 =1 #endif
14 #include "Driver\io_def.h"
1 =1 /*H**************************************************************************
2 =1 * NAME: io_def.h
3 =1 *----------------------------------------------------------------------------
4 =1 * Copyright (c) 2006 Atmel.
5 =1 *----------------------------------------------------------------------------
6 =1 * RELEASE: C51 Sample
7 =1 * REVISION: 1.00
8 =1 *----------------------------------------------------------------------------
9 =1 * PURPOSE:
10 =1 *****************************************************************************/
11 =1
12 =1 /*_____ I N C L U D E S ____________________________________________________*/
13 =1
14 =1
C51 COMPILER V8.01 HT1621_DRV 08/07/2006 11:16:11 PAGE 7
15 =1 #define DTS_DOUT P3_6
16 =1 #define DTS_DIN P3_4
17 =1 #define DTS_CLK P3_5
18 =1 #define DTS_CE P3_7
19 =1
20 =1 #define MPOWER P3_1
21 =1 #define CDPOWER P1_7
22 =1 #define TAPE_POWER P1_5
23 =1
24 =1 #define LCD_DA P0_0
25 =1 #define LCD_RW P0_1
26 =1 #define LCD_CS P0_2
27 =1
28 =1 #define ISDA P2_1
29 =1 #define ISCL P2_0
30 =1
31 =1 #define TOUCH_SDI P0_3
32 =1 #define TOUCH_SDO P0_4
33 =1 #define TOUCH_SCK P0_5
34 =1 #define TOUCH_SS P0_6
15
16 #if CONF_DISPLAY == HT1621
17 #include "driver\ht1621_drv.h" /* scheduler definition */
1 =1 /*H**************************************************************************
2 =1 * NAME: ht1621_drv.h
3 =1 *----------------------------------------------------------------------------
4 =1 * Copyright (c) 2006 Atmel.
5 =1 *----------------------------------------------------------------------------
6 =1 * RELEASE: C51 Sample
7 =1 * REVISION: 1.00
8 =1 *----------------------------------------------------------------------------
9 =1 * PURPOSE:
10 =1 *****************************************************************************/
11 =1
12 =1 /*_____ I N C L U D E S ____________________________________________________*/
13 =1 void ht1621_init (void);
14 =1 void HT1621_getMSB(Byte bByte);
15 =1 void HT1621_getLSB(Byte bByte);
16 =1 void HT1621_command(Byte bByte);
17 =1 void HT1621_getdata(Byte address,Byte bByte);
18 =1 void ht1621_cls (void);
19 =1 void glht1621_sec(Byte bByte);
20 =1 void glht1621_min(Byte bByte);
21 =1 void glht1621_TRACK(Byte bByte);
22 =1 void glht1621_stop(void);
23 =1 void glht1621_rec(void);
24 =1 void glht1621_volume(Byte bByte);
25 =1
26 =1 Byte code ht1621disp_Map[];
27 =1 //extern idata char ht1621disp_Buffer[9];
28 =1 extern idata int dts_frequency;
29 =1 extern data Byte vol_value; /* volume value */
30 =1 extern bdata bit vol_flag;
31 =1 extern bdata bit DtsMen_flag ;
32 =1 extern data Byte Mem_add;
18 #endif
19 /*-----------------------------------------------------------
20 DIRVER IC: HT1621
21 LCD PIN ASSGMENT
22 DIRVER IC: HT1621
23 LCD PIN ASSGMENT
24 COM0 COM1 COM2 COM3
C51 COMPILER V8.01 HT1621_DRV 08/07/2006 11:16:11 PAGE 8
25 SEG0 |E5 |E3 |E1 |- ;HT1621_CSEG0H
26 SEG1 |E4 |E2 |E0 |ANTI ;HT1621_CSEG0L
27 SEG2 |BATT |6B |6C |6D ;HT1621_CSEG1
28 SEG3 |6A |6F |6G |6E ;HT1621_CSEG1
29 SEG4 |HOLD |5B |5C |5D ;HT1621_CSEG2
30 SEG5 |5A |5F |5G |5E ;HT1621_CSEG2
31 SEG6 |- |4B |4C |4D ;HT1621_CSEG3
32 SEG7 |4A |4F |4G |4E ;HT1621_CSEG3
33 SEG8 |ALL |3B |3C |3D ;HT1621_CSEG4
34 SEG9 |3A |3F |3G |3E ;HT1621_CSEG4
35 SEG10 |1 |2B |2C |2D ;HT1621_CSEG5
36 SEG11 |2A |2F |2G |2E ;HT1621_CSEG5
37 SEG12 |VOL |1B |1C |1D ;HT1621_CSEG6
38 SEG13 |1A |1F |1G |1E ;HT1621_CSEG6
39 SEG14 |REP |PROG |RNDOM |INTRO ;HT1621_CSEG7
40 SEG15 |- |2 |1 |BOST ;HT1621_CSEG7
41 SEG16 |- |7B |7C |7D ;HT1621_CSEG8
42 SEG17 |7A |7F |7G |7E ;HT1621_CSEG8
43 SEG18 |CD |V |MP3 |
44 -------------------------------------------------------------
45 Command Mode:
46 1.LCD OFF 1000/0000010X ;
47 2.LCD ON 1000/0000011X
48 3.BIAS & COM 1000/010ABXCX
49 C=0: 1/2 BIAS OPTION
50 C=1: 1/3 BIAS OPTION
51 AB=00: 2 COMMONS OPTION
52 AB=01: 3 COMMONS OPTION
53 AB=02: 4 COMMONS OPTION
54
55 Write Mode:
56 1/01/A5 A4 A3 A2 A1 A0/D0 D1 D2 D3
57 ------------------------------------------------*/
58
59 #if CONF_DISPLAY == HT1621
60 /*F**************************************************************************
61 * NAME: ht1621_init
62 *----------------------------------------------------------------------------
63 * PARAMS:
64 *
65 * return:
66 *----------------------------------------------------------------------------
67 * PURPOSE:
68 * Keyboard initialisation function
69 *----------------------------------------------------------------------------
70 * EXAMPLE:
71 *----------------------------------------------------------------------------
72 * NOTE:
73 *----------------------------------------------------------------------------
74 * REQUIREMENTS:
75 * ram/xram:
76 * cycle:
77 * stack:
78 * code:
79 *****************************************************************************/
80 void ht1621_init (void)
81 {
82 1 LCD_DA = High; /*DATA禁止*/
83 1 LCD_CS = High; /*CS禁止*/
84 1 LCD_RW = High; /*RW禁止*/
85 1 }
86
C51 COMPILER V8.01 HT1621_DRV 08/07/2006 11:16:11 PAGE 9
87 /*F**************************************************************************
88 * NAME: HT1621_command
89 *----------------------------------------------------------------------------
90 * PARAMS:
91 *
92 * return:
93 * Decoded key pressed
94 *----------------------------------------------------------------------------
95 * PURPOSE:
96 *----------------------------------------------------------------------------
97 * EXAMPLE:
98 *----------------------------------------------------------------------------
99 * NOTE:
100 *----------------------------------------------------------------------------
101 * REQUIREMENTS:
102 *****************************************************************************/
103 void HT1621_command(Byte bByte) {
104 1 Byte i; //data
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -