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

📄 keyboard_lcd.lst

📁 TS12864液晶驱动
💻 LST
📖 第 1 页 / 共 2 页
字号:
 171   3                                              else if(screenMode.thisMode==TRIG_CH)
 172   3                                              {
 173   4                                                      if(trigCh.prevValue!=0)
 174   4                                                              trigCh.thisValue=trigCh.prevValue;
 175   4      
 176   4                                                      screenMode.prevMode=screenMode.thisMode;
 177   4                                                      screenMode.thisMode=INIT_SCREEN;
 178   4                                              }
 179   3                                      }
C51 COMPILER V8.02   KEYBOARD_LCD                                                          07/26/2008 19:16:15 PAGE 4   

 180   2                                      break;
 181   2              case 0x4000:if(key.thisKey!=TRIG_DELAY)
 182   2                                      {
 183   3                                              key.thisKey=TRIG_DELAY;
 184   3                                              if(screenMode.thisMode==INIT_SCREEN)
 185   3                                              {                                       
 186   4                                                      screenMode.prevMode=screenMode.thisMode;
 187   4                                                      screenMode.thisMode=TRIG_DELAY;
 188   4                                              
 189   4                                                      trigDelay.prevValue=0;
 190   4                                              }
 191   3                                              else if(screenMode.thisMode==TRIG_DELAY)
 192   3                                              {
 193   4                                                      if(trigDelay.prevValue!=0 && trigDelay.prevValue<20)
 194   4                                                              trigDelay.thisValue=trigDelay.prevValue;
 195   4      
 196   4                                                      screenMode.prevMode=screenMode.thisMode;
 197   4                                                      screenMode.thisMode=INIT_SCREEN;
 198   4                                              }
 199   3                                      }
 200   2                                      break;
 201   2              case 0x8000:if(key.thisKey!=THRESHOLD)
 202   2                                      {
 203   3                                              key.thisKey=THRESHOLD;
 204   3                                              if(screenMode.thisMode==INIT_SCREEN)
 205   3                                              {                                       
 206   4                                                      screenMode.prevMode=screenMode.thisMode;
 207   4                                                      screenMode.thisMode=THRESHOLD;
 208   4                                              
 209   4                                                      threshold.prevValue=0;
 210   4                                              }
 211   3                                              else if(screenMode.thisMode==THRESHOLD)
 212   3                                              {
 213   4                                                      if(threshold.prevValue!=0 && (threshold.prevValue-threshold.prevValue/1000*1000)<=400)
 214   4                                                              threshold.thisValue=threshold.prevValue-threshold.prevValue/1000*1000;
 215   4      
 216   4                                                      screenMode.prevMode=screenMode.thisMode;
 217   4                                                      screenMode.thisMode=INIT_SCREEN;
 218   4                                              }
 219   3                                      }
 220   2                                      break;
 221   2              default:
 222   2                                      key.thisKey=XXXX;
 223   2                                      key.prevKey=XXXX;
 224   2                                      break;
 225   2              }
 226   1              Timer_Init();
 227   1      }
 228          void ScreenInit()
 229          {
 230   1              LcdInit();      
 231   1              //开机界面
 232   1              ClearLcd(LCD_CLEAR);
 233   1              DisplayImage(logo,LCD_CLEAR);
 234   1              DisplayImage(logo,LCD_BLACK);
 235   1              screenMode.thisMode=INIT_SCREEN;
 236   1              showMode.thisMode=0;
 237   1      
 238   1              screenMode.exitOrNo=RETURN_FALSE;
 239   1      }
 240          void showScreen()
 241          {
C51 COMPILER V8.02   KEYBOARD_LCD                                                          07/26/2008 19:16:15 PAGE 5   

 242   1              unsigned char i;
 243   1      //      Init_Device();
 244   1              ScreenInit();
 245   1              while(screenMode.exitOrNo==RETURN_FALSE)
 246   1              {
 247   2                      switch(screenMode.thisMode)
 248   2                      {
 249   3                      case INIT_SCREEN:
 250   3                                                      if(showMode.thisMode!=INIT_SCREEN)
 251   3                                                      {
 252   4                                                              ClearLcd(LCD_CLEAR);
 253   4                                                              DisplayString(0,0,3,trigWordArray,LCD_CLEAR);
 254   4                                                              DisplayString(0,1,4,trigChArray,LCD_CLEAR);
 255   4                                                              DisplayString(0,2,4,trigDelayArray,LCD_CLEAR);
 256   4                                                              DisplayString(0,3,2,thresholdArray,LCD_CLEAR);
 257   4                                                              
 258   4                                                              for(i=0;i<8;i++)
 259   4                                                              {
 260   5                                                                      DisplayInt(12-i,0,(trigWord.thisValue>>i)&0x01,LCD_CLEAR);
 261   5                                                                      DisplayInt(12-i,1,(trigCh.thisValue>>i)&0x01,LCD_CLEAR);
 262   5                                                              }
 263   4                                                              DisplayInt(8,2,trigDelay.thisValue,LCD_CLEAR);
 264   4      
 265   4                                                              DisplayInt(8,3,threshold.thisValue/100,LCD_CLEAR);
 266   4                                                              DisplayChar(12,3,'.',LCD_CLEAR);
 267   4                                                              DisplayInt(10,3,threshold.thisValue/10-threshold.thisValue/100*10,LCD_CLEAR);
 268   4                                                              DisplayInt(11,3,threshold.thisValue-threshold.thisValue/10*10,LCD_CLEAR);
 269   4                                                              
 270   4                                                              showMode.prevMode=showMode.thisMode;
 271   4                                                              showMode.thisMode=INIT_SCREEN;
 272   4                                                      }
 273   3                                                      break;
 274   3                      case TRIG_WORD:
 275   3                                                      if(showMode.thisMode!=TRIG_WORD)
 276   3                                                      {
 277   4                                                              DisplayString(0,0,3,trigWordArray,LCD_BLACK);
 278   4                                                                                      
 279   4                                                              showMode.prevMode=showMode.thisMode;
 280   4                                                              showMode.thisMode=TRIG_WORD;
 281   4                                                      }
 282   3                                                      for(i=0;i<8;i++)
 283   3                                                                      DisplayInt(12-i,0,(trigWord.prevValue>>i)&0x01,LCD_CLEAR);
 284   3                                                      break;
 285   3                      case TRIG_CH:
 286   3                                                      if(showMode.thisMode!=TRIG_CH)
 287   3                                                      {
 288   4                                                              DisplayString(0,1,4,trigChArray,LCD_BLACK);
 289   4      
 290   4                                                              showMode.prevMode=showMode.thisMode;
 291   4                                                              showMode.thisMode=TRIG_CH;
 292   4                                                      }
 293   3                                                      for(i=0;i<8;i++)
 294   3                                                                      DisplayInt(12-i,1,(trigCh.prevValue>>i)&0x01,LCD_CLEAR);
 295   3                                                      break;
 296   3                      case TRIG_DELAY:
 297   3                                                      if(showMode.thisMode!=TRIG_DELAY)
 298   3                                                      {
 299   4                                                              DisplayString(0,2,4,trigDelayArray,LCD_BLACK);
 300   4      
 301   4                                                              showMode.prevMode=showMode.thisMode;
 302   4                                                              showMode.thisMode=TRIG_DELAY;
 303   4                                                      }
C51 COMPILER V8.02   KEYBOARD_LCD                                                          07/26/2008 19:16:15 PAGE 6   

 304   3                                                      DisplayInt(8,2,trigDelay.prevValue,LCD_CLEAR);
 305   3                                                      break;
 306   3                      case THRESHOLD:
 307   3                                                      if(showMode.thisMode!=THRESHOLD)
 308   3                                                      {
 309   4                                                              DisplayString(0,3,2,thresholdArray,LCD_BLACK);
 310   4      
 311   4                                                              showMode.prevMode=showMode.thisMode;
 312   4                                                              showMode.thisMode=THRESHOLD;
 313   4                                                      }
 314   3                                                      DisplayInt(8,3,threshold.prevValue/100-threshold.prevValue/1000*10,LCD_CLEAR);
 315   3                                                      DisplayChar(12,3,'.',LCD_CLEAR);
 316   3                                                      DisplayInt(10,3,threshold.prevValue/10-threshold.prevValue/100*10,LCD_CLEAR);
 317   3                                                      DisplayInt(11,3,threshold.prevValue-threshold.prevValue/10*10,LCD_CLEAR);
 318   3                                                      break;
 319   3                      default:
 320   3                              break;
 321   3                      }
 322   2              }
 323   1              //传输给主函数
 324   1              for(i=0;i<8;i++)
 325   1              {
 326   2                      trig_word[i]=(trigWord.thisValue>>i)&0x01;
 327   2              }
 328   1              trig_ch =trigCh.thisValue;                                                              //3级触发时的触发通道
 329   1              thresholdW=threshold.thisValue;                                                         //门限电压
 330   1              trig_delay=trigDelay.thisValue; 
 331   1      
 332   1      }


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