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

📄 ra8822.lst

📁 MSC-51驱动SYB240128AZK
💻 LST
📖 第 1 页 / 共 2 页
字号:
 332          //Subroutine:   Inv
 333          //Function:
 334          //==============================================================================
 335          void LCD_Inv(void)
 336          {
 337   1              uchar temp;
 338   1              
 339   1              temp = LCD_CmdRead(WCCR);
 340   1              temp &= cClrb5;
 341   1              LCD_CmdWrite(WCCR, temp);
 342   1      }
 343          
 344          void LCD_NoInv(void)
 345          {
 346   1              uchar temp;
 347   1              temp = LCD_CmdRead(WCCR);
 348   1              temp |= cSetb5;
 349   1              LCD_CmdWrite(WCCR, temp);
 350   1      }
 351          
 352          //==============================================================================
 353          //Subroutine:   GInv
 354          //Function:
 355          //==============================================================================
 356          void LCD_GInv(void)
 357          {
 358   1              uchar temp;
 359   1              
 360   1              temp = LCD_CmdRead(WLCR);
 361   1              temp &= cClrb0;
 362   1              LCD_CmdWrite(WLCR, temp);
 363   1      }
 364          
 365          void LCD_NoGInv(void)
C51 COMPILER V7.50   RA8822                                                                11/09/2005 10:16:16 PAGE 7   

 366          {
 367   1              uchar temp;
 368   1              
 369   1              temp = LCD_CmdRead(WLCR);
 370   1              temp |= cSetb0;
 371   1              LCD_CmdWrite(WLCR, temp);
 372   1      }
 373          
 374          //==============================================================================
 375          //Subroutine:   Blk
 376          //Function:
 377          //==============================================================================
 378          void LCD_Blk(void)
 379          {
 380   1              uchar temp;
 381   1              
 382   1              temp = LCD_CmdRead(WLCR);
 383   1              temp |= cSetb1;
 384   1              LCD_CmdWrite(WLCR, temp);
 385   1      }
 386          
 387          void LCD_NoBlk(void)
 388          {
 389   1              uchar temp;
 390   1              
 391   1              temp = LCD_CmdRead(WLCR);
 392   1              temp &= cClrb1;
 393   1              LCD_CmdWrite(WLCR, temp);
 394   1      }
 395          
 396          //==============================================================================
 397          //Subroutine:   Blk Timer
 398          //Function:
 399          //==============================================================================
 400          void LCD_BlkTim(uchar buf)
 401          {
 402   1              uchar temp;
 403   1              
 404   1              temp = LCD_CmdRead(BTMR);
 405   1              temp |= buf;
 406   1              LCD_CmdWrite(BTMR, temp);
 407   1      }
 408          
 409          //==============================================================================
 410          //Subroutine:   Cursor On
 411          //Function:
 412          //==============================================================================
 413          void LCD_Cur(void)
 414          {
 415   1              uchar temp;
 416   1              
 417   1              temp = LCD_CmdRead(WCCR);
 418   1              temp |= cSetb2;
 419   1              LCD_CmdWrite(WCCR, temp);
 420   1      }
 421          
 422          void LCD_NoCur(void)
 423          {
 424   1              uchar temp;
 425   1              
 426   1              temp = LCD_CmdRead(WCCR);
 427   1              temp &= cClrb2;
C51 COMPILER V7.50   RA8822                                                                11/09/2005 10:16:16 PAGE 8   

 428   1              LCD_CmdWrite(WCCR, temp);
 429   1      }
 430          
 431          //==============================================================================
 432          //Subroutine:   Align On
 433          //Function:
 434          //==============================================================================
 435          void LCD_AlignOn(void)
 436          {
 437   1              uchar temp;
 438   1              
 439   1              temp = LCD_CmdRead(WCCR);
 440   1              temp |= cSetb6;
 441   1              LCD_CmdWrite(WCCR, temp);
 442   1      }
 443          
 444          void LCD_AlignOff(void)
 445          {
 446   1              uchar temp;
 447   1              
 448   1              temp = LCD_CmdRead(WCCR);
 449   1              temp &= cClrb6;
 450   1              LCD_CmdWrite(WCCR, temp);
 451   1      }
 452          
 453          //==============================================================================
 454          //Subroutine:   Auto Fill 
 455          //Function:
 456          //==============================================================================
 457          void LCD_FillOn(void)
 458          {
 459   1              uchar temp;
 460   1              
 461   1              temp = LCD_CmdRead(FNCR);
 462   1              temp |= cSetb3;
 463   1              LCD_CmdWrite(FNCR, temp);
 464   1      }
 465          //==============================================================================
 466          //Subroutine:   Cursor Blink On
 467          //Function:
 468          //==============================================================================
 469          void LCD_CurBlk(void)
 470          {
 471   1              uchar temp;
 472   1              
 473   1              temp = LCD_CmdRead(WCCR);
 474   1              temp |= cSetb1;
 475   1              LCD_CmdWrite(WCCR, temp);
 476   1      }
 477          
 478          void LCD_NoCurBlk(void)
 479          {
 480   1              uchar temp;
 481   1              
 482   1              temp = LCD_CmdRead(WCCR);
 483   1              temp &= cClrb1;
 484   1              LCD_CmdWrite(WCCR, temp);
 485   1      }
 486          
 487          //==============================================================================
 488          //Subroutine:   Cursor Height
 489          //Function:
C51 COMPILER V7.50   RA8822                                                                11/09/2005 10:16:16 PAGE 9   

 490          //==============================================================================
 491          void LCD_CurHei(uchar buf)
 492          {
 493   1              uchar temp;
 494   1              buf = buf << 4;
 495   1              buf = buf & 0xF0;       
 496   1              temp = LCD_CmdRead(DLCH);       
 497   1              temp = (temp & 0x0F) | buf;             
 498   1              LCD_CmdWrite(DLCH, temp);
 499   1      }
 500          
 501          //==============================================================================
 502          //Subroutine:   Line Distance
 503          //Function:
 504          //==============================================================================
 505          void LCD_LineDis(uchar buf)
 506          {
 507   1              uchar temp;
 508   1              buf = buf & 0x0F;       
 509   1              temp = LCD_CmdRead(DLCH);       
 510   1              temp = (temp & 0xF0) | buf;             
 511   1              LCD_CmdWrite(DLCH, temp);
 512   1      }
 513          
 514          //==============================================================================
 515          //Subroutine:   Font Size
 516          //Function:
 517          //==============================================================================
 518          void LCD_FontSize(uchar buf)
 519          {
 520   1              uchar temp;
 521   1              buf = buf << 4;
 522   1              temp = (buf & 0xF0) | (0x0F);   
 523   1              LCD_CmdWrite(FVHT, temp);
 524   1      }
 525          
 526          //==============================================================================
 527          //Subroutine:   Software Reset
 528          //Function:
 529          //==============================================================================
 530          void LCD_SWRst(void)
 531          {
 532   1              uchar temp;
 533   1              
 534   1              temp = LCD_CmdRead(WLCR);
 535   1              temp |= cSetb5;
 536   1              LCD_CmdWrite(WLCR, temp);
 537   1      }
 538          
 539          //==============================================================================
 540          //Subroutine:   LCD_Clear
 541          //Function:             Clear LCD DDRAM
 542          //==============================================================================
 543          void LCD_Clear(void)
 544          {
 545   1              LCD_CmdWrite(PNTR, 0x00);
 546   1              LCD_FillOn();
 547   1              Delay100ms(1);
 548   1      }
 549          
 550          //==============================================================================
 551          //Subroutine:   ADC On/Off
C51 COMPILER V7.50   RA8822                                                                11/09/2005 10:16:16 PAGE 10  

 552          //Function:
 553          //==============================================================================
 554          void ADC_On(void)
 555          {
 556   1              LCD_CmdWrite(TPCR, 0xC0);
 557   1      }
 558          
 559          void ADC_Off(void)
 560          {
 561   1              LCD_CmdWrite(TPCR, 0x10);
 562   1      }
 563          
 564          //==============================================================================
 565          //Subroutine:   Get Panel Touch
 566          //Function:             
 567          //==============================================================================
 568          uchar ADC_Touch(void)
 569          {
 570   1              uchar temp, tempT;
 571   1      
 572   1              temp = LCD_CmdRead(TPCR);
 573   1              temp &= cClrb0;
 574   1              temp &= cClrb1;
 575   1              temp &= cClrb2;
 576   1              temp |= cSetb3;
 577   1              LCD_CmdWrite(TPCR, temp);
 578   1              Delay1ms(2);
 579   1              
 580   1              tempT=LCD_CmdRead(TPSR);
 581   1      
 582   1              temp &= cClrb3;
 583   1              LCD_CmdWrite(TPCR, temp);
 584   1      
 585   1              tempT = tempT & B0100_0000;
 586   1              if(tempT == 0x40) return 0x01;
 587   1              else return 0x00;
 588   1      }
 589          
 590          //==============================================================================
 591          //Subroutine:   Get ADC X/Y
 592          //Function:             
 593          //==============================================================================
 594          uchar ADC_X(void)
 595          {
 596   1              uchar temp, tempX;
 597   1      
 598   1              temp = LCD_CmdRead(TPCR);
 599   1              temp &= cClrb0;
 600   1              LCD_CmdWrite(TPCR, temp);
 601   1              temp &= cClrb1;
 602   1              LCD_CmdWrite(TPCR, temp);
 603   1              temp |= cSetb2;
 604   1              LCD_CmdWrite(TPCR, temp);
 605   1              temp |= cSetb3;
 606   1              LCD_CmdWrite(TPCR, temp);
 607   1              Delay1ms(1);
 608   1      
 609   1              tempX=LCD_CmdRead(TPXR);
 610   1              return tempX;
 611   1      }
 612          
 613          uchar ADC_Y(void)
C51 COMPILER V7.50   RA8822                                                                11/09/2005 10:16:16 PAGE 11  

 614          {
 615   1              uchar temp, tempY;
 616   1      
 617   1              temp = LCD_CmdRead(TPCR);
 618   1              temp &= cClrb2;
 619   1              LCD_CmdWrite(TPCR, temp);
 620   1              temp &= cClrb3;
 621   1              LCD_CmdWrite(TPCR, temp);
 622   1              temp |= cSetb0;
 623   1              LCD_CmdWrite(TPCR, temp);
 624   1              temp |= cSetb1;
 625   1              LCD_CmdWrite(TPCR, temp);
 626   1              Delay1ms(1);
 627   1      
 628   1              tempY=LCD_CmdRead(TPYR);
 629   1              return tempY;
 630   1      }
 631          
 632          //==============================================================================
 633          //Subroutine:   Show Hex
 634          //Function:             
 635          //==============================================================================
 636          void Print_Hex(uchar buf)
 637          {
 638   1              uchar temp;
 639   1              temp=buf;
 640   1              temp = (temp >>4) & 0x0F;
 641   1              if(temp < 0x0A)
 642   1              {
 643   2                      temp |= 0x30;
 644   2              }
 645   1              else temp = temp + 0x37;
 646   1              LCD_DataWrite(temp);
 647   1      
 648   1              temp=buf;
 649   1              temp = temp & 0x0F;
 650   1              if(temp < 0x0A)
 651   1              {
 652   2                      temp |= 0x30;
 653   2              }
 654   1              else temp = temp + 0x37;
 655   1              LCD_DataWrite(temp);
 656   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    963    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      20
   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 + -