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

📄 display.lst

📁 一个关于UCOS的KEIL工程
💻 LST
📖 第 1 页 / 共 2 页
字号:
 308   1              LCD_CS = 1;
 309   1      }
 310          
 311          /*
 312          **===========================================================================
 313          **  x.    DOT MATRIX display
 314          **===========================================================================
 315          */
 316          
 317          /*
 318          void clrscr()
 319          {
 320                  unsigned char i;
 321                  
 322                  LCD_CS = 0;
 323                  
 324                  // DDRAM frist address//
 325                  LCD_RS = 0;
 326                  sendb(0x80);
 327                  
 328                  LCD_RS = 1;
 329                  for(i=0; i<32; i++)
 330                  {
 331                          sendb(0x20);
 332                  }
 333                  
 334                  LCD_RS = 0;
 335                  sendb(0x80);
 336                  
 337                  LCD_CS = 1;
 338          }
 339          */
 340          
 341          void fullscr(unsigned char cdata) reentrant
 342          {
 343   1              unsigned char i;
 344   1              
 345   1              LCD_CS = 0;
 346   1              
 347   1              /* DDRAM frist address*/
 348   1              LCD_RS = 0;
 349   1              
 350   1              sendb(0x80);
 351   1              
 352   1              LCD_RS = 1;
 353   1              for(i=0; i<32; i++)
 354   1              {
 355   2                      sendb(cdata);
 356   2              }
 357   1              
 358   1              LCD_RS = 0;
 359   1              
 360   1              sendb(0x80);
 361   1              
 362   1              LCD_CS = 1;
 363   1      }
 364          
 365          void clrln (char line) reentrant
C51 COMPILER V8.08   DISPLAY                                                               04/08/2008 09:22:25 PAGE 7   

 366          {
 367   1              unsigned char i;
 368   1              
 369   1              line--;
 370   1              
 371   1              LCD_CS = 0;
 372   1              
 373   1              /*line DDRAM frist address*/
 374   1              LCD_RS = 0;
 375   1              sendb((line<<4)|0x80);
 376   1              
 377   1              LCD_RS = 1;
 378   1              for(i=0; i<16; i++)
 379   1              {
 380   2                      sendb(0x20);
 381   2              }
 382   1              
 383   1              LCD_RS=0;
 384   1              sendb((line<<4)|0x80);
 385   1              
 386   1              LCD_CS = 1;
 387   1      }
 388          
 389          void putch (char cr) reentrant
 390          {
 391   1              LCD_CS = 0;
 392   1              LCD_RS = 1;
 393   1              sendb(cr);
 394   1              LCD_CS = 1;
 395   1              
 396   1              LCD_RS = 0;
 397   1      }
 398          
 399          void putstr (char line, char *str) reentrant
 400          {
 401   1              unsigned char i;
 402   1              
 403   1              line--;
 404   1              LCD_CS = 0;
 405   1              /*line DDRAM frist address*/
 406   1              LCD_RS = 0;
 407   1              sendb((line<<4)|0x80);
 408   1              LCD_RS = 1;
 409   1              for (i=0; (i<16) && (*str!='\0'); i++, str++)
 410   1              {
 411   2                      sendb(*str);
 412   2              }
 413   1              
 414   1              LCD_CS = 1;
 415   1              
 416   1              LCD_RS = 0;
 417   1      }
 418          
 419          void movcur (char line, char x) reentrant
 420          {
 421   1              line--;
 422   1              x--;
 423   1              
 424   1              LCD_CS = 0;
 425   1              /*line DDRAM frist address*/
 426   1              LCD_RS = 0;
 427   1              sendb((line<<4)|0x80|x);
C51 COMPILER V8.08   DISPLAY                                                               04/08/2008 09:22:25 PAGE 8   

 428   1              LCD_CS = 1;
 429   1      }
 430          
 431          /*
 432          **===========================================================================
 433          **  x.     ICON display
 434          **===========================================================================
 435          */
 436          
 437          void disp_icon(unsigned char addr, unsigned char wdata) reentrant
 438          {
 439   1              LCD_CS = 0;
 440   1              LCD_RS = 0;
 441   1              sendb(0x40|addr);
 442   1              LCD_RS = 1;
 443   1              sendb(wdata);
 444   1              LCD_CS = 1;
 445   1              
 446   1              LCD_RS = 0;
 447   1      }
 448          
 449          void clricon() reentrant
 450          {
 451   1              IconWord = 0;
 452   1              
 453   1              disp_icon(0, 0x00);
 454   1              disp_icon(4, 0x00);
 455   1              disp_icon(12, 0x00);
 456   1      }
 457          
 458          void icon_w0() reentrant
 459          {
 460   1              unsigned char i, temp, icon;
 461   1              
 462   1              icon = IconWord & 0x001F;
 463   1              
 464   1              for(i=0, temp=0; i<5; i++)
 465   1              {
 466   2                      temp <<= 1;
 467   2                      icon >>= 1;
 468   2                      temp |= CY;
 469   2              }
 470   1              
 471   1              disp_icon(0, temp);
 472   1      }
 473          
 474          void icon_w4() reentrant
 475          {
 476   1              unsigned char i, temp, icon;
 477   1              
 478   1              icon = (IconWord >> 5) & 0x000F;
 479   1              
 480   1              for(i=0, temp=0; i<5; i++)
 481   1              {
 482   2                      temp <<= 1;
 483   2                      icon >>= 1;
 484   2                      temp |= CY;
 485   2              }
 486   1              
 487   1              disp_icon(4, temp);
 488   1      }
 489          
C51 COMPILER V8.08   DISPLAY                                                               04/08/2008 09:22:25 PAGE 9   

 490          void icon_w12() reentrant
 491          {
 492   1              unsigned char i, temp, icon;
 493   1              
 494   1              icon = (IconWord >> 9) & 0x000F;
 495   1              
 496   1              for(i=0, temp=0; i<5; i++)
 497   1              {
 498   2                      temp <<= 1;
 499   2                      icon >>= 1;
 500   2                      temp |= CY;
 501   2              }
 502   1              //temp<<=2;
 503   1              //icon>>=1;
 504   1              //temp|=CY;
 505   1              disp_icon(12, temp);
 506   1      }
 507          
 508          void icon_wword(unsigned int wicon) reentrant
 509          {
 510   1              IconWord = wicon;
 511   1              
 512   1              icon_w0();
 513   1              icon_w4();
 514   1              icon_w12();
 515   1      }
 516          
 517          void icon_on(unsigned char icon) reentrant
 518          {
 519   1              IconWord |= (1 << icon);
 520   1              switch(icon)
 521   1              {
 522   2                      case ICON_Antenna:
 523   2                      case ICON_LowSignalBar:
 524   2                      case ICON_MediumSignalBar:
 525   2                      case ICON_HighSignalBar:
 526   2                      case ICON_Scan:
 527   2                              icon_w0();
 528   2                              break;
 529   2                      
 530   2                      case ICON_Display1:
 531   2                      case ICON_Display2:
 532   2                      case ICON_Display3:
 533   2                              icon_w4();
 534   2                              break;
 535   2                              
 536   2                      case ICON_BankA:
 537   2                      case ICON_BankB:
 538   2                      case ICON_BankC:
 539   2                      case ICON_Direct:
 540   2                              icon_w12();
 541   2                              break;
 542   2              }
 543   1      }
 544          
 545          void icon_off(unsigned char icon) reentrant
 546          {
 547   1              IconWord &= ~(1 << icon);
 548   1              
 549   1              switch(icon)
 550   1              {
 551   2                      case ICON_Antenna:
C51 COMPILER V8.08   DISPLAY                                                               04/08/2008 09:22:25 PAGE 10  

 552   2                      case ICON_LowSignalBar:
 553   2                      case ICON_MediumSignalBar:
 554   2                      case ICON_HighSignalBar:
 555   2                      case ICON_Scan:
 556   2                              icon_w0();
 557   2                              break;
 558   2                      
 559   2                      case ICON_Display1:
 560   2                      case ICON_Display2:
 561   2                      case ICON_Display3:
 562   2                              icon_w4();
 563   2                              break;
 564   2                              
 565   2                      case ICON_BankA:
 566   2                      case ICON_BankB:
 567   2                      case ICON_BankC:
 568   2                      case ICON_Direct:
 569   2                              icon_w12();
 570   2                              break;
 571   2              }
 572   1      }
 573          
 574          /*
 575          void clricon()
 576          {
 577                  unsigned char i;
 578                  LCD_CS=0;
 579                  LCD_RS=0;
 580                  sendb(0x40);
 581                  LCD_RS=1;
 582                  for(i=0;i<16;i++)sendb(0x00);
 583                  LCD_CS=1;
 584          }
 585          
 586          void icon_on(unsigned char icon)
 587          {
 588                  unsigned char i,j;
 589                  icon--;
 590                  i=icon/5;
 591                  j=4-icon%5;
 592                  IconBuff[i]|=1<<j;
 593                  disp_icon(i);
 594          }
 595          void icon_off(unsigned char icon)
 596          {
 597                  unsigned char i,j;
 598                  icon--;
 599                  i=icon/5;
 600                  j=4-icon%5;
 601                  IconBuff[i]&=~(1<<j);
 602                  disp_icon(i);
 603          }
 604          */
 605          
 606          
 607          
 608          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1635    ----
   CONSTANT SIZE    =     64    ----
C51 COMPILER V8.08   DISPLAY                                                               04/08/2008 09:22:25 PAGE 11  

   XDATA SIZE       =      2    ----
   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 + -