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

📄 videosourceswitch.lst

📁 T103的开发程序 能兼容很多屏 可根据需要修改定义
💻 LST
📖 第 1 页 / 共 2 页
字号:
 177   1              twdDelay(100);                                          
 178   1              IC_WritByte(TWIC_P2, 0x3f, 0x00); 
 179   1              SetIPVideoType();
 180   1      }
 181          
 182          
 183          
 184          /*   S E T   O   P   T I M I N G   */
 185          /*-------------------------------------------------------------------------
 186              set the scaler,line buffer,output PLL,display window
 187          -------------------------------------------------------------------------*/
 188          void SetOPTiming(void)
 189          {
 190   1      
 191   1      
 192   1                      if((m_cStandard==S_NTSC)||(m_cStandard==S_NTSC_4)||(m_cStandard==S_PAL_M))
 193   1                      {
 194   2                              // kenny 20060512 ====================================================
 195   2      
 196   2                              m_cBuff[0]=0;
 197   2                              m_cBuff[1]=stInitOUT_T[0].ucRegAdr;
 198   2                              while (m_cBuff[1] != 0xBF)
 199   2                              {
 200   3                                      IC_WritByte(TWIC_P0,m_cBuff[1],stInitOUT_T[m_cBuff[0]].ucRegVal);
 201   3                                      m_cBuff[1]=stInitOUT_T[++m_cBuff[0]].ucRegAdr;
 202   3                              }
 203   2      
 204   2      //kenny 20060721
 205   2      #ifdef TCON
 206   2                              
 207   2                              IC_WritByte(TWIC_P0, 0xe0, IC_ReadByte(TWIC_P0,0xe0)|0x01);// 0xb9);         
 208   2      #else
              
              //kenny 20060721
                                      IC_WritByte(TWIC_P0, 0xe0, IC_ReadByte(TWIC_P2,0xe0)&~0x01);// 0xb9);                           
              #endif
 213   2                              IC_WritByte(TWIC_P0, 0xe2, 0x11);
 214   2      
 215   2                              // kenny 20060512 ====================================================
 216   2      
 217   2                              //m_wBuff[1]=(uWORD)(m_cScaleratio)*P0ScaleAdrCnt;
 218   2                              m_wBuff[1]=0*P0ScaleAdrCnt;
 219   2                              for (m_wBuff[0]=0; m_wBuff[0]<P0ScaleAdrCnt; m_wBuff[0]++, m_wBuff[1]++){
 220   3                                      IC_WritByte(TWIC_P0, ucaZoomAdrP0[m_wBuff[0]], ucaZoomDataP0_NTSC[m_wBuff[1]]);
 221   3                              }
 222   2                              //m_wBuff[1]=(uWORD)(m_cScaleratio)*P2ScaleAdrCnt;
 223   2                          m_wBuff[1]=0*P2ScaleAdrCnt;
 224   2                              for (m_wBuff[0]=0; m_wBuff[0]<P2ScaleAdrCnt; m_wBuff[0]++, m_wBuff[1]++){
 225   3                                      IC_WritByte(TWIC_P2, ucaZoomAdrP2[m_wBuff[0]], ucaZoomDataP2_NTSC[m_wBuff[1]]);
 226   3                              }
 227   2                      
 228   2                              #ifdef SimulateSTH
                                      m_wBuff[1]=m_cScaleratio*P1ScaleAdrCnt;
                                      for (m_wBuff[0]=0; m_wBuff[0]<P1ScaleAdrCnt; m_wBuff[0]++, m_wBuff[1]++){
                                              IC_WritByte(TW803_P1, ucaZoomAdrP1[m_wBuff[0]], ucaZoomDataP1_NTSC[m_wBuff[1]]);
                                      }
                                      #endif
 234   2      
 235   2                      }
 236   1                      else
 237   1                      {
 238   2                              //m_wBuff[1]=(uWORD)(m_cScaleratio)*P0ScaleAdrCnt;
C51 COMPILER V8.08   VIDEOSOURCESWITCH                                                     11/23/2007 00:57:18 PAGE 5   

 239   2                              m_wBuff[1]=0*P0ScaleAdrCnt;
 240   2                              for (m_wBuff[0]=0; m_wBuff[0]<P0ScaleAdrCnt; m_wBuff[0]++, m_wBuff[1]++){
 241   3                                      IC_WritByte(TWIC_P0, ucaZoomAdrP0[m_wBuff[0]], ucaZoomDataP0_PAL[m_wBuff[1]]);
 242   3                              }
 243   2                              //m_wBuff[1]=(uWORD)(m_cScaleratio)*P2ScaleAdrCnt;
 244   2                              m_wBuff[1]=0*P2ScaleAdrCnt;
 245   2                              for (m_wBuff[0]=0; m_wBuff[0]<P2ScaleAdrCnt; m_wBuff[0]++, m_wBuff[1]++){
 246   3                                      IC_WritByte(TWIC_P2, ucaZoomAdrP2[m_wBuff[0]], ucaZoomDataP2_PAL[m_wBuff[1]]);
 247   3                              }
 248   2                              // Add by Sherman 06'01'06
 249   2                              #ifdef SimulateSTH
                                      m_wBuff[1]=m_cScaleratio*P1ScaleAdrCnt;
                                      for (m_wBuff[0]=0; m_wBuff[0]<P1ScaleAdrCnt; m_wBuff[0]++, m_wBuff[1]++){
                                              IC_WritByte(TW803_P1, ucaZoomAdrP1[m_wBuff[0]], ucaZoomDataP1_PAL[m_wBuff[1]]);
                                      }
                                      #endif
 255   2                              // end of add by Sherman
 256   2                      }
 257   1      
 258   1              IC_WritByte(TWIC_P0, 0xe2, 0x11);
 259   1      }
 260          
 261          
 262          /*   S E T   I   P   V I D E O   T Y P E   */
 263          /*-------------------------------------------------------------------------
 264              set video source selection of Comb Filter(P20x00),
 265              set bandwidth control register(P20x01)
 266              set comb filtering mode register(P20x03)
 267          -------------------------------------------------------------------------*/
 268          void SetIPVideoType(void)
 269          {
 270   1              if(m_cChroma==S_NTSC){
 271   2                      m_wVTotal=525;
 272   2                      IC_WritByte(TWIC_P2,0x00, IC_ReadByte(TWIC_P2,0x00)&0x01);
 273   2                      IC_WritByte(TWIC_P2,0x01, IC_ReadByte(TWIC_P2,0x01)|0x09);
 274   2                      if(uiaSrcMux1[EepPublic.cSource].VideoType==itypeSVIDEO)
 275   2                                      IC_WritByte(TWIC_P2,0x03, 0x03);
 276   2                      else    IC_WritByte(TWIC_P2,0x03, 0x00);
 277   2              }
 278   1              else if(m_cChroma==S_PAL){
 279   2                      m_wVTotal=625;
 280   2                      IC_WritByte(TWIC_P2,0x00, IC_ReadByte(TWIC_P2,0x00)&0x01|0x32);
 281   2                      IC_WritByte(TWIC_P2,0x01, IC_ReadByte(TWIC_P2,0x01)|0x08);
 282   2                      IC_WritByte(TWIC_P2,0x03, IC_ReadByte(TWIC_P2,0x03)&0x01|0x02);
 283   2              }
 284   1              else if(m_cChroma==S_SECAM){
 285   2                      m_wVTotal=625;
 286   2                      IC_WritByte(TWIC_P2,0x00, IC_ReadByte(TWIC_P2,0x00)&0x01|0x28);
 287   2                      IC_WritByte(TWIC_P2,0x03, IC_ReadByte(TWIC_P2,0x03)&0x01|0x02);
 288   2              }
 289   1              else if(m_cChroma==S_PAL_M){
 290   2                      m_wVTotal=525;
 291   2                      IC_WritByte(TWIC_P2,0x00, IC_ReadByte(TWIC_P2,0x00)&0x01|0x04);
 292   2              }
 293   1              else if(m_cChroma==S_PAL_CN){
 294   2                      m_wVTotal=625;
 295   2                      IC_WritByte(TWIC_P2,0x00, IC_ReadByte(TWIC_P2,0x00)&0x01|0x26);
 296   2              }
 297   1              else if(m_cChroma==S_NTSC_4){
 298   2                      m_wVTotal=525;
 299   2                      IC_WritByte(TWIC_P2,0x00, IC_ReadByte(TWIC_P2,0x00)&0x01|0x00);
 300   2                      if(uiaSrcMux1[EepPublic.cSource].VideoType==itypeSVIDEO)
C51 COMPILER V8.08   VIDEOSOURCESWITCH                                                     11/23/2007 00:57:18 PAGE 6   

 301   2                                      IC_WritByte(TWIC_P2,0x03, 0x03);
 302   2                      else    IC_WritByte(TWIC_P2,0x03, 0x03);
 303   2              }
 304   1      
 305   1      }
 306          //#ifdef AUTO_DETECT
 307          void Detect_Sig(bit detect)
 308          {
 309   1              m_cBuff[0]=1;
 310   1                                
 311   1      
 312   1              if ((uiaSrcMux1[EepPublic.cSource].VideoType==itypeRGB565)|(uiaSrcMux1[EepPublic.cSource].VideoType==ityp
             -e656))
 313   1              {
 314   2                      IC_WritByte(TWIC_P0, 0x33,0x00);
 315   2                      twdDelay(50);
 316   2                  IC_WritByte(TWIC_P0, 0x32,0x3f);
 317   2                      twdDelay(50);
 318   2                      m_cBuff[0]=IC_ReadByte(TWIC_P0, 0x32);    //interrupt status register           
 319   2                      m_cBuff[0] &= 0x01;             //if lost vsync
 320   2              }
 321   1       
 322   1              if (uiaSrcMux1[EepPublic.cSource].VideoType==itypeRGB)
 323   1              {
 324   2      //          m_cBuff[0]=!SyncChangDect();
 325   2              }
 326   1      
 327   1              if (uiaSrcMux1[EepPublic.cSource].SourceRoute==isrcVIDEO)
 328   1              {
 329   2                  m_cBuff[0]=IC_ReadByte(TWIC_P2, 0x3A)&0x01;        // if signal detected
 330   2              }
 331   1      
 332   1              if(m_cBuff[0])  // No signal
 333   1              {
 334   2                      if((detect)||(NoSignal!=m_cBuff[0]))  // When switch to signal lost input or Signal lost
 335   2                      {
 336   3                              Timer0Stop();
 337   3                              ClosePanel(0x10, 0xff, 0x40);                           
 338   3                      }
 339   2              }
 340   1              else
 341   1              {
 342   2                      if((detect)|| (NoSignal!=m_cBuff[0]))  //When video switch and signal is normal
 343   2                      {
 344   3                              OpenPanel();
 345   3                      }       
 346   2          }
 347   1              NoSignal= m_cBuff[0];
 348   1      }
 349          //#endif //AUTO_DETECT


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   2097    ----
   CONSTANT SIZE    =      8    ----
   XDATA SIZE       =   ----       2
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----       1
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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