📄 osd.lst
字号:
C51 COMPILER V7.50 OSD 02/05/2007 16:33:25 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE OSD
OBJECT MODULE PLACED IN .\OBJ\OSD.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE OSD.C ROM(COMPACT) OPTIMIZE(9,SPEED) NOAREGS DEFINE(PROJECT=DMO04015800,MCU
-_CFG=BIT5101,VP_IF_CFG=VP_IF_BITEK) PRINT(.\LST\OSD.lst) OBJECT(.\OBJ\OSD.obj)
line level source
1 /* **********************************************************************
2
3 Copyright (c) 2002-2006 Beyond Innovation Technology Co., Ltd
4
5 All rights are reserved. Reproduction in whole or in parts is
6 prohibited without the prior written consent of the copyright owner.
7 ----------------------------------------------------------------------
8
9 Module: OSD.C
10
11 Purpose: Implementation of OSD module.
12
13 Version: 0.01 11:01AM 2005/11/17
14
15 Compiler: Keil 8051 C Compiler v8.01
16
17 Reference:
18 [1] BIT1611B Datasheet Version 1.0, 2005-11-10, Beyond Innovation Technology
19 [2] MTV121 Super On-Screen-Display for LCD Monitor, Revision 5.0
20 06/29/1999 Myson Technology
21
22 ----------------------------------------------------------------------
23 Modification:
24
25 R0.01 09:48AM 2005/11/17 Jeffrey Chang
26 Reason:
27 1. Original.
28 Solution:
29
30 ********************************************************************** */
31
32 #define _OSD_C_
33
34 /* ------------------------------------
35 Header Files
36 ------------------------------------ */
37 #include "bitek.h"
38 #include "eeprom.h"
39 #include "intrins.h"
40 #include "led.h"
41 #include "osd.h"
42 #include "platform.h"
43 #include "timer.h"
44
45 /* ------------------------------------
46 Macro Definitions
47 ------------------------------------ */
48
49 /* ------------------------------------
50 Type Definitions
51 ------------------------------------ */
52
53 /* ------------------------------------
54 Variables Definitions
C51 COMPILER V7.50 OSD 02/05/2007 16:33:25 PAGE 2
55 ------------------------------------ */
56 #if (OSD_CFG == OSD_BIT1611B)
57 static UB8 CODE abProgressBarTV[] = { OSD_00_DASH_0, OSD_01_DASH_1, OSD_02_DASH_2 };
58 static UB8 CODE abProgressBarMONITOR[] = { OSD_10_BAR_0, OSD_11_BAR_1, OSD_12_BAR_2,
59 OSD_13_BAR_3, OSD_14_BAR_4, OSD_15_BAR_5 };
60 static UB8 CODE abTrackBar[] = { OSD_01_TRACK_1, OSD_06_TRACK_2, OSD_07_TRACK_3 };
61 #endif
62
63
64 /* ------------------------------------
65 Function Prototypes
66 ------------------------------------ */
67
68
69 #pragma OPTIMIZE (6)
70 /* -------------------------------------------------------------------
71 Name: OSD_DisplayAddress - (OSD_BIT1611B)
72 Purpose: To calculate OSD Display Address.
73 Passed:
74 UB8 bWindow = OSD Window Identifier.
75 UB8 bRow = Position in rows
76 UB8 bCol = Position in columns
77
78 Returns: OSD Display Address.
79 Notes:
80 ------------------------------------------------------------------- */
81 UW16 OSD_DisplayAddress (
82 UB8 bWindow,
83 UB8 bRow,
84 UB8 bCol
85 )
86 {
87 1 switch (bWindow)
88 1 {
89 2 case OSD_WINDOW1:
90 2 return(VP_0500_057F_DISPLAY_CODE + OSD_WINDOW1_BASE +
91 2 bRow * OSD_WINDOW1_WIDTH + bCol );
92 2 break;
93 2
94 2 case OSD_WINDOW2:
95 2 return(VP_0500_057F_DISPLAY_CODE + OSD_WINDOW2_BASE +
96 2 bRow * OSD_WINDOW2_WIDTH + bCol );
97 2 break;
98 2
99 2 case OSD_WINDOW3:
100 2 default:
101 2 return(VP_0500_057F_DISPLAY_CODE + OSD_WINDOW3_BASE +
102 2 bRow * OSD_WINDOW3_WIDTH + bCol );
103 2 break;
104 2 }
105 1 } /* OSD_DisplayAddress */
106 #pragma OPTIMIZE (9)
107
108
109 #if (OSD_DSP_PROGRESSBAR)
110 /* -------------------------------------------------------------------
111 Name: OSD_DspProgressBar - (OSD_BIT1611B)
112 Purpose: To display a progress bar at specified position in OSD window.
113 Passed:
114 UB8 bWindow = OSD Window Identifier.
115 UB8 bCol, = Progress bar horizontal position in columns.
116 UB8 bRow, = Progress bar vertical position in rows.
C51 COMPILER V7.50 OSD 02/05/2007 16:33:25 PAGE 3
117 UW16 wMin, = Progress bar minimal value.
118 UW16 wMax, = Progress bar maximal value.
119 UW16 wValue = Progress bar indicative value.
120 UB8 bWidth, = Progress bar width
121 UB8 bStyle = Progress bar Style
122 Returns: None.
123 Notes:
124 ------------------------------------------------------------------- */
125 void OSD_DspProgressBar (
126 UB8 bWindow,
127 UB8 bCol, // Progress bar horizontal position in columns
128 UB8 bRow, // Progress bar vertical position in rows
129 UW16 wMin, // Progress bar minimal value
130 UW16 wMax, // Progress bar maximal value
131 UW16 wValue, // Progress bar indicative value
132 UB8 bWidth, // Progress bar width
133 UB8 bStyle // Progress bar style
134 )
135 {
136 1 UB8 bFull;
137 1 UB8 bUnit;
138 1 UW16 wAddr;
139 1
140 1
141 1 wAddr = OSD_DisplayAddress(bWindow, bRow, bCol);
142 1
143 1 // Note: MONITOR Style contains LEFT and RIGHT !
144 1 if (bStyle != OSD_STYLE_TV1)
145 1 bWidth -= 2;
146 1
147 1 switch (bStyle)
148 1 {
149 2 case OSD_STYLE_TV1:
150 2 default:
151 2 // Dash Type
152 2
153 2 // Rounding
154 2 bUnit = (UW32)(wValue - wMin) * OSD_DASH_TOTAL * bWidth /
155 2 (wMax - wMin);
156 2
157 2 bFull = bUnit / OSD_DASH_TOTAL;
158 2
159 2 // Fill FULL Dash Bar !
160 2 BITEK_TxRepeat(OSD_MAD, wAddr, bFull, OSD_03_DASH_FULL);
161 2
162 2 if (bFull != bWidth)
163 2 {
164 3 // Fill Dash 0 Bar !
165 3 BITEK_TxRepeat(OSD_MAD, wAddr + bFull, bWidth - bFull, OSD_00_DASH_0);
166 3
167 3 // Show Dash Bar !
168 3 BITEK_TxByte(OSD_MAD, wAddr + bFull, abProgressBarTV[ bUnit % OSD_DASH_TOTAL ]);
169 3 }
170 2 break;
171 2
172 2 case OSD_STYLE_MONITOR1:
173 2 // Bar Type
174 2
175 2 // Rounding
176 2 bUnit = (UW32)(wValue - wMin) * OSD_BAR_TOTAL * bWidth /
177 2 (wMax - wMin);
178 2
C51 COMPILER V7.50 OSD 02/05/2007 16:33:25 PAGE 4
179 2 bFull = bUnit / OSD_BAR_TOTAL;
180 2
181 2
182 2 // LEFT/RIGHT BAR !
183 2 BITEK_TxByte(OSD_MAD, wAddr, OSD_5B_BAR_LEFT);
184 2 BITEK_TxByte(OSD_MAD, wAddr+bWidth+1, OSD_5D_BAR_RIGHT);
185 2
186 2 // Fill FULL BAR !
187 2 wAddr++;
188 2 BITEK_TxRepeat(OSD_MAD, wAddr, bFull, OSD_16_BAR_FULL);
189 2
190 2 if (bFull != bWidth)
191 2 {
192 3 // Fill Dash 0 Bar !
193 3 BITEK_TxRepeat(OSD_MAD, wAddr + bFull, bWidth - bFull, OSD_10_BAR_0);
194 3
195 3 // Show Dash Bar !
196 3 BITEK_TxByte(OSD_MAD, wAddr + bFull, abProgressBarMONITOR[ bUnit % OSD_BAR_TOTAL ]);
197 3 }
198 2 break;
199 2 }
200 1 } /* OSD_DspProgressBar */
201 #endif
202
203
204 #if (OSD_DSP_TRACKBAR)
205 /* -------------------------------------------------------------------
206 Name: OSD_DspTrackBar - (OSD_BIT1611B)
207 Purpose: To display a track bar at specified position in OSD window.
208 Passed:
209 UB8 bWindow = OSD Window Identifier.
210 UB8 bCol, = Track bar horizontal position in columns
211 UB8 bRow, = Track bar vertical position in rows
212 UW16 wMin, = Track bar minimal value
213 UW16 wMax, = Track bar maximal value
214 UW16 wValue = Track bar indicative value
215 UB8 bWidth = Track bar width
216 Returns: None.
217 Notes:
218 ------------------------------------------------------------------- */
219 void OSD_DspTrackBar (
220 UB8 bWindow,
221 UB8 bCol, // Track bar horizontal position in columns
222 UB8 bRow, // Track bar vertical position in rows
223 UW16 wMin, // Track bar minimal value
224 UW16 wMax, // Track bar maximal value
225 UW16 wValue, // Track bar indicative value
226 UB8 bWidth // Track bar width
227 )
228 {
229 1 UB8 bUnit;
230 1 UW16 wAddr;
231 1
232 1
233 1 wAddr = OSD_DisplayAddress(bWindow, bRow, bCol);
234 1
235 1 // Rounding
236 1 bUnit = ((UW32)(wValue - wMin) * OSD_TRACK_TOTAL * bWidth) /
237 1 (wMax - wMin);
238 1
239 1 if (bUnit == OSD_TRACK_TOTAL * bWidth)
240 1 bUnit--;
C51 COMPILER V7.50 OSD 02/05/2007 16:33:25 PAGE 5
241 1
242 1 // Fill Track 0 Bar !
243 1 BITEK_TxRepeat(OSD_MAD, wAddr, bWidth, OSD_00_TRACK_0);
244 1
245 1 // Show Track Bar !
246 1 BITEK_TxByte(OSD_MAD, wAddr + bUnit / OSD_TRACK_TOTAL, abTrackBar[ bUnit % OSD_TRACK_TOTAL ]);
247 1 } /* OSD_DspTrackBar */
248 #endif
249
250
251 /* -------------------------------------------------------------------
252 Name: OSD_EnableWindow - (OSD_BIT1611B)
253 Purpose: To enable/disable OSD Windows.
254 Passed:
255 UB8 bWindow = OSD Window Identifier.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -