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

📄 lcd_main.lst

📁 keil c51平台,此代码可用于学习TFT LCD 之TCON,SCALER,OSD,(本人自己修改)
💻 LST
📖 第 1 页 / 共 5 页
字号:
C51 COMPILER V7.50   LCD_MAIN                                                              07/28/2008 16:10:53 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE LCD_MAIN
OBJECT MODULE PLACED IN .\REL_OUT\Lcd_main.obj
COMPILER INVOKED BY: D:\keil-701\C51\BIN\C51.EXE Lcd_main.c OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\REL_OUT\
                    -Lcd_main.lst) OBJECT(.\REL_OUT\Lcd_main.obj)

line level    source

   1          
   2          #define __MAIN__
   3          
   4          #include "reg52.h"
   5          #include "intrins.h"
   6          
   7          #include "MAIN_DEF.H"
   8          #include "CONFIG.H"
   9          #include "ACCESS.H"
  10          #include "LCD_COEF.H"
  11          #include "LCD_FUNC.H"
  12          #include "LCD_AUTO.H"
  13          #include "LCD_MSG.H"
  14          #include "LCD_MAIN.H"
  15          #include "LCD_OSD.H"
  16          #include "FONT.H"
  17          
  18          #if(MENU_TYPE == MENU_REL)
  19          #include "OSD_REL.H"
  20          #endif
  21          #if(MENU_TYPE == MENU_KTC)
              #include "OSD_KTC.H"
              #endif
  24          
  25          #include "MTV512.H"
  26          #include "DevOS.h"
  27          
  28          
  29          /////////////////////////////////////////////////////////////
  30          // Interrupt Service Routine for Timer0 (Fired every 20ms) //
  31          /////////////////////////////////////////////////////////////
  32          void IntProc_Timer0(void) interrupt 1
  33          {
  34   1      #if (IRPOLLING)
              
                  static unsigned char    ucIR_Seq    = 0xff;
                  static unsigned char    ucTimerCnt  = 0x00;
              
                  TL0         = TIME0_COUNTER_LBYTE;  // Reload Timer0 low-byte
                  TH0         = TIME0_COUNTER_HBYTE;  // Reload Timer0 high-byte
              
                  if (ucIR_State)
                  {
                      if (bIR_GPIO)
                      {
                          ucIR_Seq    = (ucIR_Seq << 1) | 0x01;
              
                          if ((0xff == ucIR_Seq) && (ucIR_State & 0xfe))
                          {
                              ucIR_State  = 0;    // Command timeout; Back to idle state
                              
                              ((unsigned int *)ucIR_Cmd)[0]   = 0;
                          }
                      }
C51 COMPILER V7.50   LCD_MAIN                                                              07/28/2008 16:10:53 PAGE 2   

                      else
                      {
                          if (1 < ucIR_State)
                          {
                              if (ucIR_Seq & 0x01)
                              {
                                  ((unsigned int *)ucIR_Cmd)[0]   = (((unsigned int *)ucIR_Cmd)[0] << 1) 
                                                                  | (0x07 != (ucIR_Seq & 0x07) ? 1 : 0);
              
                                  if (23 == ++ucIR_State && CUSTOM_CODE != ((unsigned int *)ucIR_Cmd)[0])
                                  {
                                      ucIR_State  = 0;    // Customer code error; Back to idle state
              
                                      ((unsigned int *)ucIR_Cmd)[0]   = 0;
                                  }
                                  else if (39 == ucIR_State)
                                  {
                                      ucIR_State  = 0;    // Command complete; Back to idle state
              
                                      ucIR_Cmd[1] = 8;    // Set command timer to 8 (7*20 = 140ms)
                                  }
                              }
                              else if (0x00 == (ucIR_Seq & 0xfe))
                              {
                                  ucIR_State  = 0;    // Command crashed; Back to idle state
                  
                                  ((unsigned int *)ucIR_Cmd)[0]   = 0;
                              }
                          }
                          else                        // ucIR_State is 1
                          {
                              if (0xff == ucIR_Seq)
                              {
                                  ucIR_State  = 0x07; // Start to decode new command and clear old command
                  
                                  ((unsigned int *)ucIR_Cmd)[0]   = 0;
                              }
                              else
                              {
                                  ucIR_State  = 0;    // Fire repeat command and reset to idle
              
                                  ucIR_Cmd[1] = ucIR_Cmd[0] ? 8 : 0;
                              }
                          }
                          
                          ucIR_Seq    = ucIR_Seq << 1;
                      }
                  }
                  else
                  {
                      ucIR_Seq    = (ucIR_Seq << 1) | bIR_GPIO;
              
                      if (0x07 == ucIR_Seq)   ucIR_State  = 1;    // Leader code detected
                  }
              
                  if (54 <= ++ucTimerCnt)        // 0.375ms*54 = 20.25ms passed
                  {
                      ucTimerCnt          = 0;
              
                      bNotify_Timer0_Int  = 1;    // Post Timer0's timeout message
              
                      if (usOSD_Timer)    usOSD_Timer -= 1;   // For OSD Timeout
C51 COMPILER V7.50   LCD_MAIN                                                              07/28/2008 16:10:53 PAGE 3   

              
                      // Clear command after 144ms if not repeat code
                      if (0 == ucIR_State)
                      {
                          if (ucIR_Cmd[1] && 0 == --ucIR_Cmd[1])      ucIR_Cmd[0] = 0;
                      }
                  }
              
              #else
 126   1      
 127   1          TL0         = TIME0_COUNTER_LBYTE;  // Reload Timer0 low-byte
 128   1          TH0         = TIME0_COUNTER_HBYTE;  // Reload Timer0 high-byte
 129   1      
 130   1          bNotify_Timer0_Int  = 1;    // Post Timer0's timeout message
 131   1      
 132   1          if (usOSD_Timer)    usOSD_Timer -= 1;   // For OSD Timeout
 133   1      #endif
 134   1      }
 135          
 136          ///////////////////////////////////////////////////////////////////////
 137          // Interrupt Service Routine for Timer1 (Fired in 1ms after restart) //
 138          ///////////////////////////////////////////////////////////////////////
 139          void IntProc_Timer1(void) interrupt 3
 140          {   
 141   1          TR1 = 0;                    // Stop Timer1
 142   1              TL1 = TIME1_COUNTER_LBYTE;  // Reload Timer1 low-byte
 143   1              TH1 = TIME1_COUNTER_HBYTE;
 144   1      //    TH1 = (bAutoInProgress == 1) ? TIME1_COUNTER_HHBYTE : TIME1_COUNTER_HBYTE;  // Reload Timer1 hifh-by
             -te
 145   1      
 146   1          bNotify_Timer1_Int  = 1;    // Post Timer1's timeout message    
 147   1      }
 148          
 149          /////////////////////////////////////////////////////////////////////////////////
 150          // Function Routines
 151          /////////////////////////////////////////////////////////////////////////////////
 152          void Delay_Xms(unsigned char x)     // For delay 0 ~ 255 ms
 153          {
 154   1          if (x)
 155   1          {
 156   2              bNotify_Timer1_Int  = 0;    // Clear timer1's timeout message
 157   2              TR1 = 1;                    // Start timer1
 158   2              
 159   2              while (1)
 160   2              {
 161   3                  if (bNotify_Timer1_Int)
 162   3                  {
 163   4                      TR1 = 0;
 164   4                      bNotify_Timer1_Int  = 0;    // Clear timer1's timeout message
 165   4      
 166   4                      if (--x)    TR1 = 1;        // Restart timer1 if not timeout
 167   4                      else        return;         // Timeout for X ms.
 168   4                  }
 169   3              }
 170   2          }
 171   1      }
 172          
 173          void PowerDown_ADC(void)
 174          {
 175   1          RTDSetByte(PLL1_CTRL_D6, 0xf2);     // Power down PLL1
 176   1          RTDSetByte(PLL2_CTRL_DA, 0x40);     // Power down PLL2
 177   1          RTDSetByte(ADC_CTRL_E6, 0xb0);      // Power down ADC
C51 COMPILER V7.50   LCD_MAIN                                                              07/28/2008 16:10:53 PAGE 4   

 178   1      }
 179          
 180          void PowerUp_ADC(void)
 181          {
 182   1          RTDSetByte(PLL1_CTRL_D6, 0xf3);     // Power up PLL1
 183   1          RTDSetByte(PLL2_CTRL_DA, 0x41);     // Power up PLL2
 184   1          RTDSetByte(ADC_CTRL_E6, 0xb7);      // Power up ADC
 185   1      
 186   1          RTDSetByte(PLL2_FILTER_DD, 0x1f);
 187   1      }
 188          
 189          
 190          
 191          
 192          
 193          
 194          
 195          
 196          
 197          
 198          
 199          
 200          
 201          
 202          
 203                 
 204          
 205          
 206          
 207          
 208          void PowerDown_VDC(void)
 209          {
 210   1      #if (VIDEO_CHIP != VDC_NONE)
                  bVDC_PWR    = VDC_OFF;
              #endif
 213   1      }
 214          
 215          void PowerUp_VDC(void)
 216          {
 217   1      #if (VIDEO_CHIP != VDC_NONE)
                   bVDC_PWR    = VDC_ON;
              #endif
 220   1      }
 221          
 222          void PowerDown_LVDS(void)
 223          {
 224   1      #if (OUTPUT_BUS == LVDS_TYPE)
              RTDCodeW(LVDS_POWERDOWN);
              #endif
 227   1      }
 228          
 229          void PowerUp_LVDS(void)
 230          {
 231   1      #if (OUTPUT_BUS == LVDS_TYPE)
              RTDCodeW(LVDS_POWERUP);
              #endif
 234   1      }
 235          
 236          void PowerUp_RSDS(void)
 237          {
 238   1      #if(OUTPUT_BUS == RSDS_TYPE)
                  bRSDS_VCC12 = RSDS_ON;
C51 COMPILER V7.50   LCD_MAIN                                                              07/28/2008 16:10:53 PAGE 5   

              #endif
 241   1      }
 242          
 243          void PowerDown_RSDS(void)
 244          {
 245   1      #if(OUTPUT_BUS  == RSDS_TYPE)
                  bRSDS_VCC12 = RSDS_OFF;
              #endif
 248   1      }
 249          
 250          void Firmware_Init(void)
 251          {
 252   1      #if(MCU_TYPE == MCU_WINBOND)
              
                  bLIGHT_PWR  = LIGHT_OFF;
                  bPANEL_PWR  = PANEL_OFF;
              
                  RTDCodeW(RTD_PWUP_INI);
              
                  RTDSetByte(HOSTCTRL_02, 0x40);          // Wake RTD up
                  RTDSetByte(DPLL_CTRL_D0, 0x11);         // Enable DPLL
              

⌨️ 快捷键说明

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