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

📄 nvram.lst

📁 terawin的t103 LCD驱动程序
💻 LST
字号:
C51 COMPILER V7.50   NVRAM                                                                 10/30/2006 16:14:41 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE NVRAM
OBJECT MODULE PLACED IN .\Obj\NVRAM.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Source\Comm\NVRAM.C LARGE OPTIMIZE(6,SPEED) BROWSE INCDIR(.\Include\;.\Sour
                    -ce\;.\Include\Panel\;.\Include\GammaTable\;.\Include\tuner\) DEFINE(T103) DEBUG OBJECTEXTEND PRINT(.\NVRAM.lst) OBJECT(.
                    -\Obj\NVRAM.obj)

line level    source

   1          #include <reg51.h>
   2          //#include "common.h"
   3          #include "Struct.h"
   4          #include "TW803Reg.h"
   5          #include "system.h"
   6          #include "NVRam.h"
   7          #include "TwoWire.h"
   8          #include "KeyPad.h"
   9          //#include "Video.h"
  10          //#include "gamma.h"
  11          #include "T803_Util.h"
  12          #include "Global.h"
  13                  
  14          #ifdef NVRAM
  15          
  16          void EEPLoadPubData(void)
  17          {
  18   1              if(!(ReadPort()&kyMENU))
  19   1      //      if((ReadPort()&kyMENU))
  20   1              {
  21   2                      InitEEPRom();
  22   2                      OSDResetVideoData();
  23   2                      while(!(ReadPort()&kyMENU))     {};
  24   2              }
  25   1              else
  26   1              {
  27   2                      if(I2CReadByte(0xA0, 0x00) != '1' || I2CReadByte(0xA0, 0x01)!= '1' || I2CReadByte(0xA0, 0x02)!= '1' )
  28   2                      {
  29   3                              InitEEPRom();
  30   3                              OSDResetVideoData();
  31   3                              EEPSaveVideoData();//
  32   3                      }
  33   2                      else
  34   2                              I2CReadBytes(EEPVIDEOBLOCK, 0x04, (uCHAR *)&EepVideo, EEPVIDEOSIZE);
  35   2              }
  36   1      #ifdef TV
                      if(I2CReadByte(EEPVIDEOBLOCK, idVIDEO_FLAG_INDEX)&0x01)
                      {
                              m_bAir_Cable=1;
                      }
                      else
                      {
                              m_bAir_Cable=0;
                      }
              #endif
  46   1              OSDSetVideoValues();
  47   1              EEPSaveVideoData();
  48   1      }
  49          
  50          void InitEEPRom(void)
  51          {
  52   1              I2CWriteByte(EEPBLOCK0, 0x00, '1');
  53   1              twdDelay(NVRDELAY);
C51 COMPILER V7.50   NVRAM                                                                 10/30/2006 16:14:41 PAGE 2   

  54   1              I2CWriteByte(EEPBLOCK0, 0x01, '1');
  55   1              twdDelay(NVRDELAY);
  56   1              I2CWriteByte(EEPBLOCK0, 0x02, '1');
  57   1      
  58   1      }
  59          
  60          void OSDResetVideoData(void)
  61          {
  62   1              EepVideo.cBright        = V_BRIGHT_DEF;
  63   1              EepVideo.cContrast      = V_CONTRAST_DEF ;
  64   1              EepVideo.cSharp         = V_SHARP_DEF;
  65   1              EepVideo.cHue           = V_HUE_DEF;
  66   1              EepVideo.cSat           = V_SAT_DEF;
  67   1              EepVideo.cVolume        = 0x80;
  68   1              EepVideo.cGamma         = 0;
  69   1      #ifdef T112                        // add by Sherman 06'01'18
                      EepVideo.cRGB           = V_RGB_DEF;
                      EepVideo.cVCOMA         = V_VCOMA_DEF;  // add by Sherman 06'01'23
                      EepVideo.cVCOMD         = V_VCOMD_DEF;  // add by Sherman 06'01'23
              #endif
  74   1      }
  75          
  76          void OSDSetVideoValues(void)
  77          {
  78   1      //      I2CWriteByte(VIDEO_ADDR,VSHARP,(I2CReadByte(VIDEO_ADDR,VSHARP)&0xF0)|EepVideo.cSharp);
  79   1          I2CWriteByte(TW803_P2,0x80,V_SHARP_MSK|(EepVideo.cSharp<<1));
  80   1      //      I2CWriteByte(VIDEO_ADDR,VBRIGHT,EepVideo.cBright);
  81   1      //      I2CWriteByte(VIDEO_ADDR,VCONTRAST,EepVideo.cContrast);
  82   1              I2CWriteByte(TW803_P0,VBRIGHT,EepVideo.cBright);
  83   1              I2CWriteByte(TW803_P0,VCONTRAST,EepVideo.cContrast);
  84   1              I2CWriteByte(VIDEO_ADDR,VSAT,EepVideo.cSat);
  85   1              I2CWriteByte(VIDEO_ADDR,VHUE,EepVideo.cHue-0x80);       
  86   1      #ifdef T112
                      I2CWriteByte(TW803_P0,VRGB,EepVideo.cRGB);        // add by Sherman 06'01'18
                      I2CWriteByte(TW803_P0,VVCOMA,EepVideo.cVCOMA);  // add by Sherman 06'01'23
                      I2CWriteByte(TW803_P0,VVCOMD,EepVideo.cVCOMD);  // add by Sherman 06'01'23
              #endif
  91   1              LoadGammaTable(EepVideo.cGamma);
  92   1      #ifdef LG_7
                      I2CWriteByte(TW803_P2, 0x80, 0x25);
              #endif
  95   1      }
  96          
  97          void EEPSaveVideoData(void)
  98          {
  99   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_CONTRAST_INDEX,EepVideo.cContrast );
 100   1              twdDelay(NVRDELAY);
 101   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_BRIGHT_INDEX, EepVideo.cBright);
 102   1              twdDelay(NVRDELAY);
 103   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_SHARP_INDEX, EepVideo.cSharp);
 104   1              twdDelay(NVRDELAY);
 105   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_HUE_INDEX, EepVideo.cHue);
 106   1              twdDelay(NVRDELAY);
 107   1      #ifdef T112
                      I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_RGB_INDEX, EepVideo.cRGB);            // add by Sherman 06'01'18
                      twdDelay(NVRDELAY);
                      I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VCOMA_INDEX, EepVideo.cVCOMA);        // add by Sherman 06'01'23
                      twdDelay(NVRDELAY);
                      I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VCOMD_INDEX, EepVideo.cVCOMD);        // add by Sherman 06'01'23
                      twdDelay(NVRDELAY);
              #endif
 115   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_SAT_INDEX, EepVideo.cSat);
C51 COMPILER V7.50   NVRAM                                                                 10/30/2006 16:14:41 PAGE 3   

 116   1              twdDelay(NVRDELAY);
 117   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VOLUME_INDEX, EepVideo.cVolume);
 118   1      }
 119          #ifdef TV
              
              void EEPSaveTVChannel(uCHAR cTVNum, uWORD wTVFreq)
              {
                      if(m_bAir_Cable)
                      {
                      I2CWriteByte(EEPVIDEOBLOCK+4, idTVCHANNEL_STAT+cTVNum*2, (uCHAR)(wTVFreq>>8));
                      twdDelay(NVRDELAY);
                      I2CWriteByte(EEPVIDEOBLOCK+4, idTVCHANNEL_STAT+cTVNum*2+1, (uCHAR)(wTVFreq&0x00FF));
                      twdDelay(NVRDELAY);
                      }
                      else
                      {
                      I2CWriteByte(EEPVIDEOBLOCK+2, idTVCHANNEL_STAT+cTVNum*2, (uCHAR)(wTVFreq>>8));
                      twdDelay(NVRDELAY);
                      I2CWriteByte(EEPVIDEOBLOCK+2, idTVCHANNEL_STAT+cTVNum*2+1, (uCHAR)(wTVFreq&0x00FF));
                      twdDelay(NVRDELAY);
                      }
              }
              
              
              
              #endif
 142          #endif


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