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

📄 1574main.lst

📁 MXIC旺宏液晶电视芯片MX88V44的源码
💻 LST
📖 第 1 页 / 共 2 页
字号:
 181   1              {
 182   2      /*              cdv_3Astatus = CVD1_ReadWrite(0x00, 0x3A, 0x00) & 0x0E; // read CVD1 status: chroma PLL/V/H line lock 
 183   2                      cdv_3Cstatus = CVD1_ReadWrite(0x00, 0x3C, 0x00) & 0x04; // 625 scan line detected
 184   2                                      
 185   2                      //Check is Composite input CH# and CDV signal is not LOCK
 186   2                      if (dig_cvd && cdv_3Astatus!=0x0E)              
 187   2                      {
 188   2                              NTSC_PAL = cdv_3Cstatus;
 189   2                              if (!show_type)
 190   2                              {
 191   2                                      OSD_ShowTitle(ch_type, 13);
 192   2                                      show_type = 1;
 193   2                              }                               
 194   2                              I2C_WriteByte(L44_WRID, 0x20,  0xC0);   //Turn OFF Screen
 195   2      
 196   2                              if (cdv_3Cstatus) // PAL system input           
 197   2                              {                                               
 198   2                                      
 199   2                                      {                                               
 200   2                                              for (i=0; i<WR_CVD1_BYTE; i++)  // set reg for PAL input
 201   2                                                      CVD1_ReadWrite(0x01, CVD1_PALTab[i*2], CVD1_PALTab[i*2+1]);
 202   2                                              strcpy(&ch_type[8], "PAL  ");                                   
 203   2                                      }
 204   2                                                                              
 205   2                              //      if (CBSH_Value[6])              //Turn ON the Edge filter
 206   2                                      CVD1_ReadWrite(0x01, 0x01, 0x08);
 207   2      
 208   2                                      I2C_WriteByte(L44_WRID, 0x71, 0xA3);
 209   2                                      I2C_WriteByte(L44_WRID, 0x68, 0x19);//74
 210   2                                      set_times &= 0x07;
 211   2                              }
 212   2                              else   // NTSC system input
 213   2                              {                                               
 214   2                                      if (set_times++ < 3)
 215   2                                      {
 216   2                                              for (i=0; i<WR_CVD1_BYTE; i++)
 217   2                                                      CVD1_ReadWrite(0x01, CVD1_NTSCTab[i*2], CVD1_NTSCTab[i*2+1]);
 218   2                                              strcpy(&ch_type[8], "NTSC ");
 219   2                                      }
 220   2                                      else
 221   2                                      {                                       //PAL M mode
 222   2                                              for (i=0; i<WR_CVD1_BYTE; i++)
 223   2                                                      CVD1_ReadWrite(0x01, CVD1_PALMTab[i*2], CVD1_PALMTab[i*2+1]);
 224   2                                              strcpy(&ch_type[8], "PAL M");
 225   2                                      }
 226   2                                      if (CBSH_Value[6])                                              //Turn ON the Edge filter
 227   2                                              CVD1_ReadWrite(0x01, 0x01, 0x09);
 228   2                      
 229   2                                      set_times &= 0x07;
 230   2                              }                       
 231   2                              Adj_DisplayMode(CBSH_Value[7]);
 232   2                      }
 233   2                      else
 234   2                      {
 235   2                              if (show_type)
 236   2                              {
 237   2                                      I2C_WriteByte(L44_WRID, 0x20,  0x40);   //Turn ON  Screen               //***
 238   2                                      if (dig_cvd)
 239   2                                              OSD_ShowTitle(ch_type, 13);
 240   2                                      show_type = 0;
C51 COMPILER V7.02b   1574MAIN                                                             05/24/2006 17:59:21 PAGE 5   

 241   2                              }
 242   2                      }
 243   2      
 244   2      */              key = WaitKey();
 245   2      
 246   2                      if (key == ENTER)                       //Switch Input CH# CCIR / Composite 1,2,3
 247   2                      {
 248   3      //                      if (++dig_cvd > 3)      dig_cvd = 0;
 249   3      //                      Adj_DisplayMode(CBSH_Value[7]);
 250   3                              if (dig_cvd)
 251   3                              {
 252   4      //                              if (dig_cvd == 1)       CVD1_ReadWrite(0x01, 0x90, 0x00);       //CH#1
 253   4      //                              if (dig_cvd == 2)       CVD1_ReadWrite(0x01, 0x90, 0x40);       //CH#2
 254   4                                      if (dig_cvd == 3)       CVD1_ReadWrite(0x01, 0x90, 0x80);       //CH#3
 255   4                                      dig_cvd = 0;
 256   4                                      I2C_WriteByte(L44_WRID, 0x00, 0x41);    //Switch to CVD1
 257   4      //                              ch_type[5] = dig_cvd | 0x30;    
 258   4                                      strcpy(ch_type,   "VIDEO 3 NTSC ");
 259   4                                      OSD_ShowTitle(ch_type, 13);     
 260   4                                         I2C_WriteByte(L44_WRID, 0x11,  0xF4);  //access gamma table
 261   4                                         for(j=0; j<768; j++)
 262   4                                         {         
 263   5                                         i= GAMMATAL[j];
 264   5                                         I2C_WriteByte(L44_WRID, 0x1B,  i);  //R
 265   5                                      //   I2C_WriteByte(L44_WRID, 0x1B,  i);  //G
 266   5                                      //   I2C_WriteByte(L44_WRID, 0x1B,  i);  //B
 267   5                                        }
 268   4                                         I2C_WriteByte(L44_WRID, 0x11,  0xFa);  //enable gamma table
 269   4                                      I2C_WriteByte(L44_WRID, 0x15,  0x80);
 270   4                                      I2C_WriteByte(L44_WRID, 0x13,  0x80);
 271   4                                      I2C_WriteByte(L44_WRID, 0x17,  0x80);
 272   4                              }
 273   3                              else
 274   3                              {
 275   4                                      NTSC_PAL = 0x00;
 276   4      //                              I2C_WriteByte(L44_WRID, 0x68, 0x10);
 277   4                                      dig_cvd = 1;
 278   4      //                              I2C_WriteByte(L44_WRID, 0x00, 0x50);    //Switch to CCIR 601
 279   4                                      I2C_WriteByte(L44_WRID, 0x00, 0x80);    //Switch to CCIR 656
 280   4                                      strcpy(ch_type,   "CCIR601 NTSC ");
 281   4                                      OSD_ShowTitle(ch_type, 13);
 282   4                                         I2C_WriteByte(L44_WRID, 0x11,  0xF4);  //access gamma table
 283   4                                         for(j=0; j<768; j++)
 284   4                                         {         
 285   5                                         i= GAMMATAL2[j];
 286   5                                         I2C_WriteByte(L44_WRID, 0x1B,  i);  //R
 287   5                                      //   I2C_WriteByte(L44_WRID, 0x1B,  i);  //G
 288   5                                      //   I2C_WriteByte(L44_WRID, 0x1B,  i);  //B
 289   5                                        }
 290   4                                         I2C_WriteByte(L44_WRID, 0x11,  0xFa);  //enable gamma table
 291   4                                      I2C_WriteByte(L44_WRID, 0x15,  0x90);
 292   4                                      I2C_WriteByte(L44_WRID, 0x13,  0x8a);
 293   4                                      I2C_WriteByte(L44_WRID, 0x17,  0x80);
 294   4                              }
 295   3                      }
 296   2      
 297   2                      if (key == MENU)
 298   2                              Adj_CBSH();
 299   2              }
 300   1      }
 301          
 302          /**--------------------------------------------------------------------------
C51 COMPILER V7.02b   1574MAIN                                                             05/24/2006 17:59:21 PAGE 6   

 303          * Name          BYTE    WaitKey()
 304          *
 305          * Description   There are 2 working item in this function
 306          *                               1. Detect the UART Flag for RS-232 parse process
 307          *
 308          *                               2. Detect and return whick key press and release
 309          *                                       Press key               Return code             8051 Port
 310          *                               ----------------------------------------------
 311          *                                       Enter                   0x1E                    P0.0
 312          *                                       DOWN                    0x1B                    P0.2
 313          *                                       UP                              0x17                    P0.3
 314          *                                       MENU                    0x0F                    P0.4
 315          *
 316          *                                       Not press               0x00
 317          *
 318          * Flow Chart
 319          *
 320          * Return                press_key
 321          *
 322          * DATE          Author          Description
 323          * ===========================================================================
 324          * 2004-07-10    K.M. Ho         This is first time implement
 325          */
 326          BYTE    WaitKey(void)
 327          {
 328   1              BYTE    press_key;
 329   1      
 330   1              press_key = P0 & 0x1F;                          // get press key from Port#0
 331   1      
 332   1                      //***************************************
 333   1                      //---   Process the UART service        -----
 334   1                      //***************************************
 335   1              if (UARTFlag & RX_PARSE)                        //service the parse
 336   1                      UART_ParseFun();                                //Jump into UART_ParseFun() function
 337   1      
 338   1                      //***********************************
 339   1                      //---   Process The 15xx Key    -----
 340   1                      //***********************************
 341   1      
 342   1              if (press_key != 0x1F)
 343   1              {
 344   2                      for (;;)                                                //wait all key release
 345   2                              if ((P0&0x1F)==0x1F)
 346   2                                      break;
 347   2      
 348   2                      T0_0Interval = 500;                             //reset the Timer interval 10sec.
 349   2      //P2 ^= ~(press_key|0xE0);
 350   2              }
 351   1              else
 352   1                      press_key = 0;
 353   1      
 354   1              return (press_key);                                     //if not press key will return 0x00
 355   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    585    ----
   CONSTANT SIZE    =   1578    ----
   XDATA SIZE       =      1      36
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
C51 COMPILER V7.02b   1574MAIN                                                             05/24/2006 17:59:21 PAGE 7   

   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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