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

📄 t101_util.lst

📁 宏芯T102芯片驱动(51单片机作主控)
💻 LST
📖 第 1 页 / 共 3 页
字号:
                  I2CWriteByte(TW101+2,0x32,0x01);
                  I2CWriteByte(TW101+2,0x33,0xC9);
                  I2CWriteByte(TW101+2,0x34,0x00);
                  I2CWriteByte(TW101+2,0x35,0x01);
                  I2CWriteByte(TW101,0xc7,0x04);
              #else
                  I2CWriteByte(TW101+2, 0x20, 0x21);
                  I2CWriteByte(TW101+2, 0x21, TIME_PROTOCOL);
                  I2CWriteByte(TW101+2, 0x22, 0x02);
                  I2CWriteByte(TW101+2, 0x23, 0x02);
              //    I2CWriteByte(TW101+2, 0x22, 0x2D);
              //   I2CWriteByte(TW101+2, 0x23, 0x02);
                  I2CWriteByte(TW101+2, 0x24, 0x0C);
              //    I2CWriteByte(TW101+2, 0x25, 0x4B);
              //    I2CWriteByte(TW101+2, 0x26, 0x02);
                  I2CWriteByte(TW101+2, 0x25, 0x02);
                  I2CWriteByte(TW101+2, 0x26, 0x02);
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 6   

              //    I2CWriteByte(TW101+2, 0x27, 0x1C);
              //    I2CWriteByte(TW101+2, 0x28, 0x02);
                  I2CWriteByte(TW101+2, 0x27, 0xf2);
                  I2CWriteByte(TW101+2, 0x28, 0x01);
              
                  I2CWriteByte(TW101+2, 0x29, 0x29);
                  I2CWriteByte(TW101+2, 0x2A, 0x00);
                  I2CWriteByte(TW101+2, 0x2B, 0x01);
                  I2CWriteByte(TW101+2, 0x2C, 0x18);
                  I2CWriteByte(TW101+2, 0x2D, GATE_PREDRIVE);//0x03);
                  I2CWriteByte(TW101+2, 0x2E, 0x00);
                  I2CWriteByte(TW101+2, 0x30, 0x01);
               //   I2CWriteByte(TW101+2, 0x31, 0xFB);
               //   I2CWriteByte(TW101+2, 0x32, 0x01);
               //   I2CWriteByte(TW101+2, 0x33, 0x37);
               //   I2CWriteByte(TW101+2, 0x34, 0x00);
                  I2CWriteByte(TW101+2, 0x31, 0xcd);
                  I2CWriteByte(TW101+2, 0x32, 0x01);
                  I2CWriteByte(TW101+2, 0x33, 0x35);
                  I2CWriteByte(TW101+2, 0x34, 0x00);
                  I2CWriteByte(TW101+2, 0x35, 0x06);
                  I2CWriteByte(TW101, 0x50, 0x06);
                  I2CWriteByte(TW101, 0x38, 0x50);
                  I2CWriteByte(TW101, 0x39, 0x00);
                  I2CWriteByte(TW101, 0x3A, 0x20);
                  I2CWriteByte(TW101, 0x3B, 0x03);
                  //I2CWriteByte(TW101, 0x70, 0x81);
                      I2CWriteByte(TW101, 0x70, 0x81);
              #endif
              #else
 333   1      
 334   1              I2CWriteByte(TW101+2,0x20, 0x20);
 335   1              I2CWriteByte(TW101+2,0x21, 0x3F);
 336   1              I2CWriteByte(TW101+2,0x22, 0x90);
 337   1              I2CWriteByte(TW101+2,0x23, 0x04);
 338   1              I2CWriteByte(TW101+2,0x24, 0x10);
 339   1              I2CWriteByte(TW101+2,0x25, 0x80);
 340   1              I2CWriteByte(TW101+2,0x26, 0x04);
 341   1              I2CWriteByte(TW101+2,0x27, 0x00);
 342   1              I2CWriteByte(TW101+2,0x28, 0x03);
 343   1              I2CWriteByte(TW101+2,0x29, 0x20);
 344   1              I2CWriteByte(TW101+2,0x2A, 0x00);
 345   1              I2CWriteByte(TW101+2,0x2B, 0x03);
 346   1              I2CWriteByte(TW101+2,0x2C, 0x18);
 347   1              I2CWriteByte(TW101+2,0x2D, 0x02);
 348   1              I2CWriteByte(TW101+2,0x2E, 0x00);
 349   1              I2CWriteByte(TW101+2,0x2F, 0x00);
 350   1              I2CWriteByte(TW101+2,0x30, 0x00);
 351   1              I2CWriteByte(TW101+2,0x31, 0x0F);
 352   1              I2CWriteByte(TW101+2,0x32, 0x00);
 353   1              I2CWriteByte(TW101+2,0x33, 0x0F);
 354   1              I2CWriteByte(TW101+2,0x34, 0x00);
 355   1              I2CWriteByte(TW101+2,0x35, 0x01);
 356   1              I2CWriteByte(TW101+2,0x37, 0x80);
 357   1              I2CWriteByte(TW101+2,0x38, 0x02);
 358   1      #endif
 359   1      }
 360          #endif
 361          
 362          #ifdef RSDS
              void RsdsInit(void)
              {
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 7   

                      I2CWriteByte(TW101+2,0x20,0x02);
                      I2CWriteByte(TW101+2,0x21,0x3F);
                      I2CWriteByte(TW101+2,0x22,0x10);
                      I2CWriteByte(TW101+2,0x23,0x05);
                      I2CWriteByte(TW101+2,0x24,0x10);
                      I2CWriteByte(TW101+2,0x25,0x04);
                      I2CWriteByte(TW101+2,0x26,0x05);
                      I2CWriteByte(TW101+2,0x27,0x00);
                      I2CWriteByte(TW101+2,0x28,0x03);
                      I2CWriteByte(TW101+2,0x29,0xFF);
                      I2CWriteByte(TW101+2,0x2A,0x00);
                      I2CWriteByte(TW101+2,0x2B,0x03);
                      I2CWriteByte(TW101+2,0x2C,0x18);
                      I2CWriteByte(TW101+2,0x2D,0x02);
                      I2CWriteByte(TW101+2,0x2E,0x00);
                      I2CWriteByte(TW101+2,0x2F,0x00);
                      I2CWriteByte(TW101+2,0x30,0x00);
                      I2CWriteByte(TW101+2,0x31,0x0F);
                      I2CWriteByte(TW101+2,0x32,0x00);
                      I2CWriteByte(TW101+2,0x33,0x0F);
                      I2CWriteByte(TW101+2,0x34,0x00);
                      I2CWriteByte(TW101+2,0x35,0x01);
                      I2CWriteByte(TW101+2,0x37,0x80);
                      I2CWriteByte(TW101+2,0x38,0x02);
              
                      I2CWriteByte(TW101,0xD0, 0x01);
                      I2CWriteByte(TW101,0xD1, 0x11);
                      I2CWriteByte(TW101,0xD3, 0xAA);
                      I2CWriteByte(TW101,0xD4, 0xAA);
                      I2CWriteByte(TW101,0xD5, 0xAA);
                      I2CWriteByte(TW101,0xD6, 0xAA);
                      I2CWriteByte(TW101,0xD7, 0xAA);
                      I2CWriteByte(TW101,0xD8, 0xAA);
              }
              #endif //RSDS
 400          
 401          
 402          
 403          /////////////////////////
 404          //This function setup the display direction
 405          ///////////////////////////
 406          #ifdef KVGA
              void SET_Dismod(void)
              {
              
              #ifdef AU_7
                      switch (Dis_Mode)
                  { 
                              case  TOP_LEFT: //Start from top-left
                            LEFT_RIGHT = RIGHT;
                                        UP_DOWN       =DOWN;
                                        I2CWriteByte(TW101,0xE1, 0xf4);
                            break;
                              case  TOP_RIGHT: //Start from top-right
                            LEFT_RIGHT = LEFT;
                                        UP_DOWN       =DOWN;
                                        I2CWriteByte(TW101,0xE1, 0xe0);
                            break;
                              case  BOTTOM_LEFT: //Start from bottom-left
                            LEFT_RIGHT = RIGHT;
                                        UP_DOWN       =UP;
                                        I2CWriteByte(TW101,0xE1, 0xbc);
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 8   

                            break;
                      case  BOTTOM_RIGHT:  //Start from bottom-right
                            LEFT_RIGHT = LEFT;
                                        UP_DOWN       =UP;
                                        I2CWriteByte(TW101,0xE1, 0xa8);
                            break;
                  }
              #else 
                      I2CWriteByte(TW101,0xE1, OUT_PIN_CONF);
              #endif
              
                      return;
              }
              
              #endif
 442          
 443          #ifdef WVGA
 444          void SET_Dismod(void)
 445          {
 446   1      
 447   1              switch (Dis_Mode)
 448   1          { 
 449   2                      case  TOP_LEFT: //Start from top-left
 450   2                    LEFT_RIGHT = RIGHT;
 451   2                                UP_DOWN       =DOWN;
 452   2                                I2CWriteByte(TW101,0xE1, (STV1|STH1)&0xFF);
 453   2                    break;
 454   2                      case  TOP_RIGHT: //Start from top-right
 455   2                    LEFT_RIGHT = LEFT;
 456   2                                UP_DOWN       =DOWN;
 457   2                                I2CWriteByte(TW101,0xE1, (STV1|STH2)&0xFF);
 458   2                    break;
 459   2                      case  BOTTOM_LEFT: //Start from bottom-left
 460   2                    LEFT_RIGHT = RIGHT;
 461   2                                UP_DOWN       =UP;
 462   2                                I2CWriteByte(TW101,0xE1, (STV2|STH1)&0xFF);
 463   2                    break;
 464   2              case  BOTTOM_RIGHT:  //Start from bottom-right
 465   2                    LEFT_RIGHT = LEFT;
 466   2                                UP_DOWN       =UP;
 467   2                                I2CWriteByte(TW101,0xE1, (STV2|STH2)&0xFF);
 468   2                    break;
 469   2          }
 470   1      
 471   1              return;
 472   1      }
 473          
 474          #endif
 475          
 476          bit IRScaleratioCtrl(void)
 477          {
 478   1      uCHAR Hcut=0;
 479   1        switch(m_cScaleratio)
 480   1        {
 481   2        case ScaleFULL:
 482   2      #ifdef KVGA
                       if(m_cStandard)
                                              I2CWriteByte(TW101+4,0x2E,0x8A); //0x82); //setup video decoder h start == 130
                       else
                                              I2CWriteByte(TW101+4,0x2E,0x86); //0x82); //setup video decoder h start == 130
                              
              #endif
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 9   

 489   2      #ifdef WVGA
 490   2                      I2CWriteByte(TW101+4,0x2E,0x88); //0x82); //setup video decoder h start == 130
 491   2      #endif
 492   2      #ifdef WXGA 
              #ifdef AU_12
                                              I2CWriteByte(TW101+4,0x2E,0x94);//Kuo 0x88 0x94
              #else
                                              I2CWriteByte(TW101+4,0x2E,0x82);
              #endif
              #endif
 499   2      #ifdef AU_12
                                      I2CWriteByte(TW101+4,0x2F,0x3a); //0x50); //Setup video decoder h active 720
              #else
 502   2      
 503   2                  I2CWriteByte(TW101+4,0x2F,0x50); //0x50); //Setup video decoder h active 720 玡狠
 504   2      #endif
 505   2                              I2CWriteByte(TW101,0xDC, (H_Size&0xFF));//Kuo
 506   2                              I2CWriteByte(TW101,0xDD, (H_Size>>8)); 
 507   2      
 508   2                              I2CWriteByte(TW101,0xDE, (V_Size&0xFF)); 
 509   2                              I2CWriteByte(TW101,0xDF, (V_Size>>8)); 
 510   2      
 511   2      
 512   2                              if(!m_cStandard)
 513   2                              {
 514   3                                      m_wVRes=230;  //230 //ruby 2004-08-18
 515   3                                      Hcut=10;
 516   3                      m_wHRes=720-2*Hcut;
 517   3      
 518   3      #ifdef AU_12
                              m_wHRes=698;
              #endif        
 521   3      
 522   3                              }
 523   2                              else
 524   2                              {       
 525   3                                      m_wVRes=280;  //ruby 2004-08-18
 526   3                                      Hcut=10;
 527   3                      m_wHRes=720-2*Hcut;
 528   3      #ifdef AU_12
                              m_wHRes=698;
              #endif
 531   3       
 532   3      
 533   3                      }
 534   2                      I2CWriteByte(TW101,0x40,Hcut); //Hcut put picture position in center 2004-10-16 //For Foxconn
 535   2              I2CWriteByte(TW101,0xD8,0x00);//Kuo Horizontal Main Display Start
 536   2      
 537   2              break;
 538   2      
 539   2                  case Scale4_3:
 540   2      
 541   2      #ifdef KVGA
                          I2CWriteByte(TW101+4,0x2E,0x82);
                                      I2CWriteByte(TW101+4,0x2F,0x50); //0x50); //Setup video decoder h active 720
              #else
 545   2                              I2CWriteByte(TW101+4,0x2E,0x82); //0x82); //setup video decoder h start == 130
 546   2                              I2CWriteByte(TW101+4,0x2F,0x50); //0x50); //Setup video decoder h active 720
 547   2      #endif
 548   2      
 549   2      
 550   2      //Black Diaplay
C51 COMPILER V7.06   T101_UTIL                                                             12/28/2004 10:14:03 PAGE 10  

 551   2      
 552   2                              I2CWriteByte(TW101, 0x9d, 0x10);
 553   2                              I2CWriteByte(TW101, 0x9e, 0x80);
 554   2                              I2CWriteByte(TW101, 0x9f, 0x80);
 555   2      //Kuo
 556   2                              I2CWriteByte(TW101,0xDC, (H_Size43));
 557   2                              I2CWriteByte(TW101,0xDD, (H_Size43>>8)); 
 558   2      
 559   2                              I2CWriteByte(TW101,0xDE, (V_Size&0xFF)); 
 560   2                              I2CWriteByte(TW101,0xDF, (V_Size>>8)); 
 561   2      
 562   2                              if(!m_cStandard)
 563   2                              {
 564   3          #ifdef KVGA
                                              Hcut=10;
                      #else
 567   3                                      Hcut=10;
 568   3              #endif 
 569   3                                      m_wVRes=230;  //ruby 2004-08-18
 570   3                      m_wHRes=720-2*Hcut;
 571   3      #ifdef AU_12
                              m_wHRes=698;
              #endif
 574   3                              }
 575   2                              else
 576   2                              {       
 577   3          #ifdef KVGA
                                              Hcut=10;

⌨️ 快捷键说明

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