⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t101_util.lst

📁 t112 参考文件
💻 LST
📖 第 1 页 / 共 3 页
字号:
 417          void TconInit(void)
 418          {
 419   1              uCHAR TconIndex;
 420   1              
 421   1              #ifdef ANALOG_PANEL     
 422   1              for(TconIndex=0;TconIndex < P1TconCnt;TconIndex++)
C51 COMPILER V7.50   T101_UTIL                                                             01/12/2006 13:31:12 PAGE 8   

 423   1                      I2CWriteByte(TW101+2, TconAddress+TconIndex, TconP1Data[TconIndex]);
 424   1              for(TconIndex=0;TconIndex < P0TconCnt;TconIndex++)
 425   1                      I2CWriteByte(TW101,stTconT10xP0[TconIndex].ucRegAdr,stTconT10xP0[TconIndex].ucRegVal);
 426   1          #else  // DIGITAL_PANEL
                      for(TconIndex=0;TconIndex < P1TconCnt;TconIndex++)
                              I2CWriteByte(TW101+2, TconAddress+TconIndex, TconP1Data[TconIndex]);
                  #endif  
 430   1      }
 431          #endif
 432          
 433          #ifdef ROTATE
 434          void SET_Dismod(void)
 435          {
 436   1              switch (Dis_Mode){ 
 437   2                      case  TOP_LEFT: //Start from top-left
 438   2                              #ifdef ANALOG_PANEL
 439   2                                      I2CWriteByte(TW101,0xE1, ScanMode[0]);
 440   2                              #else
                                              UP_DOWN    = DigiPanlScanMode[0]>>1;   
                                              LEFT_RIGHT = DigiPanlScanMode[0]&0x01; 
                                              I2CWriteByte(TW101,0xE1, ScanMode[0]&0xF0);
                                      #endif                          
 445   2                              break;  
 446   2                      case  TOP_RIGHT: //Start from top-right
 447   2                              #ifdef ANALOG_PANEL
 448   2                                      I2CWriteByte(TW101,0xE1, ScanMode[1]);
 449   2                              #else
                                              UP_DOWN    = DigiPanlScanMode[1]>>1;   
                                              LEFT_RIGHT = DigiPanlScanMode[1]&0x01; 
                                              I2CWriteByte(TW101,0xE1, ScanMode[1]&0xF0);
                                      #endif
 454   2                              break;
 455   2                      case  BOTTOM_RIGHT:  //Start from bottom-right
 456   2                              #ifdef ANALOG_PANEL
 457   2                                      I2CWriteByte(TW101,0xE1, ScanMode[2]);
 458   2                              #else
                                              UP_DOWN    = DigiPanlScanMode[2]>>1;   
                                              LEFT_RIGHT = DigiPanlScanMode[2]&0x01; 
                                              I2CWriteByte(TW101,0xE1, ScanMode[2]&0xF0);
                                      #endif
 463   2                              break;                                                                  
 464   2                      case  BOTTOM_LEFT: //Start from bottom-left
 465   2                              #ifdef ANALOG_PANEL
 466   2                                      I2CWriteByte(TW101,0xE1, ScanMode[3]);
 467   2                              #else
                                              UP_DOWN    = DigiPanlScanMode[3]>>1;   
                                              LEFT_RIGHT = DigiPanlScanMode[3]&0x01; 
                                              I2CWriteByte(TW101,0xE1, ScanMode[3]&0xF0);
                                      #endif
 472   2                              break;
 473   2              }
 474   1              #ifdef OUT_PIN_CONF
                      I2CWriteByte(TW101,0xE1, OUT_PIN_CONF);
                      #endif  
 477   1              return;
 478   1      }
 479          #endif
 480          
 481          void SourceSelect(void)
 482          {
 483   1      
 484   1              cSVideo=0;
C51 COMPILER V7.50   T101_UTIL                                                             01/12/2006 13:31:12 PAGE 9   

 485   1              I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)|(PSYNC_STR|IGNORE_VSYNC));
 486   1              I2CWriteByte(TW101, 0x9d, 0x10);
 487   1              I2CWriteByte(TW101, 0x9e, 0xff);
 488   1              I2CWriteByte(TW101, 0x9f, 0x40);
 489   1              I2CWriteByte(TW101, PATTERN_CTRL, 0x87);
 490   1              if((m_cSource&0x0F)>=isrcSVIDEO){
 491   2                      cSVideo=5;  // circuit --> 4 , test result -> 1
 492   2              }
 493   1              if(cSVideo){
 494   2                      I2CWriteByte(TW101,0x11, cSVideo);       
 495   2                      I2CWriteByte(TW101+4,0x07, 0x05|0x22);//0x06|0x22);
 496   2              }
 497   1              else{   //CVBS
 498   2                      I2CWriteByte(TW101,0x11, 0x00);  
 499   2                      I2CWriteByte(TW101+4,0x07, 0x02|0x20);//0x23);//  930729
 500   2              }
 501   1              I2CWriteByte(TW101,0x0f,0x70);  //2005-03030 for position shift
 502   1              I2CWriteByte(TW101,0x31,0x00);
 503   1              I2CWriteByte(TW101,0x1a, 0x87);
 504   1              I2CWriteByte(TW101,0x18, uiaSrcMux[m_cSource&0x0F]>>8);  // cMux1);
 505   1              I2CWriteByte(TW101,0x19, uiaSrcMux[m_cSource&0x0F]&0xFF);  // cMux2);       
 506   1              I2CWriteByte(TW101,0x0f,0x00);  //2005-03030 for position shift
 507   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){
                                      NoSignal=0;
                                      I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC));
                                      I2CWriteByte(TW101, PATTERN_CTRL, 0x00);
                              }
                      }
              #else
 535   1              twdDelay(500);
 536   1              if(I2CReadByte(TW101+4, 0x3A)&0x06){
 537   2                      NoSignal=0;
 538   2                      I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC));
 539   2                      I2CWriteByte(TW101, PATTERN_CTRL, 0x00);
 540   2              }
 541   1      #endif
 542   1              
 543   1              I2CWriteByte(TW101, 0xE2, 0x11);
 544   1              
 545   1      }
 546          
C51 COMPILER V7.50   T101_UTIL                                                             01/12/2006 13:31:12 PAGE 10  

 547          
 548          void DetectSignalStd(void)
 549          {
 550   1              uCHAR index=0,tmp,SlaveAddr,RegAddrShift;
 551   1      
 552   1      #ifdef T515
                      if(m_cSource >= isrc_T515_CVIDEO1){
                               SlaveAddr=0xb8;
                               RegAddrShift=0x20;
                      }else{
                               SlaveAddr=0x54;
                               RegAddrShift=0x00;
                      }       
              #else
 561   1              SlaveAddr=0x54;
 562   1              RegAddrShift=0x00;              
 563   1      #endif  
 564   1      
 565   1              m_cBuff[0]=m_cStandard; 
 566   1              if(I2CReadByte(SlaveAddr, 0x3A+RegAddrShift)&0x06)              // Judge vlock and hlock
 567   1              {       
 568   2                      if(I2CReadByte(SlaveAddr, 0x7B+RegAddrShift)>0x10){//  For no chroma case
 569   3                              twdDelay1(25);
 570   3                              if(I2CReadByte(TW101,0x59) <= 0xd6)
 571   3                                      m_cBuff[0]=S_NTSC;  
 572   3                              else    
 573   3                                      m_cBuff[0]=S_PAL;   
 574   3                      } 
 575   2                      else {                                                          // For having chroma case
 576   3      #ifdef T515
                              if((m_cSource&0x0f) >= isrc_T515_CVIDEO1){
                                  m_cBuff[0] = I2CReadByte(TW515, 0x5c)&0x04;
                                      //else if((m_cSource&0x0f) >= isrc_T515_CVIDEO1){
                                              if((I2CReadByte(TW515, 0x5c)&0x07)==0)
                                                      m_cBuff[0]=S_NTSC;
                                  else if(I2CReadByte(TW515, 0x5c)&0x02)
                                                      m_cBuff[0]=S_SECAM;
                                      else if(I2CReadByte(TW515, 0x5c)&0x04)
                                                      m_cBuff[0]=S_PAL;
                                              else  
                                                      m_cBuff[0]=0xff;
                                      }
                                      else{
              #endif  
 591   3                              twdDelay1(25);  
 592   3                              // Set Chroma lock configration
 593   3                              if(I2CReadByte(TW101,0x59) >= 0xd8)         
 594   3                                      I2CWriteByte(SlaveAddr, 0x83+RegAddrShift, 0x39);  // PAL
 595   3                              else    
 596   3                                      I2CWriteByte(SlaveAddr, 0x83+RegAddrShift, 0x6f);  // NTSC      
 597   3                              twdDelay1(50);  
 598   3                              
 599   3                              // Seperate NTSC,Pal,Secam
 600   3                              if(I2CReadByte(TW101,0x59) <= 0xd6)     
 601   3                                      m_cBuff[0]=S_NTSC; 
 602   3                          else {
 603   4                                      if(I2CReadByte(SlaveAddr, 0x3c+RegAddrShift)&0x04){     // Detect 625 lines
 604   5                                              m_wBuff[2]=0;
 605   5                                              m_cBuff[1]=m_cStandard;                         // Preserve previous status for signal std      
 606   5                                              //twdDelay1(550);       
 607   5                                              while(!(tmp=I2CReadByte(SlaveAddr, 0x3a+RegAddrShift)&0x08)){   // If chroma not locked, change PAL/SEC
             -AM
C51 COMPILER V7.50   T101_UTIL                                                             01/12/2006 13:31:12 PAGE 11  

 608   6                                                      if (m_cStandard == S_PAL)
 609   6                                                              m_cStandard=S_SECAM;
 610   6                                                      else
 611   6                                                              m_cStandard=S_PAL;
 612   6                                                      SetSignalStd();                                 // Set Signal flag and DTO
 613   6                                                      twdDelay1(50);
 614   6                                                      if ((++m_wBuff[2]) >4) break;   // Avoid while setting, input switch to NTSC
 615   6                                              }
 616   5                                              if (m_cBuff[1] != m_cStandard){
 617   6                                                      if ((I2CReadByte(SlaveAddr, 0x3a+RegAddrShift)&0x08))
 618   6                                                              m_cBuff[0] = m_cStandard;
 619   6                                                      m_cStandard=m_cBuff[1] ;
 620   6                                              }
 621   5                                      }
 622   4                              }
 623   3      #ifdef T515                     
                                      }
              #endif  
 626   3                      }          
 627   2              }// 癹伴い

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -