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

📄 lcd_msg.lst

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


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

line level    source

   1          #define __MESSAGE__
   2          
   3          #include "reg52.h"
   4          
   5          #include "MAIN_DEF.H"
   6          #include "CONFIG.H"
   7          #include "ACCESS.H"
   8          #include "LCD_FUNC.H"
   9          #include "LCD_MSG.H"
  10          #include "LCD_MAIN.H"
  11          #include "LCD_OSD.H"
  12          #include "MTV512.H"
  13          
  14          unsigned char GetKeyState(void)
  15          {
  16   1          unsigned char ucKeyState=0;
  17   1      
  18   1      #if (IRPOLLING)
                  {
                      Data[0]   = (1 < ucIR_State) ? 0 : ucIR_Cmd[0];
              
                      if (Data[0])
                      {
                          switch (Data[0])
                          {
              #if (POWER_KEY_TYPE == TYPE_ONE_TOUCH)
                          // Only when power-key is one-touch style, you can use IR remote controller to switch power on
             -/off
                          case IR_POWER_KEY :     ucKeyState=ucKeyState|POWER_KEY_MASK;     break;//0x10
              #endif
                          // Use IR to implement standard key
                          case IR_ENTER_KEY :     ucKeyState=ucKeyState|ENTER_KEY_MASK;     break;//0x02
                          // Other IR function key
                          default :        
                              ucKeyState=ucKeyState|IR_KEY_MASK;
              
              #if (VIDEO_CHIP != VDC_NONE)
                              switch (Data[0])
                              {
                              case IR_FUNC_SOURCE :   Data[0] = NOTIFY_IR_SOURCE;     break;//0x1a
                              case IR_FUNC_DISP :     Data[0] = NOTIFY_IR_DISP;       break;//0x1b
                              case IR_FUNC_JUMP :     Data[0] = NOTIFY_IR_JUMP;       break;//0x1c
                              case IR_FUNC_CHDEC :    Data[0] = NOTIFY_IR_CHDEC;      break;//0x1d
                              case IR_FUNC_CHINC :    Data[0] = NOTIFY_IR_CHINC;      break;//0x1e
                              case IR_FUNC_VOLINC :   Data[0] = NOTIFY_IR_VOLINC;     break;//0x1f
                              case IR_FUNC_VOLDEC :   Data[0] = NOTIFY_IR_VOLDEC;     break;//0x20
                              case IR_FUNC_MENU :     Data[0] = NOTIFY_IR_MENU;       break;//0x21
                              case IR_FUNC_CHNUM :    Data[0] = NOTIFY_IR_CHNUM;      break;//0x22
                              case IR_FUNC_MUTE :     Data[0] = NOTIFY_IR_MUTE;       break;//0x23
                              case IR_FUNC_NUM0 :     Data[0] = NOTIFY_IR_NUM0;       break;//0x10
                              case IR_FUNC_NUM1 :     Data[0] = NOTIFY_IR_NUM1;       break;//0x11
                              case IR_FUNC_NUM2 :     Data[0] = NOTIFY_IR_NUM2;       break;//0x12
                              case IR_FUNC_NUM3 :     Data[0] = NOTIFY_IR_NUM3;       break;//0x13
                              case IR_FUNC_NUM4 :     Data[0] = NOTIFY_IR_NUM4;       break;//0x14
C51 COMPILER V7.50   LCD_MSG                                                               07/28/2008 16:10:57 PAGE 2   

                              case IR_FUNC_NUM5 :     Data[0] = NOTIFY_IR_NUM5;       break;//0x15
                              case IR_FUNC_NUM6 :     Data[0] = NOTIFY_IR_NUM6;       break;//0x16
                              case IR_FUNC_NUM7 :     Data[0] = NOTIFY_IR_NUM7;       break;//0x17
                              case IR_FUNC_NUM8 :     Data[0] = NOTIFY_IR_NUM8;       break;//0x18
                              case IR_FUNC_NUM9 :     Data[0] = NOTIFY_IR_NUM9;       break;//0x19
                              case IR_LEFT_KEY  :     Data[0] = NOTIFY_IR_LEFT_KEY;   break;//0x19
                              case IR_RIGHT_KEY :     Data[0] = NOTIFY_IR_RIGHT_KEY;  break;//0x19
                              default :               ucKeyState  = 0;                break;
                              }
              #endif
                              break;
                          }
                      }
                  }//#if (IRPOLLING)
              #endif
  69   1      
  70   1          if(!bRIGHT_KEY)
  71   1              ucKeyState=ucKeyState|RIGHT_KEY_MASK;
  72   1          if(!bLEFT_KEY)
  73   1              ucKeyState=ucKeyState|LEFT_KEY_MASK;
  74   1          if(!bENTER_KEY)
  75   1              ucKeyState=ucKeyState|ENTER_KEY_MASK;
  76   1          if(!bAUTO_KEY)
  77   1              ucKeyState=ucKeyState|AUTO_KEY_MASK;
  78   1          if(!bPOWER_KEY)
  79   1              ucKeyState=ucKeyState|POWER_KEY_MASK;
  80   1      
  81   1      #if (KEY_TYPE == KEY_6)
                  if(!bEXIT_KEY)
                      ucKeyState=ucKeyState|EXIT_KEY_MASK;
              #endif
  85   1      
  86   1      #if (TV_CHIP != TV_NONE)
                  if(!bCHINC_KEY)
                      ucKeyState=ucKeyState|CHINC_KEY_MASK;
                  if(!bCHDEC_KEY)
                      ucKeyState=ucKeyState|CHDEC_KEY_MASK;
              #endif
  92   1      
  93   1          return ucKeyState;
  94   1      }
  95          
  96          // Key_Trans() is used for generating key related messages, including OSD timout message.
  97          // You can just issue the message or execute system default function, like changing input source.
  98          
  99          // BE CAREFUL !! YOU CANNOT CHANGE ANY OSD STATUS REGISTERS OR CALL ANY OSD PROCESS HERE !!
 100          // You should not expect OSD_Proc() can always receive your message.
 101          // Because main program will shield OSD process from been triggered when input signal isn't stable,
 102          // and terminate OSD process when input source is changed.
 103          unsigned char Key_Trans()
 104          {
 105   1          static unsigned char    idata   ucP3_Prev       = 0;
 106   1          static unsigned char    idata   ucP3_Curr       = 0;
 107   1          static unsigned char    idata   ucKey_Repeat    = 0;
 108   1      
 109   1          unsigned char   ucNotify    = NOTIFY_NONE;
 110   1      
 111   1          // Save the previous key status
 112   1          ucP3_Prev   = ucP3_Curr;
 113   1          // Sample the current key status
 114   1          ucP3_Curr   = GetKeyState();
 115   1      
C51 COMPILER V7.50   LCD_MSG                                                               07/28/2008 16:10:57 PAGE 3   

 116   1      #if (POWER_KEY_TYPE == TYPE_TWO_STATE)
                  // We MUST handle power-key first.
                  if (bPower_Status)
                  {
                      if (ucP3_Curr & POWER_KEY_MASK)
                          ucP3_Curr   ^= POWER_KEY_MASK;  // Go further to handle other keys (and mask power-key)
                      else
                      {
                          Delay_Xms(20);
              
                          ucP3_Prev   = ucP3_Curr;
                          ucP3_Curr   = GetKeyState();
              
                          if (ucP3_Curr & POWER_KEY_MASK)
                              ucP3_Curr   ^= POWER_KEY_MASK;  // Go further to handle other keys (and mask power-key)
                          else
                              return  NOTIFY_POWERDOWN;
                      }
                  }
                  else
                  {
                      if (ucP3_Curr & POWER_KEY_MASK)
                      {
                          ucKey_Issued    = 0;
              
                          Delay_Xms(20);
              
                          ucP3_Prev   = ucP3_Curr;
                          ucP3_Curr   = GetKeyState();
              
                          if (ucP3_Curr & POWER_KEY_MASK)
                              return NOTIFY_POWERUP;
                          else
                              return NOTIFY_NONE;
                      }
                      else
                          return NOTIFY_NONE;
                  }
              
              #else   // POWER_KEY_TYPE is TYPE_ONE_TOUCH
 156   1      
 157   1          if (bPower_Status)
 158   1          {
 159   2              if (POWER_KEY_MASK & ucP3_Curr)
 160   2              {
 161   3                  if ((ucP3_Prev ^ ucP3_Curr) & POWER_KEY_MASK)
 162   3                  {
 163   4                      Delay_Xms(20);
 164   4      
 165   4                      ucP3_Curr   = GetKeyState();
 166   4      
 167   4                      if ((ucP3_Prev ^ ucP3_Curr) & POWER_KEY_MASK)   
 168   4                      {
 169   5      #if (AUDIO_TYPE == AUDIO_SC7313)
                                  Data[0] = 4;
                                  Data[1] = ADDR_SC7313;
                                  Data[2] = 0xbf;                           // Front right  - mutedB  10111111b
                                  Data[3] = 0x9f;                           // Front left   - mutedB  10011111b
                                  I2CWrite(Data);
              #endif
 176   5      #if (AUDIO_TYPE == AUDIO_62429)                                 
                                  bAUDIO_PD = 0;
C51 COMPILER V7.50   LCD_MSG                                                               07/28/2008 16:10:57 PAGE 4   

              #endif  
 179   5      #if(OUTPUT_BUS == RSDS_TYPE)    //V230
                                  RTDCodeW(RTD_PW12V_DOWN);
              #endif              
 182   5                          return NOTIFY_POWERDOWN;
 183   5                      }    
 184   4                      else
 185   4                          return NOTIFY_NONE;
 186   4                  }
 187   3              }
 188   2          }
 189   1          else
 190   1          {
 191   2              if (POWER_KEY_MASK & ucP3_Curr)
 192   2              {
 193   3                  if ((ucP3_Prev ^ ucP3_Curr) & POWER_KEY_MASK)
 194   3                  {
 195   4                      ucKey_Issued    = 0;
 196   4      
 197   4                      Delay_Xms(20);
 198   4      
 199   4                      ucP3_Curr   = GetKeyState();
 200   4      
 201   4                      if ((ucP3_Prev ^ ucP3_Curr) & POWER_KEY_MASK)
 202   4                      {
 203   5      #if (AUDIO_TYPE == AUDIO_SC7313)
                                  Data[0] = 4;
                                  Data[1] = ADDR_SC7313;
                                  Data[2] = 0xb4;                           // Front right  - mutedB  10111111b
                                  Data[3] = 0x94;                           // Front left   - mutedB  10011111b
                                  I2CWrite(Data);
              #endif
 210   5      #if (AUDIO_TYPE == AUDIO_62429)                                 
                                  bAUDIO_PD = 1;
              #endif                    
 213   5                          
 214   5                          return NOTIFY_POWERUP;
 215   5                      }       
 216   4                      else
 217   4                          return NOTIFY_NONE;
 218   4                  }
 219   3                  else
 220   3                      return NOTIFY_NONE;
 221   3              }
 222   2          }
 223   1      
 224   1      #endif
 225   1      
 226   1          // Generate Key Messages
 227   1          switch (ucP3_Curr)
 228   1          {
 229   2          case AUTO_KEY_MASK :
 230   2              if(ucOSD_Page_Index)
 231   2      #if(IRPOLLING)
                              usOSD_Timer     = (unsigned int)stGUD1.OSD_TIMEOUT * 34;
              #else
 234   2                      usOSD_Timer     = (unsigned int)stGUD1.OSD_TIMEOUT * 51;

⌨️ 快捷键说明

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