📄 t101_util.lst
字号:
420 uCHAR NoSignal=0;
421 uCHAR SignalDefine=0x00|SS_NTSC|SS_PAL|SS_SECAM|SS_NTSC_4|SS_PAL_M|SS_PAL_CN;
422 #ifdef ROTATE
423 #if (defined T101A)|(defined T101)
C51 COMPILER V7.50 T101_UTIL 06/16/2006 15:29:43 PAGE 8
uCHAR Dis_Mode=BOTTOM_RIGHT;
#else
426 uCHAR Dis_Mode=TOP_LEFT;
427 #endif
428 #endif
429
430 /****************************************************************************
431 * Public Function *
432 ****************************************************************************/
433 void InitT10x(void)
434 {
435 1 uCHAR RegIndex,RegAdr;
436 1
437 1 RegIndex=0;
438 1 RegAdr=stInitT10xP0[0].ucRegAdr;
439 1 while (RegAdr != 0xFF) // bruce, 2006/01/09
440 1 {
441 2 if(RegAdr==0x30){
442 3 I2CWriteByte(TW101,RegAdr,(I2CReadByte(TW101,0x30)|0x01)); // enable Shadow
443 3 I2CWriteByte(TW101,RegAdr,(I2CReadByte(TW101,0x30)&(~0x02))| DEINTERLACE); //Bruce, 2006/01/10
444 3 }
445 2 else{
446 3 I2CWriteByte(TW101,RegAdr,stInitT10xP0[RegIndex].ucRegVal);
447 3 }
448 2 RegAdr=stInitT10xP0[++RegIndex].ucRegAdr;
449 2 }
450 1
451 1 #ifdef T116
I2CWriteByte(TW101, 0xE0, 0xA9); //kenny, 20060301
#endif
454 1 RegIndex=0;
455 1 RegAdr=stInitT10xP2[0].ucRegAdr;
456 1 while (RegAdr != 0xFF) // bruce, 2006/01/09
457 1 {
458 2 if(RegAdr==0x01)
459 2 I2CWriteByte(TW101+4,RegAdr,(I2CReadByte(TW101+4,0x01)|0x01));// enable black level correction for 10 b
-lank-to-black pedestal
460 2 else
461 2 I2CWriteByte(TW101+4,RegAdr,stInitT10xP2[RegIndex].ucRegVal);
462 2 RegAdr=stInitT10xP2[++RegIndex].ucRegAdr;
463 2 }
464 1 //=========================================================================
465 1 // Panel specified register settings
466 1 //=========================================================================
467 1 //#if (EMPTY_ARRAY)
468 1 for(RegIndex=0;RegIndex < PanelSpecP0Cnt;RegIndex++)
469 1 {
470 2 I2CWriteByte(TW101,ucaPanelSpecAdrP0[RegIndex],ucaPanelSpecDataP0[RegIndex]);
471 2 }
472 1 //#endif
473 1
474 1 for(RegIndex=0;RegIndex < PanelSpecP2Cnt;RegIndex++)
475 1 {
476 2 I2CWriteByte(TW101+4,ucaPanelSpecAdrP2[RegIndex],ucaPanelSpecDataP2[RegIndex]);
477 2 }
478 1 #ifdef ROTATE
479 1 SET_Dismod();
480 1 #endif
481 1 }
482
483 #ifdef TCON
484 void TconInit(void)
C51 COMPILER V7.50 T101_UTIL 06/16/2006 15:29:43 PAGE 9
485 {
486 1 uCHAR TconIndex;
487 1
488 1 for(TconIndex=0;TconIndex < P1TconCnt;TconIndex++)
489 1 I2CWriteByte(TW101+2, TconAddress+TconIndex, TconP1Data[TconIndex]);
490 1 }
491 #endif
492
493 #ifdef ROTATE
494 void SET_Dismod(void)
495 {
496 1 switch (Dis_Mode){
497 2 case TOP_LEFT: //Start from top-left
498 2 #ifdef ANALOG_PANEL
499 2 I2CWriteByte(TW101,0xE1, ScanMode[0]);
500 2 #else
UP_DOWN = DigiPanlScanMode[0]>>1;
LEFT_RIGHT = DigiPanlScanMode[0]&0x01;
I2CWriteByte(TW101,0xE1, ScanMode[0]&0xF0);
#endif
505 2 break;
506 2 case TOP_RIGHT: //Start from top-right
507 2 #ifdef ANALOG_PANEL
508 2 I2CWriteByte(TW101,0xE1, ScanMode[1]);
509 2 #else
UP_DOWN = DigiPanlScanMode[1]>>1;
LEFT_RIGHT = DigiPanlScanMode[1]&0x01;
I2CWriteByte(TW101,0xE1, ScanMode[1]&0xF0);
#endif
514 2 break;
515 2 case BOTTOM_RIGHT: //Start from bottom-right
516 2 #ifdef ANALOG_PANEL
517 2 I2CWriteByte(TW101,0xE1, ScanMode[2]);
518 2 #else
UP_DOWN = DigiPanlScanMode[2]>>1;
LEFT_RIGHT = DigiPanlScanMode[2]&0x01;
I2CWriteByte(TW101,0xE1, ScanMode[2]&0xF0);
#endif
523 2 break;
524 2 case BOTTOM_LEFT: //Start from bottom-left
525 2 #ifdef ANALOG_PANEL
526 2 I2CWriteByte(TW101,0xE1, ScanMode[3]);
527 2 #else
UP_DOWN = DigiPanlScanMode[3]>>1;
LEFT_RIGHT = DigiPanlScanMode[3]&0x01;
I2CWriteByte(TW101,0xE1, ScanMode[3]&0xF0);
#endif
532 2 break;
533 2 }
534 1 #ifdef OUT_PIN_CONF
I2CWriteByte(TW101,0xE1, OUT_PIN_CONF);
#endif
537 1 return;
538 1 }
539 #endif
540
541 void SourceSelect(void)
542 {
543 1
544 1 I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)|(PSYNC_STR|IGNORE_VSYNC));
545 1 I2CWriteByte(TW101, 0x9d, 0x10);
546 1 I2CWriteByte(TW101, 0x9e, 0xff);
C51 COMPILER V7.50 T101_UTIL 06/16/2006 15:29:43 PAGE 10
547 1 I2CWriteByte(TW101, 0x9f, 0x40);
548 1 I2CWriteByte(TW101, PATTERN_CTRL, 0x87);
549 1 I2CWriteByte(TW101,0x0f,0x70); //2005-03030 for position shift
550 1
551 1 I2CWriteByte(TW101,0x0f,0x00); //2005-03030 for position shift
552 1 I2CWriteByte(TW101,0x31,0x00);
553 1 I2CWriteByte(TW101,0x1a, 0x87);
554 1 I2CWriteByte(TW101,0x18, uiaSrcMux[(m_cSource&0x0F)*2]>>8); // cMux1);
555 1 I2CWriteByte(TW101,0x19, uiaSrcMux[(m_cSource&0x0F)*2]&0xFF); // cMux2);
556 1 if(uiaSrcMux[(m_cSource&0x0F)*2+1]==itypeSVIDEO)
557 1 {
558 2 #ifdef T112
559 2 I2CWriteByte(TW101,0x11, 0x22);
560 2 #else
I2CWriteByte(TW101,0x11, 0x05);
#endif
563 2 I2CWriteByte(TW101+4,0x07, 0x24);//0x05|0x22);
564 2 I2CWriteByte(TW101+4,0x00, I2CReadByte(TW101+4,0x00)|0x01);
565 2 I2CWriteByte(TW101+4,0x01, I2CReadByte(TW101+4,0x01)&~ENYPbPr);
566 2 I2CWriteByte(TW101+4,0x03, I2CReadByte(TW101+4,0x03)|0x03);
567 2 }
568 1 else if (uiaSrcMux[(m_cSource&0x0F)*2+1]==itypeCVBS)
569 1 {
570 2 I2CWriteByte(TW101,0x11, 0x00);
571 2 I2CWriteByte(TW101+4,0x07, 0x20);//0x05|0x22);
572 2 I2CWriteByte(TW101+4,0x00, I2CReadByte(TW101+4,0x00)&0xfe);
573 2 I2CWriteByte(TW101+4,0x01, I2CReadByte(TW101+4,0x01)&~ENYPbPr);
574 2
575 2 if(m_cChroma==S_NTSC_4) // temporarily add by Sherman 06'01'27
576 2 I2CWriteByte(TW101+4,0x03, I2CReadByte(TW101+4,0x03)&0xf8|0x03);
577 2 else
578 2 I2CWriteByte(TW101+4,0x03, I2CReadByte(TW101+4,0x03)&0xfc);
579 2 }
580 1 else if (uiaSrcMux[(m_cSource&0x0F)*2+1]==itypeYPBPR)
581 1 {
582 2 I2CWriteByte(TW101,0x11, 0x55);
583 2 I2CWriteByte(TW101+4,0x07, 0x20);
584 2 I2CWriteByte(TW101+4,0x01, I2CReadByte(TW101+4,0x01)|ENYPbPr);
585 2 }
586 1
587 1 #ifdef T515
if ( (m_cSource&0x0F)< isrc_T515_CVIDEO1){
if(cSVideo)
I2CWriteByte(TW101+4,0x07, 0x06|0x02);//|0x22
else
I2CWriteByte(TW101+4,0x07, 0x02);// 930729//|0x20
}else{
DetectSignalStd(); // add by Sherman 06'01'03
SRC_656();
}
if((m_cSource&0x0F)>=isrcSVIDEO){
I2CWriteByte(TW101+4,0x02, 0x4B);
I2CWriteByte(TW101,0x1a, 0x87);
}
twdDelay(300);
if((m_cSource&0x0F)>=isrc_T515_CVIDEO1){
NoSignal=0;
I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC));
I2CWriteByte(TW101, PATTERN_CTRL, 0x00);
}else{
if(I2CReadByte(TW101+4, 0x3A)&0x06){
C51 COMPILER V7.50 T101_UTIL 06/16/2006 15:29:43 PAGE 11
NoSignal=0;
I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC));
I2CWriteByte(TW101, PATTERN_CTRL, 0x00);
}
}
#else
615 1 twdDelay(500);
616 1 if(I2CReadByte(TW101+4, 0x3A)&0x06){
617 2 NoSignal=0;
618 2 I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC));
619 2 I2CWriteByte(TW101, PATTERN_CTRL, 0x00);
620 2 }
621 1 #endif
622 1 I2CWriteByte(TW101, 0xE2, 0x11);
623 1 }
624
625
626 void DetectSignalStd(void)
627 {
628 1 uCHAR index=0,SlaveAddr,RegAddrShift;//,line_525;//,tmp;
629 1
630 1 #ifdef T515
if(m_cSource >= isrc_T515_CVIDEO1){
SlaveAddr=0xb8;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -