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

📄 t101_util.lst

📁 宏芯T102芯片驱动(51单片机作主控)
💻 LST
📖 第 1 页 / 共 3 页
字号:
                      #else
 580   3                                      Hcut=10;
 581   3              #endif 
 582   3      
 583   3                                      m_wVRes=280;  //ruby 2004-08-18
 584   3                      m_wHRes=720-2*Hcut;
 585   3      #ifdef AU_12
                              m_wHRes=698;
              #endif
 588   3                      }
 589   2      
 590   2                      I2CWriteByte(TW101,0x40,Hcut);  //Ruby 2004-08-23  0x00);
 591   2              I2CWriteByte(TW101,0xD8,((H_Size-H_Size43)/2)); // 0x53);//Kuo Horizontal Main Display Start
 592   2      #ifdef T515
                case Scale1_1:
              #ifdef KVGA
                       if(m_cStandard)
                                              I2CWriteByte(TW101+4,0x2E,0x8A); //0x82); //setup video decoder h start == 130
                       else
                                              I2CWriteByte(TW101+4,0x2E,0x84); //0x82); //setup video decoder h start == 130
                              
              #endif
              #ifdef WVGA
                              I2CWriteByte(TW101+4,0x2E,0x88); //0x82); //setup video decoder h start == 130
              #endif
              #ifdef WXGA 
              #ifdef AU_12
                                              I2CWriteByte(TW101+4,0x2E,0x94);//Kuo 0x88 0x94
              #else
                                              I2CWriteByte(TW101+4,0x2E,0x76);
              #endif
              #endif
              #ifdef AU_12
                                      I2CWriteByte(TW101+4,0x2F,0x3a); //0x50); //Setup video decoder h active 720
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 11  

              #else
              
                          I2CWriteByte(TW101+4,0x2F,0x50); //0x50); //Setup video decoder h active 720 玡狠
              #endif
              //                      I2CWriteByte(TW101+4,0x30, 0x24); //setup video decoder v start 
              //                      I2CWriteByte(TW101+4,0x31, 0x61); //Setup video decoder v active 480
              
                                      if(!m_cStandard)
                                      {
                                              m_wVRes=240-2*DELAY_LINES;
              
              #ifdef AU_12
                              m_wHRes=698;
              #endif
              
                  #ifdef KVGA
                                              m_wVRes=240;  //ruby 2004-08-18
                                              Hcut=10;
                              m_wHRes=720-2*Hcut;
              
                      #else
                              m_wHRes=706;
                      #endif
                          
              
                                      }
                                      else
                                      {       
                                              m_wVRes=240;
              #ifdef AU_12
                              m_wHRes=698;
              #endif
               
                  #ifdef KVGA
                                              m_wVRes=280;  //ruby 2004-08-18
                                              Hcut=10;
                              m_wHRes=720-2*Hcut;
              
                      #else
                              m_wHRes=704;
                      #endif
              
                              }
               
                                      I2CWriteByte(TW101,0xDC, (m_wHRes));//Kuo
                                      I2CWriteByte(TW101,0xDD, (m_wHRes)>>8); 
              
                                      I2CWriteByte(TW101,0xDE, (V_Size)); 
                                      I2CWriteByte(TW101,0xDF, (V_Size>>8));          
                              #ifdef T100
              
                      I2CWriteByte(TW101,0x30,0x8b);
                              I2CWriteByte(TW101,0x40,Hcut);  //Ruby 2004-08-23  0x00);
              
                      I2CWriteByte(TW101,0x70,0x90);
              
                              #endif
                              I2CWriteByte(TW101,0xB2, 0x23); 
                      break;
              #endif
 673   2        }
 674   1        I2CWriteByte(TW101,0x54,m_wHRes);
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 12  

 675   1        I2CWriteByte(TW101,0x55,m_wHRes>>8);
 676   1        I2CWriteByte(TW101,0x56,m_wVRes);
 677   1        I2CWriteByte(TW101,0x57,m_wVRes>>8);
 678   1        Scaling();
 679   1      //  SetNTSC_PAL();
 680   1      #ifdef T515
                      if((m_cScaleratio== Scale1_1)&&((m_cSource&0x0F)>=isrc_T515_CVIDEO1))
                              I2CWriteByte(TW101,0xB2, 0x23); 
              #endif
 684   1        return 1;
 685   1      }
 686          
 687          
 688          void SetNTSC_PAL(void)//0:NTSC
 689          {
 690   1              if(!m_cStandard)
 691   1              {
 692   2              I2CWriteByte(TW101+4,0x01, 0x09);// 2004-10-16 0x03); //0x03
 693   2              I2CWriteByte(TW101+4,0x0c, 0x8a);
 694   2              I2CWriteByte(TW101+4,0x18, 0x21);
 695   2              I2CWriteByte(TW101+4,0x19, 0xf0);
 696   2              I2CWriteByte(TW101+4,0x1a, 0x7c);
 697   2              I2CWriteByte(TW101+4,0x1b, 0x1f);
 698   2      
 699   2              I2CWriteByte(TW101+4,0x30, 0x28);// 2004-10-16 0x24);// 0x22);//+DELAY_LINES);
 700   2              I2CWriteByte(TW101+4,0x31, 0x61);
 701   2              I2CWriteByte(TW101+4,0x82, 0x42);
 702   2      #ifndef DISPLAY_FUNC
                      I2CWriteByte(TW101,0x84, 0x00);
                      I2CWriteByte(TW101,0x85, 0x01);
                      I2CWriteByte(TW101,0xb8, 0x10);
                      I2CWriteByte(TW101,0xb9, 0x05);
              #endif
 708   2      #ifdef T100
                      I2CWriteByte(TW101+4,0x39, 0x8a);   
              #endif
 711   2      
 712   2              }
 713   1              else
 714   1              {
 715   2              I2CWriteByte(TW101+4,0x01,0x08);//Color
 716   2      //      I2CWriteByte(TW101+4,0x01, 0x00);
 717   2              I2CWriteByte(TW101+4,0x0c, 0x67);
 718   2              I2CWriteByte(TW101+4,0x18, 0x2a);
 719   2              I2CWriteByte(TW101+4,0x19, 0x09);
 720   2              I2CWriteByte(TW101+4,0x1a, 0x8a);
 721   2              I2CWriteByte(TW101+4,0x1b, 0xcb);
 722   2      
 723   2              I2CWriteByte(TW101+4,0x30,0x2E);// 0x2a);//+DELAY_LINES);
 724   2      #ifdef WVGA
 725   2              I2CWriteByte(TW101+4,0x30,0x30);
 726   2      #endif
 727   2              I2CWriteByte(TW101+4,0x31, 0xc1);
 728   2              I2CWriteByte(TW101+4,0x82, 0x52);
 729   2      #ifndef DISPLAY_FUNC
                      I2CWriteByte(TW101,0x84, 0xff);
                      I2CWriteByte(TW101,0x85, 0x0f);
                      I2CWriteByte(TW101,0xb8, 0x10);
                      I2CWriteByte(TW101,0xb9, 0x06);
              #endif
 735   2      #ifdef T100
              #else
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 13  

 737   2      /*
 738   2        switch(m_cScaleratio)
 739   2        {
 740   2              case ScaleFULL:
 741   2                      I2CWriteByte(TW101+4,0x39, 0x0a);  break;
 742   2          case Scale4_3 :
 743   2                      I2CWriteByte(TW101+4,0x39, 0x8a);  break;
 744   2              default :
 745   2                      I2CWriteByte(TW101+4,0x39, 0x0a);  break;
 746   2         }*/
 747   2      #endif
 748   2              }
 749   1              Scaling();
 750   1              DisplayProcess_new();
 751   1              DisplayProcess();
 752   1      #ifdef T515
                      if((m_cScaleratio== Scale1_1)&&((m_cSource&0x0F)>=isrc_T515_CVIDEO1))
                              I2CWriteByte(TW101,0xB2, 0x23); 
              #endif
 756   1      }
 757          
 758          void Scaling(void)
 759          {
 760   1        switch(m_cScaleratio)
 761   1        {
 762   2        case ScaleFULL:
 763   2      //Horizontal
 764   2              m_wBuff[0] = (float)m_wHRes/DWHSZ * 0x8000;
 765   2      
 766   2              I2CWriteByte(TW101, SC_HOR_H1, (uCHAR)m_wBuff[0]);
 767   2              I2CWriteByte(TW101, SC_HOR_H2, (uCHAR)(m_wBuff[0]>>8));
 768   2      
 769   2      //Vertical
 770   2              m_wBuff[0] = (float)m_wVRes/DWVSZ * 0x8000;
 771   2      
 772   2              I2CWriteByte(TW101, SC_VER_V1, (uCHAR)m_wBuff[0]);
 773   2              I2CWriteByte(TW101, SC_VER_V2, (uCHAR)(m_wBuff[0]>>8)); 
 774   2              break;
 775   2      
 776   2        case Scale4_3:
 777   2      //Horizontal
 778   2              m_wBuff[0] = (float)m_wHRes/H_Size43 * 0x8000;
 779   2      
 780   2      
 781   2              I2CWriteByte(TW101, SC_HOR_H1, (uCHAR)m_wBuff[0]);
 782   2              I2CWriteByte(TW101, SC_HOR_H2, (uCHAR)(m_wBuff[0]>>8));
 783   2      
 784   2      //Vertical
 785   2              m_wBuff[0] = (float)m_wVRes/DWVSZ * 0x8000;
 786   2      
 787   2              I2CWriteByte(TW101, SC_VER_V1, (uCHAR)m_wBuff[0]);
 788   2              I2CWriteByte(TW101, SC_VER_V2, (uCHAR)(m_wBuff[0]>>8)); 
 789   2              break;
 790   2      
 791   2      #ifdef T515
               case Scale1_1:
              //Horizontal
              //Horizontal
                      m_wBuff[0] =  0x7fff;
              
                      I2CWriteByte(TW101, SC_HOR_H1, (uCHAR)m_wBuff[0]);
                      I2CWriteByte(TW101, SC_HOR_H2, (uCHAR)(m_wBuff[0]>>8));
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 14  

              
              //Vertical
                      m_wBuff[0] = (float)m_wVRes/DWVSZ * 0x8000;
              
              
                      I2CWriteByte(TW101, SC_VER_V1, (uCHAR)m_wBuff[0]);
                      I2CWriteByte(TW101, SC_VER_V2, (uCHAR)(m_wBuff[0]>>8)); 
                      break;
              #endif
 808   2        }
 809   1      }
 810          
 811          
 812          
 813          
 814          void Set_Reslolution(void)
 815          {
 816   1              if(!m_cStandard)
 817   1              {
 818   2                              I2CWriteByte(TW101+4,0x00, cSVideo&0x01);
 819   2                              I2CWriteByte(TW101+4,0x03, cSVideo&0x03);
 820   2                              #ifdef KVGA
                                      m_wVTotal=525;
                                      #endif
 823   2                              #ifdef WVGA
 824   2                              m_wVTotal=((525/3)*82)/27;
 825   2                              #endif
 826   2                              #ifdef WXGA
                                      m_wVTotal=525;
                                      #endif
 829   2              }
 830   1              else
 831   1              {       
 832   2                              #ifdef KVGA
                                      m_wVTotal=625;
                                      #endif
 835   2                      #ifdef WVGA
 836   2                              m_wVTotal=(625*45)/44;
 837   2                              #endif
 838   2                              #ifdef WXGA
                                      m_wVTotal=625;
                                      #endif
 841   2                              if(cSVideo)
 842   2                              {
 843   3                                      I2CWriteByte(TW101+4,0x00, 0x33);
 844   3                                      I2CWriteByte(TW101+4,0x03, 0x03);
 845   3                              }
 846   2                              else
 847   2                              {
 848   3                                      I2CWriteByte(TW101+4,0x00, 0x32);
 849   3                                      I2CWriteByte(TW101+4,0x03, 0x02);
 850   3                              }
 851   2              }
 852   1      
 853   1      }
 854          
 855          void Detect_NTSCPAL(void)
 856          {
 857   1      //PAL_NTSC Changed Detect----2004.5.11
 858   1      
 859   1       //Kuo 
 860   1              m_wBuff[2]+=1;
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 15  

 861   1                      if(m_wBuff[2]>=0x4ff)
 862   1                      {
 863   2                              m_wBuff[2]=0x00;
 864   2                              for(m_cBuff[1]=0;m_cBuff[1]<50;m_cBuff[1]++)
 865   2                              {
 866   3                                  //temp=I2CReadByte(TW515, 0x5c);
 867   3      #ifdef T515
                              if((m_cSource&0x0f) >= isrc_T515_CVIDEO1)
                                              {
                                  m_cBuff[0] = I2CReadByte(TW515, 0x5c);
                                                  m_cBuff[0]=m_cBuff[0]&0x04;//

⌨️ 快捷键说明

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