📄 osd_vx1828.lst
字号:
C51 COMPILER V7.50 OSD_VX1828 01/14/2006 15:30:03 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE OSD_VX1828
OBJECT MODULE PLACED IN .\HEX\osd_vx1828.obj
COMPILER INVOKED BY: F:\Keil\C51\BIN\C51.EXE osd_vx1828.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\lst\osd_vx1828.lst) OB
-JECT(.\HEX\osd_vx1828.obj)
line level source
1
2 /*********************************************************************
3 OSD For VX1828 Function Version 1.0 (Copyright(c) VXIS Inc. 2002)
4 v1.0
5 Data:2002.08.22
6 by P.J. Yang
7 v1.1
8 Data:2002.09.19
9 by P.J. Yang
10 Modify:1.modify osd_show();osd_clear();osd_clearall()function ,del Address[10:8]bit's control designed
11
12 *********************************************************************/
13 #include <intrins.h>
14 #include "config.h"
15 #if _debug
16 #include <stdio.h> // printf() in the file .
17 #endif
18 #include "pindef.h"
19 #include "osd_vx1828.h"
20 #include "func_shi.H"
21
22
23 /*********************************************************************
24 Show OSD Function (For VX1828)
25
26 Input Factor:
27 stpos1 => 8 bits , Lower 2 bits is available.
28 The two bits is the 8-9bits address of
29 the starting point of the fontcodes.
30 stpos2 => 8 bits , The 0-7bits address of the starting point
31 of the fontcodes.
32 numfont => 8 bits , (Number of fontcode)-1
33 fontcode => 8 bits , A pointer of the fonts array to show
34 Output Factor:
35 None
36 Motion:
37 1.Show the fonts to the arbitrary position on screen
38 *********************************************************************/
39 void osd_show(char stpos2,char numfont,char *fontcode)
40 {
41 1 char idata temp[0x02] = {0x10,0x00};
42 1
43 1 temp[1] = stpos2;
44 1 shi_sub_write(VX1828,cw1,0x01,&temp[0]);
45 1
46 1 shi_sub_write(VX1828,cw3,numfont,fontcode);
47 1 }
48
49 /*********************************************************************
50 Turn on/off OSD Function (For VX1828)
51
52 Input Factor:
53 osd_en => 8 bits , Lower 3 bits is available,and higher 5 bits
54 must be zero.
C51 COMPILER V7.50 OSD_VX1828 01/14/2006 15:30:03 PAGE 2
55 0 bit => OSD Bottom Block enable or not
56 1 bit => OSD Content Block enable or not
57 2 bit => OSD Title Block enable or not
58 0 => Disable 1 => Enable
59 Output Factor:
60 None
61 Motion:
62 1.Setup the three block of osd enable or not
63 *********************************************************************/
64 void osd_switch(char osd_en)
65 {
66 1 char idata temp2;
67 1
68 1 osd_en = osd_en & 0x07; // Remove redundant bits
69 1 shi_sub_read(VX1828,osd2,0x00,&temp2);
70 1 temp2 = temp2 & 0xf8;
71 1 temp2 = temp2 | osd_en;
72 1 shi_sub_write(VX1828,osd2,0x00,&temp2);
73 1 }
74
75 /*********************************************************************
76 Set position of OSD Function (For VX1828)
77
78 Input Factor:
79 block => 8 bits , Choose which block to set
80 0x01 => Title Block
81 0x02 => Content Block
82 0x03 => Bottom Block
83 posx => 8 bits , The position of X direction
84 posy => 8 bits , The position of Y direction
85 Output Factor:
86 None
87 Motion:
88 1.Set the position of OSD Block
89 *********************************************************************/
90 void osd_pos(char block,char posx,char posy)
91 {
92 1 char idata temp3[0x02];
93 1
94 1 temp3[0] = posx;
95 1 temp3[1] = posy;
96 1 switch(block)
97 1 {
98 2 case 1: // Setup position of Title Block
99 2 shi_sub_write(VX1828,osd9,0x01,&temp3);
100 2 break;
101 2 case 2: // Setup position of Content Block
102 2 shi_sub_write(VX1828,osd16,0x01,&temp3);
103 2 break;
104 2 case 3: // Setup position of Bottom Block
105 2 shi_sub_write(VX1828,osd30,0x01,&temp3);
106 2 break;
107 2 default:
108 2 break;
109 2 }
110 1 }
111
112 /*********************************************************************
113 Set Size of OSD Function (For VX1828)
114
115 Input Factor:
116 block => 8 bits , Choose which block to set
C51 COMPILER V7.50 OSD_VX1828 01/14/2006 15:30:03 PAGE 3
117 0x01 => Title Block
118 0x02 => Content Block
119 0x03 => Bottom Block
120 sizex => 8 bits , The size of X direction (Lower 6bits are available)
121 Value range => for small font:01h-26h
122 for large font:01h-13h
123 sizey => 8 bits , The size of Y direction (Lower 5bits are available)
124 (Just for Content Block)
125 Value range => for small font:01h-15h
126 for large font:01h-0ah
127 Output Factor:
128 None
129 Motion:
130 1.Set the size of OSD Block
131 *********************************************************************/
132 void osd_size(char block,char sizex,char sizey)
133 {
134 1 char idata temp4[0x02];
135 1
136 1 temp4[0] = sizex;
137 1 temp4[1] = sizey;
138 1 switch(block)
139 1 {
140 2 case 1: // Setup x size of Title Block
141 2 shi_sub_write(VX1828,osd4,0x00,&temp4[0]);
142 2 break;
143 2 case 2: // Setup x and y size of Content Block
144 2 shi_sub_write(VX1828,osd13,0x01,&temp4[0]);
145 2 break;
146 2 case 3: // Setup x size of Bottom Block
147 2 shi_sub_write(VX1828,osd28,0x00,&temp4[0]);
148 2 break;
149 2 default:
150 2 break;
151 2 }
152 1 }
153 /*********************************************************************
154 Switch Big font of OSD Function (For VX1828)
155
156 Input Factor:
157 big_en => 1 bit , 0: Small font 16x20
158 1: Big font 32x40
159 Output Factor:
160 None
161 Motion:
162 1.Switch whether big font format is choosed
163 *********************************************************************/
164 /*void osd_bigfont(bit big_en)
165 {
166 char idata temp5;
167 shi_sub_read(VX1828,osd2,0x00,&temp5);
168 if (big_en)
169 {
170 temp5 = temp5 | 0x08;
171 }
172 else
173 {
174 temp5 = temp5 & 0xf7;
175 }
176 shi_sub_write(VX1828,osd2,0x00,&temp5);
177 }*/
178
C51 COMPILER V7.50 OSD_VX1828 01/14/2006 15:30:03 PAGE 4
179 /*********************************************************************
180 Clear font of OSD Function (For VX1828)
181
182 Input Factor:
183 stpos1 => 8 bits , Lower 2 bits is available.
184 The two bits is the 8-9bits address of
185 the starting point of the fontcodes.
186 stpos2 => 8 bits , The 0-7bits address of the starting point
187 of the fontcodes.
188 Output Factor:
189 None
190 Motion:
191 1.Clear 16 fonts of OSD from the starting point
192 *********************************************************************/
193 void osd_clear(char stpos2)
194 {
195 1 char idata temp6[0x12] = {0x10,0x00,0x6d,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC
-0,0xC0,0xC0};
196 1 //{0x10,0x00,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b};
197 1
198 1 temp6[1] = stpos2;
199 1 shi_sub_write(VX1828,cw1,0x01,&temp6[0]);
200 1 shi_sub_write(VX1828,cw3,0x0f,&temp6[2]);
201 1 }
202 #if 0
void osd_clear_new(char data form,char data to)
{
char data temp =0x10;
char data tmp=0x6d;
shi_sub_write(VX1828,cw1,0x00,&temp);
temp=form-to;
shi_sub_write(vx1828,cw2,0x00,&form);
shi_sub_write(VX1828,cw3,temp,&tmp);
}
#endif
213 /*********************************************************************
214 Clear all fonts memory of OSD Function (For VX1828)
215
216 Input Factor:
217 None
218 Output Factor:
219 None
220 Motion:
221 1.Clear all fonts memory of OSD
222 *********************************************************************/
223 void osd_clearall()
224 {
225 1 char idata count2;
226 1
227 1 for (count2=0;count2<=0x0f;count2++)
228 1 {
229 2 osd_clear(count2*0x10);
230 2 }
231 1 }
232
233 /*********************************************************************
234 Set block initial address in OSD Function (For VX1828)
235
236 Input Factor:
237 block => 8 bits , Choose which block to set
238 0x02 => Content Block
239 0x03 => Bottom Block
C51 COMPILER V7.50 OSD_VX1828 01/14/2006 15:30:03 PAGE 5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -