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

📄 lcd_func.lst

📁 Realtek 公司的RTD2523A芯片原厂source code,没有被修改过的。
💻 LST
📖 第 1 页 / 共 5 页
字号:
C51 COMPILER V6.20c  LCD_FUNC                                                              04/15/2004 12:59:09 PAGE 1   


C51 COMPILER V6.20c, COMPILATION OF MODULE LCD_FUNC
OBJECT MODULE PLACED IN .\Output\Lcd_func.obj
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE Code\Lcd_func.c OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Output\
                    -Lcd_func.lst) OBJECT(.\Output\Lcd_func.obj) 

stmt level    source

   1          #define __FUNC__
   2          
   3          #include "reg52.h"
   4          #include "intrins.h"
   5          
   6          #include "Header\MAIN_DEF.H"
   7          #include "Header\MTV512.H"
   8          #include "Header\CONFIG.H"
   9          #include "Header\ACCESS.H"
  10          #include "Header\OSD.H"
  11          #include "Header\LCD_COEF.H"
  12          #include "Header\LCD_MAIN.H"
  13          #include "Header\LCD_AUTO.H"
  14          #include "Header\LCD_FUNC.H"
  15          #include "Header\FRAME_SYNC.H"
  16          #include "Header\LCD_OSD.H"
  17          
  18          
  19          #if (TV_CHIP != TV_NONE)
              #include "TUNER.H"
              #endif
  22          
  23          void SetVolume()
  24          {
  25   1          stGUD3.VOLUME   &= 0x1f;
  26   1      
  27   1      #if (AUDIO_TYPE == AUDIO_LM4832)
                  Data[0] = 10;
                  Data[1] = ADDR_LM4832;
                  Data[2] = 0x00;
                  Data[3] = 0x02;
                  Data[4] = 0x00;                     // Input Volume - 0 dB
                  Data[5] = 0x26;                     // Bass         - 0 dB
                  Data[6] = 0x46;                     // Treble       - 0 dB
                  Data[7] = 0x60 | stGUD3.VOLUME;     // Right Volume
                  Data[8] = 0x80 | stGUD3.VOLUME;     // Left Volume
              
                  // Mic 1 selected with 20dB when input source is VGA or DVI
                  // Both Mic 1 and 2 selected with 20dB when input source is AV or S-Video
                  Data[9] = (SOURCE_AV <= (stGUD1.INPUT_SOURCE & 0x07)) ? 0xa6 : 0xa4;
                  
                  I2CWrite(Data);
              #endif
  44   1      
  45   1      #if (AUDIO_TYPE == AUDIO_PWM2)
                  Data[0] = 6;
                  Data[1] = Y_INC;
                  Data[2] = OSD_ROW_90;
                  Data[3] = 0x80;
                  Data[4] = 0x01;
              #if (INV_VOLUME)
                  Data[5] = (0xff -(stGUD3.VOLUME << 3));
              #else
              	Data[5] = (stGUD3.VOLUME << 3);
C51 COMPILER V6.20c  LCD_FUNC                                                              04/15/2004 12:59:09 PAGE 2   

              #endif
              	Data[6] = 0;
                  RTDWrite(Data);
              #endif
  59   1      
  60   1      
  61   1      #if (AUDIO_TYPE == AUDIO_PWM0)
              
                  Data[0] = 6;
                  Data[1] = Y_INC;
                  Data[2] = OSD_ROW_90;
                  Data[3] = 0x00;
                  Data[4] = 0x01;
              #if (INV_VOLUME)
                  Data[5] = (0xff -(stGUD3.VOLUME << 3));
              #else
              	Data[5] = (stGUD3.VOLUME << 3);
              #endif
              	Data[6] = 0;
                  RTDWrite(Data);
              #endif
  76   1      }
  77          
  78          void WriteGamma(unsigned char code *arrayR, unsigned char code *arrayG, unsigned char code *arrayB)
  79          {
  80   1          unsigned char   n   = 0;
  81   1      
  82   1          RTDSetBit(COLOR_CTRL_5D, 0xfb, 0x10);   // Disable GAMMA & Enable Access Channel
  83   1      
  84   1          // GAMMA_RED
  85   1          bRTD_SCSB   = 0;
  86   1          RTDSendAddr(RED_GAMMA_64, WRITE, N_INC);
  87   1          do
  88   1          {
  89   2              RTDSendByte(arrayR[n]);
  90   2          }
  91   1          while (++n);    // if n is 0xff, then n will be 0x00 after increased.
  92   1          
  93   1          RTDSendStop();
  94   1          
  95   1          // GAMMA_GREEN
  96   1          bRTD_SCSB   = 0;
  97   1          RTDSendAddr(GRN_GAMMA_65, WRITE, N_INC);
  98   1          do
  99   1          {
 100   2              RTDSendByte(arrayG[n]);
 101   2          }
 102   1          while (++n);
 103   1      
 104   1          RTDSendStop();
 105   1          
 106   1          //GAMMA_BLUE
 107   1          bRTD_SCSB   = 0;
 108   1          RTDSendAddr(BLU_GAMMA_66, WRITE, N_INC);
 109   1          do
 110   1          {
 111   2              RTDSendByte(arrayB[n]);
 112   2          }
 113   1          while (++n);
 114   1      
 115   1          RTDSendStop();
 116   1         
C51 COMPILER V6.20c  LCD_FUNC                                                              04/15/2004 12:59:09 PAGE 3   

 117   1          RTDSetBit(COLOR_CTRL_5D, 0xef, 0x04);   // Enable GAMMA & Diable Access Channel
 118   1      }
 119          
 120          void WriteDither(unsigned char code *array, bit new_dither)
 121          {
 122   1          unsigned char   n;
 123   1          
 124   1          RTDSetBit(FX_LST_LEN_H_5A, 0x7f, new_dither ? 0x80 : 0x00);
 125   1      
 126   1          RTDSetBit(COLOR_CTRL_5D, 0xb7, 0x68);   // Enable DITHER & Enable Access Channels
 127   1      
 128   1          bRTD_SCSB   = 0;
 129   1          RTDSendAddr(DITHER_PORT_67, WRITE, N_INC);
 130   1      
 131   1          for (n = 0; n < 8; n++)     RTDSendByte(array[n]);
 132   1      
 133   1          RTDSendStop();
 134   1          
 135   1      	RTDSetBit(COLOR_CTRL_5D, 0x1f, 0x88);   // Enable DITHER & Disable Access Channels
 136   1      }
 137          
 138          void WriteSU_COEF(unsigned char code *arrayH, unsigned char code *arrayV)
 139          {
 140   1          unsigned char   n;
 141   1          
 142   1          RTDSetBit(FILTER_CTRL1_1C, 0xfc, 0x01);     // Enable H-Coeff access
 143   1      
 144   1          bRTD_SCSB   = 0;
 145   1          RTDSendAddr(FILTER_PORT_1D, WRITE, N_INC);
 146   1          for (n = 0; n < 128; n++)    RTDSendByte(arrayH[n]);
 147   1      
 148   1          RTDSendStop();
 149   1      
 150   1          RTDSetBit(FILTER_CTRL1_1C, 0xfc, 0x03);     // Enable V-Coeff access
 151   1          
 152   1          bRTD_SCSB   = 0;
 153   1          RTDSendAddr(FILTER_PORT_1D, WRITE, N_INC);
 154   1          for (n = 0; n < 128; n++)    RTDSendByte(arrayV[n]);
 155   1      
 156   1          RTDSendStop();
 157   1      
 158   1          RTDSetBit(FILTER_CTRL1_1C, 0xfc, 0xc4);     // Disable filter coefficient access
 159   1      }
 160          
 161          void Set_H_Position(void)
 162          {
 163   1      #if (AS_NON_FRAMESYNC)
                  RTDSetBit(ODD_CTRL_8E, 0xef, 0x00);
              #endif
 166   1      
 167   1          // if the backporch is far small then the standard one,
 168   1      	// it is possibile that even IHS_Delay decrease to zero still can't correct the H position
 169   1      	// so adjust the usIPH_ACT_STA first and turn back to original value later
 170   1      
 171   1          if (ucH_Min_Margin > stMUD.H_POSITION)
 172   1          {
 173   2              if (usIPH_ACT_STA > (ucH_Min_Margin - stMUD.H_POSITION))
 174   2              {
 175   3                  usIPH_ACT_STA   -= (ucH_Min_Margin - stMUD.H_POSITION);
 176   3              }
 177   2              
 178   2              stMUD.H_POSITION    = ucH_Min_Margin;
C51 COMPILER V6.20c  LCD_FUNC                                                              04/15/2004 12:59:09 PAGE 4   

 179   2          }
 180   1      
 181   1          // Data[8][9]
 182   1          ((unsigned int *)Data)[4]   = usIPH_ACT_STA;
 183   1      
 184   1          Wait_For_Event(EVENT_IEN_STOP);
 185   1              
 186   1          Data[0] = 5;
 187   1          Data[1] = Y_INC;
 188   1          Data[2] = IPH_ACT_STA_06;
 189   1          Data[3] = (unsigned char)((unsigned int*)Data)[4];
 190   1          Data[4] = (unsigned char)(((unsigned int*)Data)[4] >> 8);
 191   1          Data[5] = 0;    
 192   1          RTDWrite(Data);
 193   1      
 194   1          if (bAutoInProgress)
 195   1          {
 196   2              RTDSetByte(IHS_DELAY_8D, (stMUD.H_POSITION - ucH_Min_Margin) + PROGRAM_HDELAY);
 197   2          }
 198   1      
 199   1          // Update IHS delay according to phase
 200   1          Set_Phase(stMUD.PHASE & 0x7c);
 201   1      
 202   1      	RTDSetByte(STATUS0_01, 0x00);  // Clear status
 203   1          RTDSetByte(STATUS1_1F, 0x00);  // Clear status
 204   1          
 205   1      #if (AS_NON_FRAMESYNC)
                  if (bFrameSync && bStable)  RTDSetBit(ODD_CTRL_8E, 0xef, 0x10);
              #endif
 208   1      }
 209          
 210          
 211          #define MAX_V_ADJUST_STEP   2
 212          
 213          void Adjust_V_Position(void)
 214          {
 215   1          unsigned int    usIV_Temp, usDV_Temp;
 216   1      
 217   1      #if (AS_NON_FRAMESYNC)
                  // Disable Frame-Sync watch-dog
                  RTDSetBit(ODD_CTRL_8E, 0xef, 0x00);
              #endif
 221   1      
 222   1      #if (AS_DV_TOTAL)
                  // Disable DV_Total watch-dog
                  RTDSetBit(DV_BKGD_STA_31, 0x7f, 0x00);
              #endif
 226   1      
 227   1          /*
 228   1          // Disable Frame-Sync watch-dog
 229   1          RTDSetBit(ODD_CTRL_8E, 0xef, 0x00);
 230   1          // Disable DV_Total watch-dog
 231   1          RTDSetBit(DV_BKGD_STA_31, 0x7f, 0x00);
 232   1          */
 233   1      
 234   1          if ((ucV_Max_Margin - 1)  < stMUD.V_POSITION)
 235   1          {
 236   2              RTDSetByte(IVS_DELAY_8C, (PROGRAM_VDELAY + stMUD.V_POSITION - (ucV_Max_Margin - 1)));
 237   2              usIV_Temp   = usIPV_ACT_STA + (ucV_Max_Margin - 1) - 128;
 238   2              usDV_Temp   = (unsigned int)ucDV_Delay + (ucV_Max_Margin - 1) - 128;
 239   2          }
 240   1          else
C51 COMPILER V6.20c  LCD_FUNC                                                              04/15/2004 12:59:09 PAGE 5   

 241   1          {
 242   2              RTDSetByte(IVS_DELAY_8C, PROGRAM_VDELAY);
 243   2              usIV_Temp   = usIPV_ACT_STA + stMUD.V_POSITION - 128;
 244   2              usDV_Temp   = (unsigned int)ucDV_Delay + stMUD.V_POSITION - 128;
 245   2          }
 246   1      
 247   1          Wait_For_Event(EVENT_IEN_START);
 248   1      
 249   1          Data[0] = 4;
 250   1          Data[1] = N_INC;
 251   1          Data[2] = IV_DV_LINES_38;
 252   1          Data[3] = (unsigned char)usDV_Temp;
 253   1          Data[4] = 5;    
 254   1          Data[5] = Y_INC;
 255   1          Data[6] = IPV_ACT_STA_0A;
 256   1          Data[7] = (unsigned char)usIV_Temp;
 257   1          Data[8] = (unsigned char)(usIV_Temp >> 8);
 258   1          Data[9] = 0;
 259   1          RTDWrite(Data);
 260   1      
 261   1          // Just for safe
 262   1          Wait_For_Event(EVENT_DEN_STOP);
 263   1          RTDSetByte(STATUS0_01, 0x00);  // Clear status
 264   1          RTDSetByte(STATUS1_1F, 0x00);  // Clear status
 265   1      
 266   1      #if (AS_NON_FRAMESYNC)
                  if (bFrameSync && bStable)  RTDSetBit(ODD_CTRL_8E, 0xef, 0x10);
              #endif
 269   1      
 270   1      #if (AS_DV_TOTAL)
                  if (bFrameSync && bStable)
                  {
                      RTDSetByte(DV_TOTAL_STATUS_3D, 0x00);  //Write once to clear status
                      RTDSetBit(DV_BKGD_STA_31, 0x7f, 0x80);
                  }
              #endif
 277   1      }
 278          
 279          void Set_V_Position(void)
 280          {
 281   1      #if (PANEL_TYPE != PANEL_HYUNDAI)
 282   1      
 283   1          Adjust_V_Position();
 284   1      
 285   1      #else
              
                  static unsigned char idata ucPre_V_POS  = 0x80;
              
                  unsigned char ucPosV    = stMUD.V_POSITION;
              
                  do
                  {
                      if (stMUD.V_POSITION >= ucPre_V_POS)
              		{
                          Data[0]     = stMUD.V_POSITION - ucPre_V_POS;
                          ucPre_V_POS += (Data[0] > MAX_V_ADJUST_STEP) ? MAX_V_ADJUST_STEP : Data[0];

⌨️ 快捷键说明

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