📄 function.lst
字号:
230 {
231 1 Word temp;
232 1 temp = I2CReadByte(HX8824_ADDR, HX8824_SHARPNESS); // convert 0~255 to 0~100
233 1 switch(S)
234 1 {
235 2 case 0:
236 2 if(temp != 0)
237 2 temp--;
238 2 else
239 2 temp = 0;
240 2 break;
C51 COMPILER V7.07 FUNCTION 09/26/2006 08:56:43 PAGE 5
241 2 case 1:
242 2 if(temp != 0x1F)
243 2 temp++;
244 2 else
245 2 temp = 0x1F;
246 2 break;
247 2 }
248 1 I2CWriteByte(HX8824_ADDR, HX8824_SHARPNESS, temp);
249 1 #if EEPROM
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_SHARPNESS)/256)*2), ParaAddress + EE_SHARPNESS, temp);
Puts_UART("Write to EEPROM device addr ");HexTobyStr(EEPROM_MCU | (((ParaAddress + EE_SHARPNESS)/256)*
-2));Puts_UART(byStr);Puts_UART("\r\n");
Puts_UART("Write to EEPROM address");HexTobyStr(ParaAddress + EE_SHARPNESS);Puts_UART(byStr);Puts_UART
-("\r\n");
Puts_UART("Write to EEPROM value");HexTobyStr(temp);Puts_UART(byStr);Puts_UART("\r\n");
#endif
255 1 OSDBarHandle(Item, 5, 6, 0x03, 0x05);
256 1 }
257
258 /* -------------------------------------------------------------------
259 Name : Contrast_Adj
260 Purpose : Adjust Contrast
261 Passed : Read/Write
262 Returns :
263 Notes :
264 ------------------------------------------------------------------- */
265 void Contrast_Adj(Byte S)
266 {
267 1 Word temp;
268 1 temp = I2CReadByte(HX8824_ADDR, HX8824_CONTRAST); // convert 0~255 to 0~100
269 1 temp = temp*100/255;
270 1 switch(S)
271 1 {
272 2 case 0:
273 2 if(temp > 0)
274 2 temp--;
275 2 if(temp != 0)
276 2 temp = temp*255/100 + 1;
277 2 else
278 2 temp = 0;
279 2 break;
280 2 case 1:
281 2 if(temp < 100)
282 2 temp++;
283 2 if(temp != 100)
284 2 temp = temp*255/100 + 1;
285 2 else
286 2 temp = 255;
287 2 break;
288 2 }
289 1 I2CWriteByte(HX8824_ADDR, HX8824_CONTRAST, temp);
290 1 #if EEPROM
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_CONTRAST)/256)*2), ParaAddress + EE_CONTRAST, temp);
#endif
293 1 OSDBarHandle(Item, 5, 6, 0x03, 0x05);
294 1 }
295
296 /* -------------------------------------------------------------------
297 Name : Bright_Adj
298 Purpose : Adjust Brightness
299 Passed : +/-
300 Returns :
C51 COMPILER V7.07 FUNCTION 09/26/2006 08:56:43 PAGE 6
301 Notes :
302 ------------------------------------------------------------------- */
303 void Bright_Adj(Byte S)
304 {
305 1 Word temp;
306 1 temp = I2CReadByte(HX8824_ADDR, HX8824_BRIGHTNESS); // convert 0~255 to 0~100
307 1 temp = temp*100/255;
308 1 switch(S)
309 1 {
310 2 case 0:
311 2 if(temp > 0)
312 2 temp--;
313 2 if(temp != 0)
314 2 temp = temp*255/100 + 1;
315 2 else
316 2 temp = 0;
317 2 break;
318 2 case 1:
319 2 if(temp < 100)
320 2 temp++;
321 2 if(temp != 100)
322 2 temp = temp*255/100 + 1;
323 2 else
324 2 temp = 255;
325 2 break;
326 2 }
327 1 I2CWriteByte(HX8824_ADDR, HX8824_BRIGHTNESS, temp);
328 1 #if EEPROM
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_BRIGHTNESS)/256)*2), ParaAddress + EE_BRIGHTNESS, temp);
#endif
331 1 OSDBarHandle(Item, 5, 6, 0x03, 0x05);
332 1 }
333
334 /* -------------------------------------------------------------------
335 Name : Sat_Sin_Hue_Adj
336 Purpose : Hue Saturation
337 Passed : +/-
338 Returns :
339 Notes :
340 ------------------------------------------------------------------- */
341 void Sat_Sin_Hue_Adj(Byte S)
342 {
343 1 long temp;
344 1 temp = (I2CReadByte(HX8824_ADDR, HX8824_SATSINHUE + 1) << 8) | I2CReadByte(HX8824_ADDR, HX8824_SATSINH
-UE); // convert 0~255 to 0~100
345 1 temp = temp*100/511;
346 1 switch(S)
347 1 {
348 2 case 0:
349 2 if(temp > 0)
350 2 temp--;
351 2 if(temp != 0)
352 2 temp = temp*511/100 + 1;
353 2 else
354 2 temp = 0;
355 2 break;
356 2 case 1:
357 2 if(temp < 100)
358 2 temp++;
359 2 if(temp != 100)
360 2 temp = temp*511/100 + 1;
361 2 else
C51 COMPILER V7.07 FUNCTION 09/26/2006 08:56:43 PAGE 7
362 2 temp = 511;
363 2 break;
364 2 }
365 1 I2CWriteByte(HX8824_ADDR, HX8824_SATSINHUE, temp);
366 1 I2CWriteByte(HX8824_ADDR, HX8824_SATSINHUE + 1, temp >> 8);
367 1 #if EEPROM
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_SAT_SIN_HUE)/256)*2), ParaAddress + EE_SAT_SIN_HUE, temp
-);
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_SAT_SIN_HUE)/256)*2), ParaAddress + EE_SAT_SIN_HUE + 1,
-temp >> 8);
#endif
371 1 OSDBarHandle(Item, 5, 6, 0x03, 0x05);
372 1 }
373
374 /* -------------------------------------------------------------------
375 Name : Sat_Cos_Hue_Adj
376 Purpose : Hue Saturation
377 Passed : +/-
378 Returns :
379 Notes :
380 ------------------------------------------------------------------- */
381 void Sat_Cos_Hue_Adj(Byte S)
382 {
383 1 long temp;
384 1 temp = (I2CReadByte(HX8824_ADDR, HX8824_SATCOSHUE + 1) << 8) | I2CReadByte(HX8824_ADDR, HX8824_SATCOSH
-UE); // convert 0~255 to 0~100
385 1 temp = temp*100/511;
386 1 switch(S)
387 1 {
388 2 case 0:
389 2 if(temp > 0)
390 2 temp--;
391 2 if(temp != 0)
392 2 temp = temp*511/100 + 1;
393 2 else
394 2 temp = 0;
395 2 break;
396 2 case 1:
397 2 if(temp < 100)
398 2 temp++;
399 2 if(temp != 100)
400 2 temp = temp*511/100 + 1;
401 2 else
402 2 temp = 511;
403 2 break;
404 2 }
405 1 I2CWriteByte(HX8824_ADDR, HX8824_SATCOSHUE, temp);
406 1 I2CWriteByte(HX8824_ADDR, HX8824_SATCOSHUE + 1, temp >> 8);
407 1 #if EEPROM
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_SAT_COS_HUE)/256)*2), ParaAddress + EE_SAT_COS_HUE, temp
-);
I2CWriteByte(EEPROM_MCU | (((ParaAddress + EE_SAT_COS_HUE)/256)*2), ParaAddress + EE_SAT_COS_HUE + 1,
-temp >> 8);
#endif
411 1 OSDBarHandle(Item, 5, 6, 0x03, 0x05);
412 1 }
413
414 /* -------------------------------------------------------------------
415 Name : OSD_Pos_Adj
416 Purpose : Adjust OSD position
417 Passed : +/-
418 Returns :
C51 COMPILER V7.07 FUNCTION 09/26/2006 08:56:43 PAGE 8
419 Notes :
420 ------------------------------------------------------------------- */
421
422 void OSD_Pos_Adj(Byte S)
423 {
424 1 switch(S)
425 1 {
426 2 case 0:
427 2 if(bOSDPOS > 0)
428 2 bOSDPOS--;
429 2 break;
430 2 case 1:
431 2 if(bOSDPOS < 4)
432 2 bOSDPOS++;
433 2 break;
434 2 }
435 1 I2CWrite2Byte(HX8824_ADDR, HX8824_BLOCK_POS_X, OSDPOSITION[bOSDPOS][0], OSDPOSITION[bOSDPOS][0] >> 8);
436 1 I2CWrite2Byte(HX8824_ADDR, HX8824_BLOCK_POS_Y, OSDPOSITION[bOSDPOS][1], OSDPOSITION[bOSDPOS][1] >> 8);
437 1 }
438 /* -------------------------------------------------------------------
439 Name : VGA Set_Border
440 Purpose : Set Border in VGA mode display
441 Passed : +/-
442 Returns :
443 Notes :
444 ------------------------------------------------------------------- */
445 void VGA_SetBorder(Byte S)
446 {
447 1 switch(S)
448 1 {
449 2 case 0: // border screen
450 2 I2CWriteByte(HX8824_ADDR, 0x20, 0x00);
451 2 I2CWriteByte(HX8824_ADDR, 0x21, 0x10);
452 2 I2CWriteByte(HX8824_ADDR, 0x22, 0xFF);
453 2 I2CWriteByte(HX8824_ADDR, 0x23, 0x0F);
454 2 I2CWriteByte(HX8824_ADDR, 0x20, 0x00);
455 2 I2CWriteByte(HX8824_ADDR, 0x21, 0x10);
456 2 I2CWriteByte(HX8824_ADDR, 0x22, 0xFF);
457 2 I2CWriteByte(HX8824_ADDR, 0x23, 0x1F);
458 2 I2CWriteByte(HX8824_ADDR, 0x24, 0x50);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -