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

📄 t101_util.lst

📁 T112 MCU源程码,用于T112外接MCU篇程,用来驱动模拟屏
💻 LST
字号:
C51 COMPILER V7.06   T101_UTIL                                                             03/01/2007 08:05:39 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE T101_UTIL
OBJECT MODULE PLACED IN T101_Util.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE source\T101_Util.c BROWSE INCDIR(Z:\CB\T112项目\原始资料\AV总备份\1.8\inclu
                    -de\) DEBUG OBJECTEXTEND PRINT(.\T101_Util.lst) OBJECT(T101_Util.obj)

stmt level    source

   1          /****************************************************************************
   2          * File: T101_Util.c                                                         *
   3          * Description: Define T10x chip control policy                              *
   4          * History:     2005/08/12                                                   *
   5          *                                                                           *
   6          *               Copyright 2005 (c) Terawins Inc.                            *
   7          ****************************************************************************/
   8          
   9          /****************************************************************************
  10          *                               Include File                                *
  11          ****************************************************************************/
  12          #include <reg51.h>
  13          #include "common.h"
  14          #include "SYSTEM.H"
  15          #include "struct.h"
  16          #include "twowire.h"
  17          #include "OSDDRAW.H"
  18          #include "T101_Util.h"
  19          #include "TW10xReg.h"
  20          #include "top18.h"
  21          #include "tcon.c"
  22          #include "felt50.c"
  23          #include "felt54.c"
  24          #include "pal50.c"
  25          #include "pal54.c"
  26          #include "ntsc50.c"
  27          #include "ntsc54.c"
  28          
  29          
  30          extern uCHAR    idata   m_cStandard;
  31          extern uCHAR    idata   m_cBuff;
  32          extern uCHAR    row_num;
  33           
  34          /****************************************************************************
  35          *                   (0x15,0)   Public Function                              *
  36          ****************************************************************************/
  37          
  38                  void Init_pal(void)                                             
  39                  {
  40   1                      uCHAR RegIndex,RegAdr;
  41   1                      RegIndex=0;
  42   1                      RegAdr=stInitT10xP0_PAL[0].ucRegAdr;
  43   1                      while (RegAdr != 0xFF)                                  
  44   1                      {
  45   2                              I2CWriteByte(TW101,RegAdr,stInitT10xP0_PAL[RegIndex].ucRegVal);
  46   2                              RegAdr=stInitT10xP0_PAL[++RegIndex].ucRegAdr;
  47   2                      }
  48   1                      RegIndex=0;
  49   1                      RegAdr=stInitT10xP2_PAL[0].ucRegAdr;
  50   1                      while (RegAdr != 0xFF)          
  51   1                      {
  52   2                              I2CWriteByte(TW101+4,RegAdr,stInitT10xP2_PAL[RegIndex].ucRegVal);
  53   2                              RegAdr=stInitT10xP2_PAL[++RegIndex].ucRegAdr;
  54   2                      }
C51 COMPILER V7.06   T101_UTIL                                                             03/01/2007 08:05:39 PAGE 2   

  55   1              }       
  56                  void Init_ntsc(void)                                    
  57                  {
  58   1                      uCHAR RegIndex,RegAdr;
  59   1                      RegIndex=0;
  60   1                      RegAdr=stInitT10xP0_NTSC[0].ucRegAdr;
  61   1                      while (RegAdr != 0xFF)                                  
  62   1                      {
  63   2                              I2CWriteByte(TW101,RegAdr,stInitT10xP0_NTSC[RegIndex].ucRegVal);
  64   2                              RegAdr=stInitT10xP0_NTSC[++RegIndex].ucRegAdr;
  65   2                      }
  66   1                      RegIndex=0;
  67   1                      RegAdr=stInitT10xP2_NTSC[0].ucRegAdr;
  68   1                      while (RegAdr != 0xFF)          
  69   1                      {
  70   2                              I2CWriteByte(TW101+4,RegAdr,stInitT10xP2_NTSC[RegIndex].ucRegVal);
  71   2                              RegAdr=stInitT10xP2_NTSC[++RegIndex].ucRegAdr;
  72   2                      }
  73   1              }   
  74                       
  75                  void Init(void)                                                         
  76                  {
  77   1                      uCHAR RegIndex,RegAdr;
  78   1                      twdDelay1(50);
  79   1                      RegIndex=0;
  80   1                      RegAdr=stInitT10xP0[0].ucRegAdr;
  81   1                      while (RegAdr != 0xFF)                          
  82   1                      {
  83   2                              if(RegAdr==0x15)
  84   2                                      WriteTPG051( 0x15, 0x00);
  85   2                              else
  86   2                                      I2CWriteByte(TW101,RegAdr,stInitT10xP0[RegIndex].ucRegVal);
  87   2                              RegAdr=stInitT10xP0[++RegIndex].ucRegAdr;
  88   2                      }       
  89   1                      RegIndex=0;
  90   1                      RegAdr=stInitT10xP2[0].ucRegAdr;
  91   1                      while (RegAdr != 0xFF)          
  92   1                      {
  93   2                              if(RegAdr==0x14)
  94   2                                      WriteTPG051( 0x14, 0x00);
  95   2                              else
  96   2                                      I2CWriteByte(TW101+4,RegAdr,stInitT10xP2[RegIndex].ucRegVal);
  97   2                              RegAdr=stInitT10xP2[++RegIndex].ucRegAdr;
  98   2                      }
  99   1                      RegIndex=0;
 100   1                      RegAdr=stInitT10xP1[0].ucRegAdr;
 101   1                      while (RegAdr != 0xFF)          
 102   1                      {
 103   2                              I2CWriteByte(TW101+2,RegAdr,stInitT10xP1[RegIndex].ucRegVal);
 104   2                              RegAdr=stInitT10xP1[++RegIndex].ucRegAdr;
 105   2                      }
 106   1                      if(row_num==1)
 107   1                              Init_pal();
 108   1                      else
 109   1                              Init_ntsc();    
 110   1                      I2CWriteByte(TW101, 0xe2, 0x11);                
 111   1              }
 112                  
 113                  void InitT10x(void)                                             ///制式判断处理
 114                  {       
 115   1                      switch(m_cBuff)
 116   1                      {
C51 COMPILER V7.06   T101_UTIL                                                             03/01/2007 08:05:39 PAGE 3   

 117   2                              case S_NTSC:
 118   2                                              Init_ntsc();
 119   2                                              break;
 120   2                              case S_PAL:
 121   2                                              Init_pal();
 122   2                                              break;
 123   2                      }       
 124   1                      I2CWriteByte(TW101, 0xe2, 0x11);
 125   1              }       
 126                          
 127                  void DetectSignalStd(void)                              ////涉及到m_cStandard & m_cChroma两个参数,探测标准信号
 128                  {
 129   1                      m_cBuff=m_cStandard;                            
 130   1                      if(I2CReadByte(0x54, 0x3A)&0x06)                // Judge vlock and hlock
 131   1                      {       
 132   2                              if(I2CReadByte(TW101,0x59) <= 0xd6)     
 133   2                                      {
 134   3                                              m_cBuff=S_NTSC; 
 135   3                                      } 
 136   2                              else 
 137   2                                      {
 138   3                                              m_cBuff=S_PAL; 
 139   3                                      }
 140   2                              if((m_cStandard!=m_cBuff))
 141   2                              {       // signal std was changed,and output timing must be set again
 142   3                                      m_cStandard=m_cBuff;                                                
 143   3                                      InitT10x();
 144   3                      }       
 145   2                      }
 146   1              }
 147          
 148          
 149          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    524    ----
   CONSTANT SIZE    =    272    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       4
   IDATA SIZE       =   ----    ----
   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 + -