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

📄 ra8803.lst

📁 带字库的RA8803的驱动程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
 347   1              LCD_CmdWrite(WCCR, temp);
 348   1      }
 349          
 350          void LCD_NoBold(void)
 351          {
 352   1              uchar temp;
 353   1              
 354   1              temp = LCD_CmdRead(WCCR);
 355   1              temp &= cClrb4;
 356   1              LCD_CmdWrite(WCCR, temp);
 357   1      }
 358          
 359          //==============================================================================
 360          //Subroutine:   Inv
 361          //Function:
 362          //==============================================================================
 363          void LCD_Inv(void)
 364          {
 365   1              uchar temp;
C51 COMPILER V7.50   RA8803                                                                10/22/2005 14:00:49 PAGE 7   

 366   1              
 367   1              temp = LCD_CmdRead(WCCR);
 368   1              temp &= cClrb5;
 369   1              LCD_CmdWrite(WCCR, temp);
 370   1      }
 371          
 372          void LCD_NoInv(void)
 373          {
 374   1              uchar temp;
 375   1              temp = LCD_CmdRead(WCCR);
 376   1              temp |= cSetb5;
 377   1              LCD_CmdWrite(WCCR, temp);
 378   1      }
 379          
 380          //==============================================================================
 381          //Subroutine:   GInv
 382          //Function:
 383          //==============================================================================
 384          void LCD_GInv(void)
 385          {
 386   1              uchar temp;
 387   1              
 388   1              temp = LCD_CmdRead(WLCR);
 389   1              temp &= cClrb0;
 390   1              LCD_CmdWrite(WLCR, temp);
 391   1      }
 392          
 393          void LCD_NoGInv(void)
 394          {
 395   1              uchar temp;
 396   1              
 397   1              temp = LCD_CmdRead(WLCR);
 398   1              temp |= cSetb0;
 399   1              LCD_CmdWrite(WLCR, temp);
 400   1      }
 401          
 402          //==============================================================================
 403          //Subroutine:   Blk
 404          //Function:
 405          //==============================================================================
 406          void LCD_Blk(void)
 407          {
 408   1              uchar temp;
 409   1              
 410   1              temp = LCD_CmdRead(WLCR);
 411   1              temp |= cSetb1;
 412   1              LCD_CmdWrite(WLCR, temp);
 413   1      }
 414          
 415          void LCD_NoBlk(void)
 416          {
 417   1              uchar temp;
 418   1              
 419   1              temp = LCD_CmdRead(WLCR);
 420   1              temp &= cClrb1;
 421   1              LCD_CmdWrite(WLCR, temp);
 422   1      }
 423          
 424          //==============================================================================
 425          //Subroutine:   Blk Timer
 426          //Function:
 427          //==============================================================================
C51 COMPILER V7.50   RA8803                                                                10/22/2005 14:00:49 PAGE 8   

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

 490   1              temp |= cSetb3;
 491   1              LCD_CmdWrite(FNCR, temp);
 492   1      }
 493          //==============================================================================
 494          //Subroutine:   Cursor Blink On
 495          //Function:
 496          //==============================================================================
 497          void LCD_CurBlk(void)
 498          {
 499   1              uchar temp;
 500   1              
 501   1              temp = LCD_CmdRead(WCCR);
 502   1              temp |= cSetb1;
 503   1              LCD_CmdWrite(WCCR, temp);
 504   1      }
 505          
 506          void LCD_NoCurBlk(void)
 507          {
 508   1              uchar temp;
 509   1              
 510   1              temp = LCD_CmdRead(WCCR);
 511   1              temp &= cClrb1;
 512   1              LCD_CmdWrite(WCCR, temp);
 513   1      }
 514          
 515          //==============================================================================
 516          //Subroutine:   Cursor Height
 517          //Function:
 518          //==============================================================================
 519          void LCD_CurHei(uchar buf)
 520          {
 521   1              uchar temp;
 522   1              buf = buf << 4;
 523   1              buf = buf & 0xF0;       
 524   1              temp = LCD_CmdRead(DLCH);       
 525   1              temp = (temp & 0x0F) | buf;             
 526   1              LCD_CmdWrite(DLCH, temp);
 527   1      }
 528          
 529          //==============================================================================
 530          //Subroutine:   Line Distance
 531          //Function:
 532          //==============================================================================
 533          void LCD_LineDis(uchar buf)
 534          {
 535   1              uchar temp;
 536   1              buf = buf & 0x0F;       
 537   1              temp = LCD_CmdRead(DLCH);       
 538   1              temp = (temp & 0xF0) | buf;             
 539   1              LCD_CmdWrite(DLCH, temp);
 540   1      }
 541          
 542          //==============================================================================
 543          //Subroutine:   Font Size
 544          //Function:
 545          //==============================================================================
 546          void LCD_FontSize(uchar buf)
 547          {
 548   1              uchar temp;
 549   1              buf = buf << 4;
 550   1              temp = (buf & 0xF0) | (0x0F);   
 551   1              LCD_CmdWrite(FVHT, temp);
C51 COMPILER V7.50   RA8803                                                                10/22/2005 14:00:49 PAGE 10  

 552   1      }
 553          
 554          //==============================================================================
 555          //Subroutine:   Software Reset
 556          //Function:
 557          //==============================================================================
 558          void LCD_SWRst(void)
 559          {
 560   1              uchar temp;
 561   1              
 562   1              temp = LCD_CmdRead(WLCR);
 563   1              temp |= cSetb5;
 564   1              LCD_CmdWrite(WLCR, temp);
 565   1      }
 566          
 567          //==============================================================================
 568          //Subroutine:   LCD_Clear
 569          //Function:             Clear LCD DDRAM
 570          //==============================================================================
 571          void LCD_Clear(void)
 572          {
 573   1              LCD_CmdWrite(PNTR, 0x00);
 574   1              LCD_FillOn();
 575   1              Delay100ms(1);
 576   1      }
 577          
 578          //==============================================================================
 579          //Subroutine:   ADC On/Off
 580          //Function:
 581          //==============================================================================
 582          void ADC_On(void)
 583          {
 584   1              LCD_CmdWrite(TPCR, 0xC0);
 585   1      }
 586          
 587          void ADC_Off(void)
 588          {
 589   1              LCD_CmdWrite(TPCR, 0x10);
 590   1      }
 591          
 592          //==============================================================================
 593          //Subroutine:   Get Panel Touch
 594          //Function:             
 595          //==============================================================================
 596          uchar ADC_Touch(void)
 597          {
 598   1              uchar temp, tempT;
 599   1      
 600   1              temp = LCD_CmdRead(TPCR);
 601   1              temp &= cClrb0;
 602   1              temp &= cClrb1;
 603   1              temp &= cClrb2;
 604   1              temp |= cSetb3;
 605   1              LCD_CmdWrite(TPCR, temp);
 606   1              Delay10ms(1);
 607   1      
 608   1              tempT=LCD_CmdRead(TPSR);
 609   1      
 610   1              temp &= cClrb3;
 611   1              LCD_CmdWrite(TPCR, temp);
 612   1      
 613   1              tempT = tempT & B0100_0000;
C51 COMPILER V7.50   RA8803                                                                10/22/2005 14:00:49 PAGE 11  

 614   1              if(tempT == 0x40) return 0x01;
 615   1              else return 0x00;
 616   1      }
 617          
 618          //==============================================================================
 619          //Subroutine:   Get ADC X/Y
 620          //Function:             
 621          //==============================================================================
 622          uchar ADC_X(void)
 623          {
 624   1              uchar temp, tempX;
 625   1      
 626   1              temp = LCD_CmdRead(TPCR);
 627   1              temp &= cClrb0;
 628   1              LCD_CmdWrite(TPCR, temp);
 629   1              temp &= cClrb1;
 630   1              LCD_CmdWrite(TPCR, temp);
 631   1              temp |= cSetb2;
 632   1              LCD_CmdWrite(TPCR, temp);
 633   1              temp |= cSetb3;
 634   1              LCD_CmdWrite(TPCR, temp);
 635   1              Delay1ms(1);
 636   1      
 637   1              tempX=LCD_CmdRead(TPXR);
 638   1              return tempX;
 639   1      }
 640          
 641          uchar ADC_Y(void)
 642          {
 643   1              uchar temp, tempY;
 644   1      
 645   1              temp = LCD_CmdRead(TPCR);
 646   1              temp &= cClrb2;
 647   1              LCD_CmdWrite(TPCR, temp);
 648   1              temp &= cClrb3;
 649   1              LCD_CmdWrite(TPCR, temp);
 650   1              temp |= cSetb0;
 651   1              LCD_CmdWrite(TPCR, temp);
 652   1              temp |= cSetb1;
 653   1              LCD_CmdWrite(TPCR, temp);
 654   1              Delay1ms(1);
 655   1      
 656   1              tempY=LCD_CmdRead(TPYR);
 657   1              return tempY;
 658   1      }
 659          
 660          //==============================================================================
 661          //Subroutine:   Show Hex
 662          //Function:             
 663          //==============================================================================
 664          void Print_Hex(uchar buf)
 665          {
 666   1              uchar temp;
 667   1              temp=buf;
 668   1              temp = (temp >>4) & 0x0F;
 669   1              if(temp < 0x0A)
 670   1              {
 671   2                      temp |= 0x30;
 672   2              }
 673   1              else temp = temp + 0x37;
 674   1              LCD_DataWrite(temp);
 675   1      
C51 COMPILER V7.50   RA8803                                                                10/22/2005 14:00:49 PAGE 12  

 676   1              temp=buf;
 677   1              temp = temp & 0x0F;
 678   1              if(temp < 0x0A)
 679   1              {
 680   2                      temp |= 0x30;
 681   2              }
 682   1              else temp = temp + 0x37;
 683   1              LCD_DataWrite(temp);
 684   1      }


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