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

📄 1335c51.lst

📁 1335液晶的光标控制
💻 LST
📖 第 1 页 / 共 4 页
字号:
 411   1          PutCdotInGraph(4,0,32,16);
*** WARNING C209 IN LINE 411 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 412   1          PutCdotInGraph(6,0,29,16);
*** WARNING C209 IN LINE 412 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 413   1          PutCdotInGraph(8,0,33,16);
*** WARNING C209 IN LINE 413 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 414   1          PutCdotInGraph(10,0,34,16);
*** WARNING C209 IN LINE 414 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 415   1          PutCdotInGraph(12,0,35,16);
*** WARNING C209 IN LINE 415 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
C51 COMPILER V8.08   1335C51                                                               04/26/2008 21:36:20 PAGE 8   

 416   1          PutCdotInGraph(14,0,7,16);
*** WARNING C209 IN LINE 416 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 417   1              PutCdotInGraph(16,0,8,16);              
*** WARNING C209 IN LINE 417 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 418   1              PutCdotInGraph(18,0,11,16);             
*** WARNING C209 IN LINE 418 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 419   1              PutCdotInGraph(20,0,12,16);                               //第2行 
*** WARNING C209 IN LINE 419 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 420   1      
 421   1      
 422   1      
 423   1              
 424   1              PutCdotInGraph(0,32,26,16);                        // 通  
*** WARNING C209 IN LINE 424 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 425   1              PutCdotInGraph(2,32,27,16);                        //道 
*** WARNING C209 IN LINE 425 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 426   1       /*
 427   1          PutCdotInGraph(5,32,36,16);
 428   1          PutCdotInGraph(7,32,37,16);
 429   1              PutCdotInGraph(9,32,19,16);              //标称 值  
 430   1      */
 431   1              PutCdotInGraph(14,32,38,16);
*** WARNING C209 IN LINE 431 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 432   1          PutCdotInGraph(16,32,7,16);
*** WARNING C209 IN LINE 432 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 433   1              dprintf(18,32,DanWei5);                         //实测值  
*** WARNING C209 IN LINE 433 OF 1335C51.C: '_dprintf': too few actual parameters
 434   1      
 435   1      
 436   1          PutCdotInGraph(26,24,21,16);
*** WARNING C209 IN LINE 436 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 437   1          PutCdotInGraph(28,24,22,16);
*** WARNING C209 IN LINE 437 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 438   1          PutCdotInGraph(26,40,23,16);
*** WARNING C209 IN LINE 438 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 439   1              dprintf(28,40,DanWei5);                   //绝对误差  
*** WARNING C209 IN LINE 439 OF 1335C51.C: '_dprintf': too few actual parameters
 440   1      
 441   1          PutCdotInGraph(34,24,25,16);
*** WARNING C209 IN LINE 441 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 442   1          PutCdotInGraph(36,24,22,16);
*** WARNING C209 IN LINE 442 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 443   1          PutCdotInGraph(34,40,23,16);        //相对误差  
*** WARNING C209 IN LINE 443 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 444   1              dprintf(36,40,DanWei4);
*** WARNING C209 IN LINE 444 OF 1335C51.C: '_dprintf': too few actual parameters
 445   1      
 446   1      }
 447          
 448          void PutWord24InGraph( void ) { 
 449   1      //x坐标以半个汉字定位左起0开始计算
 450   1      //y坐标以像素行定位,顶部0开始计算
 451   1      //汉字码以点阵码列表所对应32字节位单位进界,从0开始计算
 452   1      
 453   1              PutCdotInGraph( 13, 100, 0, 24 );       // 调汉字写入子程序      
*** WARNING C209 IN LINE 453 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 454   1              PutCdotInGraph( 16, 100, 1, 24 );       // 调汉字写入子程序      
*** WARNING C209 IN LINE 454 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 455   1              PutCdotInGraph( 19, 100, 2, 24 );       // 调汉字写入子程序      
*** WARNING C209 IN LINE 455 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 456   1              PutCdotInGraph( 22, 100, 3, 24 );       // 调汉字写入子程序      
*** WARNING C209 IN LINE 456 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
C51 COMPILER V8.08   1335C51                                                               04/26/2008 21:36:20 PAGE 9   

 457   1              PutCdotInGraph( 25, 100, 4, 24 );       // 调汉字写入子程序      
*** WARNING C209 IN LINE 457 OF 1335C51.C: '_PutCdotInGraph': too few actual parameters
 458   1              DelayMs(50);
 459   1      }
 460          
 461          
 462          //--------延时子程序--------------------------
 463          void Delay( Uint tt ) {
 464   1              
 465   1              while( tt-- );
 466   1      }
 467          
 468                                                                                          // 显示三区闪烁
 469          
 470          /*========================================================
 471          ;  直接访问方式的驱动子程序
 472          ;       程序口地址设置CWADD1,DWADD1,CRADD1,DRADD1
 473          ;       占用内部资源DAT1,A,COM
 474          ;       程序输入变量: DAT1,,COM
 475          ;===============直接访问方式驱动子程序==================*/
 476          // 判忙标志BF子程序pr0
 477          /*void WaitForBusy( void ) {
 478                  
 479                  while ( LcmStatusPort & Busy );
 480          }
 481          */
 482          //---------------------------
 483          // 写指令代码子程序pr1
 484          void WriteCommand( Uchar CommandByte ) {
 485   1      
 486   1              LcmCmdPort = CommandByte;
 487   1      }
 488          
 489          //---------------------------
 490          // 写参数及显示数据子程序
 491          void WriteData( Uchar dataW ) {
 492   1      
 493   1              LcmWdataPort = dataW;
 494   1      }
 495          
 496          //---------------------------
 497          // 读参数及显示数据子程序
 498          Uchar ReadDataLcm( void ) {
 499   1      
 500   1              return LcmRdataPort;
 501   1      }
 502          
 503          /*=====================================
 504           初始化子程序
 505          ======================================*/
 506          void LcmInition( void ) {
 507   1      
 508   1      Uchar i;
 509   1                      
 510   1              WriteCommand( SystemSet );                      // 系统参数设置
 511   1              for (i=0;i<8;i++) {                             
 512   2                      WriteData( ParaSysTable8[i] );  //
 513   2              }
 514   1      
 515   1              WriteCommand( Scroll );                         //设定显示区域起始地址
 516   1              for (i=0;i<10;i++) {
 517   2                      WriteData( ParaScrTableA[i] );
C51 COMPILER V8.08   1335C51                                                               04/26/2008 21:36:20 PAGE 10  

 518   2              }
 519   1      
 520   1              WriteCommand( HdotScr );                // 写入点位移指令代码
 521   1              WriteData( 0 );                                 // 写入P1参数
 522   1              WriteCommand( Ovlay );                  // 显示合成方式设置
 523   1              WriteData( 0 );                                 // 0000 0100 显示一区文本,三区文本属性,二重"或"合成
 524   1              WriteCommand( CsrForm );                // 光标形状设置,代码0x5d
 525   1              WriteData( 0x07 );                              // 设置光标水平点为CSX=8
 526   1              WriteData( 0x87 );                              // 光标为块状形式,垂直点为CSY=8
 527   1      
 528   1      
 529   1      
 530   1      }
 531          
 532          /*============================================
 533           建立 cgram,将显示字符送入cgram中
 534          
 535            入口参数约定:Base.... 起始
 536          =============================================*/
 537          void BuildCgram( Uchar Base, Uchar EndlCode ) {
 538   1      
 539   1      Uchar iCgram,ii,ij;
 540   1      
 541   1              WriteCommand( CgramAdr );               // CGRAMADR 代码
 542   1              WriteData( 0 );                                 // 设置SAG=0C000H
 543   1              WriteData( 0x70 );                              // 汉字模在cgram中的编码0x70~0x73
 544   1      
 545   1              WriteCommand( CsrW );                   // CSRW 代码,光标指针设置
 546   1              WriteData( 0 );                                 // 设置CSR=0C400H(字符代码=80H)
 547   1              WriteData( 0x74 );                              // 汉字模在cgram中的编码0x70~0x73
 548   1              WriteCommand( CsrDirR );                // CSRDIR 代码
 549   1              WriteCommand( mWrite );                 // 代码0x42,数据写入指令
 550   1              for (ii=0;ii<EndlCode;ii++){
 551   2                      for (ij=0;ij<2;ij++){
 552   3                              for (iCgram=0;iCgram<32;iCgram+=2) 
 553   3                                      WriteData( Cdotlib[Base+ii].Msk[ij+iCgram] );   // 将制定的数据块写入 cgram
 554   3                      }
 555   2                      
 556   2              }
 557   1      }       
 558          /*==============================================================================
 559          ; 汉字写入子程序(图形方式)。每次调用输出一个汉字                        写入一区  
 560          ; 支持图形方式使用,完成汉字点阵码的输出。
 561          ; 携入参数: Ox,Oy....写入显示的左上角坐标,Ox是以字节单位,Oy以行扫描线单位
 562                                  Ptr......汉字码,库内的排列编码,大型程序时请改用unsigned int类型
 563          ; 无返回数据。
 564           ==============================================================================*/
 565          
 566          void PutCdotInGraph( Uint Ox, Uchar Oy, Uchar Cnumber, Uchar DotWidth,Uchar attribs ) 
 567          {
 568   1      
 569   1              Uint tempPtr,Optr;
 570   1              Uchar tempCount1,tempCount2,nByte;              
 571   1              Optr = (Uint)Oy * paraP9 + Ox;
 572   1              if(attribs)Optr += BasePart2*256;
 573   1              nByte = DotWidth/8;
 574   1              WriteCommand( CsrDirD );                                                // 自动右移。
 575   1              tempPtr = (Uint)Cnumber * DotWidth*nByte;
 576   1      
 577   1              for (tempCount1=0;tempCount1<nByte;tempCount1++) 
 578   1              {
 579   2      
C51 COMPILER V8.08   1335C51                                                               04/26/2008 21:36:20 PAGE 11  

 580   2                      WriteCommand( CsrW );                                           // 光标定位指令
 581   2                      WriteData( (Uchar)(Optr &0xff) );               // 设置光标地址CSR
 582   2                      WriteData( (Uchar)(Optr /256 ) );
 583   2                      WriteCommand( mWrite );                                         // ram写指令
 584   2                      
 585   2                      switch(DotWidth)
 586   2                      {
 587   3      
 588   3                              case 16:        for(tempCount2=0;tempCount2<DotWidth;tempCount2++) {
 589   4                                                      WriteData( Cdotlib[Cnumber].Msk[tempCount2*2+tempCount1] );             // 写入数据
 590   4                                                      }
 591   3                                                      break;
 592   3                              case 24:        for(tempCount2=0;tempCount2<DotWidth;tempCount2++) {
 593   4                                                      WriteData( Cdot24lib[tempPtr] );                // 写入数据
 594   4                                                      tempPtr += nByte;

⌨️ 快捷键说明

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