📄 osd.lst
字号:
C51 COMPILER V7.07 OSD 09/26/2006 08:56:41 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE OSD
OBJECT MODULE PLACED IN OSD.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE OSD.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /*********************************************************************
2
3 COPYRIGHT (C) Himax Technologies, Inc.
4
5 File name : OSD.c
6
7 Description : Declare OSD Function
8
9 Author : Taylor
10
11 Create date : 2004/10/18
12
13 Modifications :
14 *********************************************************************/
15
16 #define _OSD_C
17
18 /********************** Include Section *****************************/
19
20 #include "osd.h"
21 #include "osd_font.h"
22 #include "Key.h"
23
24 /********************** Function Implementation *********************/
25
26 code unsigned char // font address
27 ICONGROUP[TOTAL_ICON][2] = {{0x3C, 0x3D}, //Bri
28 {0x3E, 0x3F}, //Cont
29 {0x40, 0x41}, //HUE
30 {0x50, 0x51}, //Saturation
31 {0x44, 0x45}, //OSD
32 {0x46, 0x47}, //nonlinear
33 {0x48, 0x49}, //Sharp
34 {0x4A, 0x4B}, //Lan
35 {0x4E, 0x4F}, //Source
36 {0x4C, 0x4D}, //Exit
37 {0x54, 0x55}, //InputSource
38 {0x56, 0x57}, //InternalPattern
39 {0x58, 0x59} //Dithering
40 };
41
42 code unsigned char // display address
43 ICONPOS[TOTAL_ICON][2] = {{3, 3}, //Bri
44 {3, 6}, //Cont
45 {3, 9}, //HUE
46 {3, 12},//Saturation
47 {3, 15},//OSD
48 {3, 18},//nonlinear
49 {3, 21},//Sharp
50 {3, 24},//Lan
51 {3, 27},//Source
52 {3, 30},//Exit
53 {4, 3}, //InputSource
54 {4, 6}, //InternalPattern
55 {4, 9} //Dithering
C51 COMPILER V7.07 OSD 09/26/2006 08:56:41 PAGE 2
56 };
57 code unsigned int
58 OSDPOSITION[5][2] = {{0x0040, 0x0020}, {0x01D0, 0x0020}, {0x0104, 0x00DC}, {0x0040, 0x0150}, {0x01D0, 0x01
-50}};
59
60 void Draw_logo();
61
62 /* -------------------------------------------------------------------
63 Name : Init_OSD
64 Purpose :
65 Passed :
66 Returns :
67 Notes :
68 ------------------------------------------------------------------- */
69 void Init_OSD(void)
70 {
71 1 // Turn OFF OSD
72 1 OSD_OFF();
73 1 // OSD set pallete
74 1 OsdSetPallete();
75 1 // Load OSD Data to HX8824's RAM
76 1 SetFonts(0);
77 1 // Setup OSD Fonts Size
78 1 I2CWriteByte(HX8824_ADDR, HX8824_OSD_SIZE, (OSD_Y_Ratio << 4) | OSD_X_Ratio) ;
79 1 // Setup OSD Blink Rate
80 1 I2CWriteByte(HX8824_ADDR, HX8824_OSD_BLNKRATE, 0x88);
81 1 I2CWriteByte(HX8824_ADDR, HX8824_OSD_Alpha, 0x88);
82 1 OsdDrawing();
83 1 // OSD Enable
84 1 //OSD_ON();
85 1 SetFonts(0);
86 1 }
87
88
89 /* ================================================================
90 Name : SetFonts
91 Purpose : Set OSD Fonts to HX8824
92 Passed : Font_page
93 Notes : None
94 ================================================================ */
95
96 void SetFonts(Byte page)
97 {
98 1 // Declare Counter Variable
99 1 Word i;
100 1
101 1 // Setup Mono/2-Bits/3-bits/4-Bits Color Font Number
102 1 I2CWriteByte(HX8824_ADDR, HX8824_OSD_COLOR_FONT_NUMBER, 0x64);
103 1
104 1 // Point to Font First Address
105 1 I2CWrtHead( HX8824_ADDR, HX8824_FONT_IND_ADR ); // 0xBA
106 1 Write(0x00);
107 1 //Write(0x00);
108 1 Stop();
109 1
110 1 I2CWrtHead( HX8824_ADDR, HX8824_FONT_IND_DATA ); // 0xBC
111 1
112 1 switch(page)
113 1 {
114 2 case 0:
115 2 // Address = 0x00 --> First Data must be Empty addr: 0
116 2 for (i = 0; i < 27; i++)
C51 COMPILER V7.07 OSD 09/26/2006 08:56:41 PAGE 3
117 2 {
118 3 Write(FontAsciiSpace[i]);
119 3 }
120 2 // Address = 0x01~0x0B --> "0~9"+":"
121 2 for (i = 0; i < 11*27; i++)
122 2 {
123 3 Write(FontAscii_0_9[i]);
124 3 }
125 2 // Address = 0x0C~0x11 -->
126 2 for (i = 0; i < 6*27; i++)
127 2 {
128 3 Write(FontBorder[i]);
129 3 }
130 2 // Address = 0x12~0x2B --> A~Z
131 2 for (i = 0; i < 26*27; i++)
132 2 {
133 3 Write(FontAscii_A_Z[i]);
134 3 }
135 2 // Address = 0x2C~0x33 --> Bar_left, 0/5~5/5, Bar_right
136 2 for (i = 0; i < 8*27; i++)
137 2 {
138 3 Write(FontBar[i]);
139 3 }
140 2 // Address = 0x34~0x51 --> Menu Icon
141 2 for (i = 0; i < 48*27; i++)
142 2 {
143 3 Write(FontIcon_Menu[i]);
144 3 }
145 2
146 2 // Address = 0x25 --> FontIcon addr: 0x25~0x2A--> border;0x32~0x61 icon
147 2 /* for (i = 0; i < 100*27; i++)
148 2 {
149 2 Write(FontIcon[i]);
150 2 }
151 2 */
152 2
153 2 break;
154 2 case 1:
155 2 // Address = 0x00 --> First Data must be Empty addr: 0
156 2 for (i = 0; i < 27; i++)
157 2 {
158 3 Write(FontAsciiSpace[i]);
159 3 }
160 2 // Address = 0x01~0x0B --> "0~9"+":"
161 2 for (i = 0; i < 11*27; i++)
162 2 {
163 3 Write(FontAscii_0_9[i]);
164 3 }
165 2 // Address = 0x0C~0x11 -->
166 2 for (i = 0; i < 6*27; i++)
167 2 {
168 3 Write(FontBorder[i]);
169 3 }
170 2 // Address = 0x12~0x2B --> A~Z
171 2 for (i = 0; i < 26*27; i++)
172 2 {
173 3 Write(FontAscii_A_Z[i]);
174 3 }
175 2 // Address = 0x2C~0x33 --> Bar_left, 0/5~5/5, Bar_right
176 2 for (i = 0; i < 8*27; i++)
177 2 {
178 3 Write(FontBar[i]);
C51 COMPILER V7.07 OSD 09/26/2006 08:56:41 PAGE 4
179 3 }
180 2 // Address = 0x34~0x51 --> Menu Icon
181 2 for (i = 0; i < 36*27; i++)
182 2 {
183 3 Write(FontTraditionalChinese[i]);
184 3 }
185 2 break;
186 2 default:
187 2 break;
188 2 }
189 1
190 1 Stop();
191 1
192 1 }
193
194 /* ================================================================
195 Name : OsdSetStrValueBL
196 Purpose : Write OSD One Line String
197 Passed : None
198 Notes : None
199 ================================================================ */
200 /*
201 void OsdSetStrValueBL(Byte byRow, Byte byCol,
202 Byte bkColor, Byte frColor,
203 Byte length, Byte *ascii)
204 {
205 Byte jj;
206 Word kk;
207
208 kk= byRow*40 + byCol;
209 I2CWrtHead(HX8824_ADDR, HX8824_DISPLAY_AREA_Y);
210 Write((Byte)(kk));
211 Write((Byte)(kk>>8));
212 Write(bkColor);
213 Write(frColor);
214 while (length--)
215 {
216 if (*ascii == '\0')
217 {
218 Write (0x00);
219 for (jj=0 ; jj< length ; jj++) Write (0x00);
220 goto Stop_write;
221 }
222 else
223 {
224 Write (*ascii);
225 }
226 ascii++;
227 }
228
229 Stop_write:
230 Stop();
231 }
232 */
233
234 /* ================================================================
235 Name : SetOsdAlpha
236 Purpose : Set OSD Alpha
237 Passed : Foreground --> Set Foreground
238 Background --> Set Background
239 Notes : None
240 ================================================================ */
C51 COMPILER V7.07 OSD 09/26/2006 08:56:41 PAGE 5
241 /*
242 void SetOsdAlpha(Byte byIndex,Byte byValue)
243 {
244 // According to byIndex to select background/foreground alpha
245 switch(byIndex)
246 {
247 case Foreground:
248 I2CWriteByte(HX8824_ADDR, HX8824_OSD_Alpha_Fore, byValue);
249 break;
250
251 case Background:
252 I2CWriteByte(HX8824_ADDR, HX8824_OSD_Alpha_Back, byValue);
253 break;
254 }
255 }
256 */
257
258 /* ================================================================
259 Name : OsdSetChanelValue
260 Purpose : Write OSD One Line String
261 Passed : None
262 Notes : None
263 ================================================================ */
264 /*
265 void OsdSetChanelValue(Byte byRow, Byte byCol,
266 Byte bkColor, Byte frColor,
267 Byte byChannel)
268 {
269 Byte jj;
270 Word kk;
271
272 Clear_OSD();
273
274 kk= byRow*40 + byCol;
275 I2CWrtHead(HX8824_ADDR, HX8824_DISPLAY_AREA_Y);
276 Write((Byte)(kk));
277 Write((Byte)(kk>>8));
278 Write(bkColor);
279 Write(frColor);
280
281 // Process κ
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -