📄 initial.lst
字号:
}
while (MCU_ReadRtdReset()!=HIGH);
#endif
#endif
260 1
261 1
262 1
263 1 // Initial RTD3000 & free background display
264 1 RTDCodeW(RTD_PWUP_INI);
265 1 #if(HDCP_ENABLE)
RTDCodeW(BKSV);
KEYCodeW(HDCP_KEY_A_Port);
#endif
269 1
270 1 RTDCodeW(RTD_DDC_TABLE);
271 1 RTDCodeW(RTD_IO_INI);
272 1
273 1 RTDSetByte(HOSTCTRL_02, 0x40); // Wake RTD up
274 1
275 1 RTDCodeW(FreeV);
276 1
277 1 RTDSetByte(VDIS_SIGINV_21, 0x00 | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP); // DHS, DVS, DEN,
- DCLK MUST NOT be inverted.
278 1
279 1
280 1 RTDSetBit(VDIS_CTRL_20, 0xfd, 0x01); // DHS, DVS, DEN, DCLK and data are clamped to 0
281 1
282 1 // Initial RTD3000-OSD
283 1 RTDCodeW(OSD_PWUP_INI);
284 1 RTDOSDW(OSD_Reset);
285 1
286 1 // Initial OSD palette
287 1 RTDCodeW(Palette_Open);
288 1 RTDCodeW(Palette_7);
289 1 RTDCodeW(Palette_Close);
290 1
291 1
292 1
293 1
294 1 // Check and initial EEPROM if necessary
295 1 // Delay_Xms(10);
296 1 // Check_EEPROM();
297 1 // Delay_Xms(10);
298 1
299 1 Set_Gamma();
300 1 Set_Dithering();
C51 COMPILER V7.06 INITIAL 11/21/2005 13:47:24 PAGE 6
301 1 Set_Bright_Contrast();
302 1 }
303
304 void Init_Input_Source(void)
305 {
306 1 ucMode_Found = MODE_NOSUPPORT;
307 1 ucMode_Curr = MODE_NOSIGNAL;
308 1 ucMode_Times = 0;
309 1 ucAV_Mode = 0;
310 1 bVpole_Curr = 1; // The initial set of polarity is positive
311 1 bHpole_Curr = 1; // The initial set of polarity is positive
312 1
313 1 // Unknown signal source
314 1 if (SOURCE_MAX < (stGUD1.INPUT_SOURCE & 0x07))
315 1 stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | SOURCE_VGA;
316 1
317 1 #if (TMDS_ENABLE == _FALSE)
if (SOURCE_DVI == (stGUD1.INPUT_SOURCE & 0x07))
stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | SOURCE_VGA;
#endif
321 1
322 1 #if (VIDEO_CHIP == VDC_NONE)
323 1 if (SOURCE_AV == (stGUD1.INPUT_SOURCE & 0x07) || SOURCE_SV == (stGUD1.INPUT_SOURCE & 0x07))
324 1 stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | SOURCE_VGA;
325 1 #endif
326 1 #if (VIDEO_CHIP != VDC_SAA7118)
327 1 if (SOURCE_YUV == (stGUD1.INPUT_SOURCE & 0x07))
328 1 stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | SOURCE_VGA;
329 1 #endif
330 1 #if (TV_CHIP == TV_NONE)
331 1 if (SOURCE_TV == (stGUD1.INPUT_SOURCE & 0x07))
332 1 stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | SOURCE_VGA;
333 1 #endif
334 1
335 1 // Because internal ADC power state will not affect VGA mode detection,
336 1 // we always turn off ADC when source changed, and turn it on again only
337 1 // when a valid VGA mode is going to display.
338 1 PowerDown_ADC();
339 1 //Device_Power(ADC_POWER,OFF);
340 1
341 1 #if(SOURCE_AUTO_SCAN)
342 1 PowerUp_VDC();
343 1 Delay_Xms(10);
344 1 #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
I2CWrite(V_ENABLE); // VIDEO ENABLE
I2CWrite(VIDEO_ALL);
#endif
348 1 bSourceScanEnable = _TRUE;
349 1 #endif
350 1
351 1 switch (stGUD1.INPUT_SOURCE & 0x07)
352 1 {
353 2 case SOURCE_VGA:
354 2 #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
I2CWrite(V_DISABLE); // VIDEO DISABLE
#endif
357 2 I2CWrite(V_NOWORK); // VIDEO No Work
358 2
359 2 #if(!SOURCE_AUTO_SCAN)
PowerDown_VDC();
PowerDown_TMDS();
//Device_Power(VDC_POWER,OFF);
C51 COMPILER V7.06 INITIAL 11/21/2005 13:47:24 PAGE 7
//Device_Power(TMDS_POWER,OFF);
#else
365 2 PowerUp_VDC();
366 2 PowerUp_TMDS();
367 2 //Device_Power(VDC_POWER,ON);
368 2 //Device_Power(TMDS_POWER,ON);
369 2 #endif
370 2
371 2 #if(TMDS_ENABLE)
372 2 RTDSetBit(TMDS_CORRECTION_FF,0xfc,0x00);
373 2 #endif
374 2 // Set user's ADC gain and offset settings
375 2 SetADC_GainOffset();
376 2
377 2 ucInputSrc = SOURCE_VGA;
378 2 ucSync_Type = SYNC_SS;
379 2
380 2 RTDCodeW(VGA_INI_SS);
381 2 break;
382 2 case SOURCE_DVI:
383 2 #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
I2CWrite(V_DISABLE); // VIDEO DISABLE
#endif
386 2 I2CWrite(V_NOWORK); // VIDEO No Work
387 2
388 2 #if(!SOURCE_AUTO_SCAN)
PowerDown_VDC();
//Device_Power(VDC_POWER,OFF);
#else
392 2 PowerUp_VDC();
393 2 //Device_Power(VDC_POWER,ON);
394 2 #endif
395 2
396 2 #if(TMDS_ENABLE)
397 2 RTDSetBit(TMDS_CORRECTION_FF,0xfc,0x00);
398 2 #endif
399 2 PowerUp_TMDS();
400 2 //Device_Power(TMDS_POWER,ON);
401 2
402 2 ucInputSrc = SOURCE_DVI;
403 2 RTDCodeW(DVI_INI);
404 2 break;
405 2 case SOURCE_AV:
406 2 case SOURCE_TV:
407 2 #if(SOURCE_AUTO_SCAN)
408 2 if((SOURCE_AV != MASTER_SOURCE) && (SOURCE_AV != SLAVE_SOURCE) && (SOURCE_AV != THIRD_SOURCE))
409 2 bSourceScanEnable = _FALSE;
410 2 #endif
411 2 PowerUp_VDC();
412 2
413 2 #if(TMDS_ENABLE)
414 2 RTDSetBit(TMDS_CORRECTION_FF,0xfc,0x00);
415 2 #endif
416 2 //Device_Power(VDC_POWER,ON);
417 2
418 2 // PCB rev.C
419 2 // For PCB rev.C, turning down TMDS will turning on video decoder.
420 2 // However, video decoder needs times to wake up.
421 2 Delay_Xms(10);
422 2
423 2 #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
I2CWrite(V_ENABLE); // VIDEO ENABLE
C51 COMPILER V7.06 INITIAL 11/21/2005 13:47:24 PAGE 8
I2CWrite(VIDEO_ALL);
#endif
427 2 I2CWrite(AV_DETECT); // VIDEO Detect(AV)
428 2
429 2 if (SOURCE_AV == (stGUD1.INPUT_SOURCE & 0x07))
430 2 {
431 3 ucInputSrc = SOURCE_AV;
432 3 }
433 2 else
434 2 {
435 3 ucInputSrc = SOURCE_TV;
436 3
437 3 #if (TV_CHIP != TV_NONE)
// Set TV channel
Set_TV_Channel();
#endif
441 3 // Select TV signal input pin and disable AGC of video decoder
442 3 I2CWrite(TV_SOURCE_SEL);
443 3 I2CWrite(TV_SCAN_GAIN);
444 3 }
445 2
446 2 RTDCodeW(VIDEO_INI);
447 2 I2CRead(ADDR_VIDEO, 0x1f, 0x01);
448 2 break;
449 2
450 2 case SOURCE_SV:
451 2 #if(SOURCE_AUTO_SCAN)
452 2 if((SOURCE_SV != MASTER_SOURCE) && (SOURCE_SV != SLAVE_SOURCE) && (SOURCE_SV != THIRD_SOURCE))
453 2 bSourceScanEnable = _FALSE;
454 2 #endif
455 2
456 2 PowerUp_VDC();
457 2 //Device_Power(VDC_POWER,ON);
458 2
459 2
460 2 Delay_Xms(10);
461 2
462 2 #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
I2CWrite(V_ENABLE); // VIDEO ENABLE
I2CWrite(VIDEO_ALL);
#endif
466 2 I2CWrite(SV_DETECT); // VIDEO Detect(SV)
467 2
468 2 ucInputSrc = SOURCE_SV;
469 2 RTDCodeW(VIDEO_INI);
470 2 I2CRead(ADDR_VIDEO, 0x1f, 0x01);
471 2 break;
472 2
473 2 case SOURCE_YUV:
474 2 #if(SOURCE_AUTO_SCAN)
475 2 if((SOURCE_YUV != MASTER_SOURCE) && (SOURCE_YUV != SLAVE_SOURCE) && (SOURCE_YUV != THIRD_SOURCE))
476 2 bSourceScanEnable = _FALSE;
477 2 #endif
478 2
479 2 PowerUp_VDC();
480 2 //Device_Power(VDC_POWER,ON);
481 2
482 2
483 2 Delay_Xms(10);
484 2
485 2 I2CWrite(V_ENABLE); // VIDEO ENABLE
486 2 I2CWrite(VIDEO_ALL);
C51 COMPILER V7.06 INITIAL 11/21/2005 13:47:24 PAGE 9
487 2 I2CWrite(VIDEO_YUV);
488 2
489 2 I2CWrite(YUV_DETECT); // VIDEO Detect(YUV)
490 2
491 2 ucInputSrc = SOURCE_YUV;
492 2 RTDCodeW(VIDEO_INI);
493 2 I2CRead(ADDR_VIDEO, 0x1f, 0x01);
494 2 break;
495 2 }
496 1
497 1 #if (AUDIO_TYPE != AUDIO_NONE)
498 1 SetVolume();
499 1 #endif
500 1 }
501 void Power_Status_Init(void)
502 {
503 1 #if (POWER_KEY_TYPE == TYPE_ONE_TOUCH)
504 1
505 1 #if (KEY_DISABLED == POWER_KEY_MASK)
// Force system to power up when no power-key
bPower_Status = 1;
Power_Up_Init();
bStable = 0; // Assume input signal is not stable when power up
bReload = 1; // Always reload font when power up
bFrameSync = 0; // Not sync yet
ucModeCnt = MODE_DETECT_FREQ; // Reset Input Mode Detector
Measure_Mode(); // Measure mode-timing
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -