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

📄 tw88.lst

📁 车载DVD osdIC TW8816原厂代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
 276   1      }
 277          
 278          void LCDPowerON(BYTE mute)
 279          {
 280   1              dPuts("\r\n------> LCD on");
 281   1      
 282   1              PowerLED(ON);
 283   1      
 284   1             WriteTW88(0xff, 0); // Page 0
 285   1              if( GetLCDPowerState()!=POWER_ON ) {
 286   2                      PanelMute(mute);
 287   2              ON_LVDS();
 288   2      #if 0 // removed for CCFL control  //Hans
                              delay(1);
              
                              WriteDecoder(0xd5, 0x09);       // Standby      Panel:1  Signal:0  Back:0
                              delay(1);
              
C51 COMPILER V7.50   TW88                                                                  04/01/2008 15:02:37 PAGE 6   

                              WriteDecoder(0xd5, 0x0b);       // Suspend      Panel:1  Signal:1  Back:0
              //              delay(1);
              
              //      ON_LVDS();
              //              PanelMute(mute);
                              delay(10);
              #endif
 301   2      
 302   2                      WriteDecoder(0xd5, 0x0f);       // On           Panel:1  Signal:1  Back:1
 303   2                      delay(5);
 304   2      
 305   2              }
 306   1              else    
 307   1                      PanelMute(mute);
 308   1      }
 309          /*
 310          void LCDPowerOFF(void)
 311          {
 312                  dPuts("\r\n------> LCD off");
 313                  
 314                  PanelMute(1);
 315          //      OFF_LVDS();
 316          
 317                  SetLCDPowerState(POWER_OFF);
 318                  OFF_LVDS();
 319          
 320                  delay(10);
 321          }
 322          */
 323          
 324          void LCDPowerOFF(void)
 325          {
 326   1      //      if( GetLCDPowerState()==POWER_OFF ) return;
 327   1      
 328   1              dPuts("\r\n------> LCD off");
 329   1      
 330   1              PanelMute(1);
 331   1      
 332   1      #if 0 // removed for CCFL control  //Hans
                      WriteDecoder(0xd5, 0x0b);       // Suspend      Panel:1  Signal:1  Back:0
                      delay(1);
                      WriteDecoder(0xd5, 0x09);       // Standby      Panel:1  Signal:0  Back:0
                      delay(1);
              #endif  
 338   1              WriteDecoder(0xd5, 0x08);       // Off          Panel:0  Signal:0  Back:0
 339   1      
 340   1              OFF_LVDS();
 341   1      //      delay(10);
 342   1      
 343   1      }
 344          
 345          
 346          #ifdef SERIAL
 347          void LCDPower(void)
 348          {
 349   1              static BYTE state=0;
 350   1      
 351   1              //state = GetLCDPowerState();
 352   1              if( state==POWER_ON ){
 353   2                      state = POWER_OFF;
 354   2                      LCDPowerOFF();
 355   2                      PowerDown_XTAL(1);
C51 COMPILER V7.50   TW88                                                                  04/01/2008 15:02:37 PAGE 7   

 356   2      
 357   2                      Printf("\nPower Off!!");
 358   2              }
 359   1              else //if( state==POWER_OFF )
 360   1              {
 361   2      //              reset = 0;
 362   2                      PowerDown_XTAL(0);
 363   2                      delay(10);
 364   2      /*              reset = 1;
 365   2                      delay(10);
 366   2                      InputSelection = 0xff;
 367   2                      ChangeInput( GetInputSelectionEE() );
 368   2                      LCDPowerON(0);
 369   2      */
 370   2                      state = POWER_ON;
 371   2                      LCDPowerON(0);
 372   2      
 373   2                      Printf("\nPower On!!");
 374   2      
 375   2              }
 376   1      
 377   1      }
 378          #endif // SERIAL
 379          
 380          //=============================================================================
 381          //                          Measurement Functions
 382          //=============================================================================
 383          #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV ) || defined( DEBUG_SETPANEL)
 384          BYTE MeasureAndWait(BYTE field)
 385          {
 386   1              BYTE val;
 387   1              BYTE i;
 388   1      
 389   1              // StartMeasurement
 390   1              val = ( (field & 0x03) << 2 ) | 0x01;                   // flag : choose field for measurement
 391   1              WriteDecoder(0x5b, val);
 392   1      
 393   1              // WaitMeasurementDataReady
 394   1              for(i=0; i<50; i++) {                   // make more delay
 395   2                      delay(1);
 396   2                      val = ReadDecoder(0x5b);
 397   2                      val &= 0x01;
 398   2                      if( val == 0 ) return 1;
 399   2              }
 400   1      
 401   1              #ifdef DEBUG_PC
 402   1              dPrintf("\r\n ReadDecoder(0x5b) = %2x", ReadDecoder(0x5b));
 403   1              #endif
 404   1              // ClearMeasurement
 405   1              WriteDecoder(0x5b, 0);
 406   1              wPuts(" ? ");
 407   1              return 0;
 408   1      }
 409          #endif
 410          
 411          //=================================================================================================
 412          //
 413          //=================================================================================================
 414          #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV ) || defined( DEBUG_SETPANEL)
 415          void SetEnDet(void)
 416          {
 417   1              BYTE val;
C51 COMPILER V7.50   TW88                                                                  04/01/2008 15:02:37 PAGE 8   

 418   1      
 419   1              val = ReadDecoder(0x5c);
 420   1              val |= 0x01;            //Enable Input HSYNC/VSYNC period change/loss detection.
 421   1              WriteDecoder(0x5c, val);
 422   1      
 423   1              val = ReadDecoder(0x5c);
 424   1      }
 425          
 426          void ClearEnDet(void)
 427          {
 428   1              BYTE val;
 429   1      
 430   1              val = ReadDecoder(0x5c);
 431   1              val &= 0xfe;            //Disable Input HSYNC/VSYNC period change/loss detection.
 432   1              WriteDecoder(0x5c, val);
 433   1      
 434   1              val = ReadDecoder(0x5c);
 435   1      }
 436          #endif // SUPPORT_PC || SUPPORT_DTV || DEBUG_SETPANEL
 437          
 438          //=============================================================================
 439          //                              Panel Setting
 440          //=============================================================================
 441          #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
 442          
 443          BYTE IsBypassmode(void)
 444          {
 445   1              BYTE dat;
 446   1      
 447   1              dat = ReadDecoder(TW88_XYSCALEHI) & 0x10;       // Zoom by-pass
 448   1              return dat;
 449   1      }
 450          /*
 451          BYTE IsInteraced(void)
 452          {
 453                  if( ReadDecoder(0x42) & 0x80 ) return 1;
 454                  return 0;
 455          }
 456          */
 457          WORD GetHstart(void)
 458          {
 459   1              WORD hstart;
 460   1      
 461   1              WriteDecoder(0x5b, 0x80);
 462   1              hstart = (WORD)ReadDecoder(0x58) << 8;
 463   1              hstart += ReadDecoder(0x57);
 464   1      
 465   1              #ifdef DEBUG_PC
 466   1              dPrintf("\r\n === GetHstart(%d)", hstart);
 467   1              #endif
 468   1              return hstart;
 469   1      }
 470          
 471          #ifdef AUTO_TUNE_CLOCK
              WORD GetHend(void)
              {
                      WORD hend;
              
                      WriteDecoder(0x5b, 0x98);
                      hend = (WORD)ReadDecoder(0x58) << 8;
                      hend += ReadDecoder(0x57);
              
C51 COMPILER V7.50   TW88                                                                  04/01/2008 15:02:37 PAGE 9   

                      #ifdef DEBUG_PC
                      dPrintf("\r\n === GetHend(%d)", hend);
                      #endif
                      return hend;
              }
              #endif
 486          
 487          WORD GetVstart(void)
 488          {
 489   1              WORD vstart;
 490   1      
 491   1              WriteDecoder(0x5b, 0xa0);
 492   1              vstart = (WORD)ReadDecoder(0x58) << 8;
 493   1              vstart += ReadDecoder(0x57);
 494   1      
 495   1              #ifdef DEBUG_PC
 496   1              dPrintf("\r\n === GetVstart(%d)", vstart);
 497   1              #endif
 498   1              return vstart;
 499   1      }
 500          
 501          
 502          
 503          WORD GetVend(void)
 504          {
 505   1              WORD vend;
 506   1      
 507   1              WriteDecoder(0x5b, 0xb0);
 508   1              vend = (WORD)ReadDecoder(0x5a) << 8;
 509   1              vend += ReadDecoder(0x59);
 510   1      
 511   1              #ifdef DEBUG_PC
 512   1              dPrintf("\r\n === GetVend(%d)", vend);
 513   1              #endif
 514   1              return vend;
 515   1      }
 516          
 517          void Clear_bypass()
 518          {
 519   1              BYTE dat;
 520   1      
 521   1              dat = ReadDecoder(TW88_XYSCALEHI);      
 522   1              WriteDecoder(TW88_XYSCALEHI, dat & 0xef);       // xxx0 xxxx
 523   1      }
 524          
 525          
 526          WORD GetHactiveStart(void)
 527          {
 528   1              WORD buf;
 529   1              BYTE val;
 530   1      
 531   1              val = ReadDecoder(0x49);        
 532   1              buf = (WORD)(val & 0x07) << 8;
 533   1              buf += ReadDecoder(0x47);
 534   1      
 535   1              return buf;
 536   1      }
 537          
 538          /**** Not used */
 539          WORD GetHactiveEnd(void)
 540          {
 541   1              WORD buf;
C51 COMPILER V7.50   TW88                                                                  04/01/2008 15:02:37 PAGE 10  

 542   1              BYTE val;
 543   1      
 544   1              val = ReadDecoder(0x49);
 545   1              buf = (WORD)(val & 0xf0) << 4;
 546   1              buf += ReadDecoder(0x48);
 547   1      
 548   1              return buf;
 549   1      }
 550          /****/
 551          
 552          //#ifdef DEBUG_TW88
 553          WORD GetVactiveStart(void)
 554          {
 555   1              WORD buf;
 556   1              BYTE val;
 557   1      
 558   1              val = ReadDecoder(0x4d);                        // high 2 bits
 559   1              buf = (WORD)(val & 0x03) << 8;
 560   1              buf |= ReadDecoder(0x4a);                       // Vactive Odd field Line start position
 561   1      
 562   1              return buf;
 563   1      }
 564          //#endif
 565          
 566          #include "osdmenu.h"
 567          extern CODE struct RegisterInfo UserRange;

⌨️ 快捷键说明

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