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

📄 410.lst

📁 一个用keil写的,动行在c8051f410上的自己做的开关电源的驱动程序,在protes下仿真过.希望对初学者能有用.
💻 LST
📖 第 1 页 / 共 3 页
字号:
 382   1      keysetin=0;
 383   1      }
 384          
 385          
 386          /*---------------------------------------------------------------------------
 387          下面这个函数用于数字数组例坐标选择,对应相应数值的点阵
 388          ---------------------------------------------------------------------------*/
 389          swi()
 390          {
 391   1        switch (swd)
 392   1        {
 393   2        case 0: k=0; break;
 394   2        case 1: k=1; break;
 395   2        case 2: k=2; break;
 396   2        case 3: k=3; break;
 397   2        case 4: k=4; break;
 398   2        case 5: k=5; break;
 399   2        case 6: k=6; break;
 400   2        case 7: k=7; break;
 401   2        case 8: k=8; break;
 402   2        case 9: k=9; break;
 403   2        }
 404   1      }
 405          
 406          /*---------------------------------------------------------------------------
 407          下面这个函数用于左半屏数字位的显示示,只需给定页地址,起始例
 408          ---------------------------------------------------------------------------*/
 409          digitaloutleft()
 410          {
 411   1      for(j=0;j<2;j++)
 412   1      {
 413   2        LCD_WriteCommand((page+j),Left);
 414   2        LCD_WriteCommand(clmstart,Left);
 415   2      for(i=0;i<7;i++)
 416   2      {
 417   3        digitalin=digital[k][7*j+i];
 418   3        if(keysetin==1){digitalin=~digital[k][7*j+i];};
 419   3        
 420   3        LCD_WriteData(digitalin,Left); 
 421   3      }}
 422   1      keysetin=0;
 423   1      }
 424          
 425          /*---------------------------------------------------------------------------
 426          下面这个函数用于右半屏数字位的显示,只需给定页地址,起始例
 427          ---------------------------------------------------------------------------*/
 428          digitaloutright()
 429          {
 430   1      for(j=0;j<2;j++)
 431   1      {
 432   2        LCD_WriteCommand((page+j),Right);
 433   2        LCD_WriteCommand(clmstart,Right);
 434   2      for(i=0;i<7;i++)
 435   2      {
 436   3         digitalin=digital[k][7*j+i];
 437   3         if(keysetin==1){digitalin=~digital[k][7*j+i];};
 438   3        
 439   3        LCD_WriteData(digitalin,Right); 
 440   3      }}
 441   1      keysetin=0;
C51 COMPILER V7.50   410                                                                   10/04/2007 14:21:04 PAGE 9   

 442   1      }
 443          
 444          /*---------------------------------------------------------------------------
 445          下面这个timespeedout函数用于第二页的时间及速度值显示,
 446          ---------------------------------------------------------------------------*/
 447            timespeedout()
 448            {
 449   1        
 450   1        ymdhmsrout();
*** WARNING C206 IN LINE 450 OF 410.C: 'ymdhmsrout': missing function-prototype
 451   1        page=0xb8;clmstart=0x40;swd=2;swi();ifkeyl();digitaloutleft(); //yer1---
*** WARNING C206 IN LINE 451 OF 410.C: 'ifkeyl': missing function-prototype
 452   1        page=0xb8;clmstart=0x47;swd=0;swi();ifkeyl();digitaloutleft(); //yer-1--
 453   1        page=0xb8;clmstart=0x4e;digih=year/10;swd=digih;swi();ifkeyl();digitaloutleft(); //yer--1-
 454   1        page=0xb8;clmstart=0x55;digil=year%10;swd=digil;swi();ifkeyl();digitaloutleft(); //yer---1
 455   1        
 456   1        page=0xb8;clmstart=0x63;digih=month/10;swd=digih;swi();ifkeyl();digitaloutleft(); //monthh
 457   1        page=0xb8;clmstart=0x6a;digil=month%10;swd=digil;swi();ifkeyl();digitaloutleft(); //monthl
 458   1        
 459   1        page=0xb8;clmstart=0x71;digih=day/10;swd=digih;swi();ifkeyl();digitaloutleft(); //dayh
 460   1        page=0xb8;clmstart=0x78;digil=day%10;swd=digil;swi();ifkeyl();digitaloutleft(); //dayl
 461   1        
 462   1        page=0xb8;clmstart=0x47;digih=hour/10;swd=digih;swi();ifkeyr();digitaloutright(); //hourh
*** WARNING C206 IN LINE 462 OF 410.C: 'ifkeyr': missing function-prototype
 463   1        page=0xb8;clmstart=0x4e;digil=hour%10;swd=digil;swi();ifkeyr();digitaloutright(); //hourl
 464   1        page=0xb8;clmstart=0x55;k=12;digitaloutright(); //:
 465   1        
 466   1        page=0xb8;clmstart=0x5c;digih=minute/10;swd=digih;swi();ifkeyr();digitaloutright(); //minuteh
 467   1        page=0xb8;clmstart=0x63;digil=minute%10;swd=digil;swi();ifkeyr();digitaloutright(); //minutel
 468   1        page=0xb8;clmstart=0x6a;k=12;digitaloutright(); //:
 469   1        
 470   1        page=0xb8;clmstart=0x71;digih=second/10;swd=digih;swi();ifkeyr();digitaloutright(); //secondh
 471   1        page=0xb8;clmstart=0x78;digil=second%10;swd=digil;swi();ifkeyr();digitaloutright(); //secondl
 472   1        
 473   1        switch (symbolout){case 0: k=13;break;case 1: k=14;break;case 2: k=15;break;case 3: k=16;break;}
 474   1        page=0xbc;clmstart=0x55;                                              ifkeyl();digitaloutleft(); //switc
             -h symbol and out
 475   1        page=0xbc;clmstart=0x5c;digih2=rout/1000;            swd=digih2;swi();ifkeyl();digitaloutleft(); //rin1-
             ---
 476   1        page=0xbc;clmstart=0x63;digih=(rout%1000)/100;       swd=digih;swi(); ifkeyl();digitaloutleft(); //rin-1
             ---
 477   1        page=0xbc;clmstart=0x6a;digil2=((rout%1000)%100)/10; swd=digil2;swi();ifkeyl();digitaloutleft(); //rin--
             -1-
 478   1        page=0xbc;clmstart=0x71;digil=((rout%1000)%100)%10;  swd=digil;swi(); ifkeyl();digitaloutleft(); //rin--
             --1
 479   1        
 480   1        switch (symbolin){case 0: k=13;break;case 1: k=14;break;case 2: k=15;break;case 3: k=16;break;}
 481   1        page=0xbc;clmstart=0x55;ifkeyr();                                            digitaloutright(); //switch
             - symbol and out
 482   1        page=0xbc;clmstart=0x5c;digih2=rin/1000;           swd=digih2;swi();ifkeyr();digitaloutright(); //rout1-
             ---
 483   1        page=0xbc;clmstart=0x63;digih=(rin%1000)/100;      swd=digih; swi();ifkeyr();digitaloutright(); //rout-1
             ---
 484   1        page=0xbc;clmstart=0x6a;digil2=((rin%1000)%100)/10;swd=digil2;swi();ifkeyr();digitaloutright(); //rout--
             -1-
 485   1        page=0xbc;clmstart=0x71;digil=((rin%1000)%100)%10; swd=digil; swi();ifkeyr();digitaloutright(); //rout--
             --1
 486   1      
 487   1           if(con==1){pagestart=8;pageend=10;clmstart=0x5c;clmsum=21;page=0xba;leftout();}//con:run
 488   1      else if(con==0){pagestart=10;pageend=12;clmstart=0x5c;clmsum=21;page=0xba;keysetin=1;leftout();}//con:off
 489   1      
 490   1           if(ab==1){pagestart=8;pageend=10;clmstart=0x5c;clmsum=21;page=0xba;rightout();}//a+b:run
C51 COMPILER V7.50   410                                                                   10/04/2007 14:21:04 PAGE 10  

 491   1      else if(ab==0){pagestart=10;pageend=12;clmstart=0x5c;clmsum=21;page=0xba;keysetin=1;rightout();}//A+B:off
 492   1      
 493   1       }
 494           ifkeyl(){
 495   1            if((page==keyud)&(clmstart==keylr)&(dir==Left)&(keyclr==1)){keysetin=keyset;}  //judge the left twin
             -kle function enable and adress
 496   1                  }
 497           ifkeyr(){
 498   1            if((page==keyud)&(clmstart==keylr)&(dir==Right)&(keyclr==1)){keysetin=keyset;} //judge the right twi
             -nkle function enable and adress
 499   1                  }
 500            //////////////////the accident recode display
 501            accidentdisplay()
 502            {
 503   1        ymdhmsrout();
 504   1        page=0xbe;clmstart=0x40;swd=serial;swi();ifkeyl();digitaloutleft(); //yer1---
 505   1      
 506   1        page=0xbe;clmstart=0x71;digih=day/10;swd=digih;swi();ifkeyl();digitaloutleft(); //dayh
 507   1        page=0xbe;clmstart=0x78;digil=day%10;swd=digil;swi();ifkeyl();digitaloutleft(); //dayl
 508   1        
 509   1        page=0xbe;clmstart=0x47;digih=hour/10;swd=digih;swi();ifkeyr();digitaloutright(); //hourh
 510   1        page=0xbe;clmstart=0x4e;digil=hour%10;swd=digil;swi();ifkeyr();digitaloutright(); //hourl
 511   1        page=0xbe;clmstart=0x55;k=12;digitaloutright(); //:
 512   1        
 513   1        page=0xbe;clmstart=0x5c;digih=minute/10;swd=digih;swi();ifkeyr();digitaloutright(); //minuteh
 514   1        page=0xbe;clmstart=0x63;digil=minute%10;swd=digil;swi();ifkeyr();digitaloutright(); //minutel
 515   1        page=0xbe;clmstart=0x6a;k=12;digitaloutright(); //:
 516   1        
 517   1        page=0xbe;clmstart=0x71;digih=second/10;swd=digih;swi();ifkeyr();digitaloutright(); //secondh
 518   1        page=0xbe;clmstart=0x78;digil=second%10;swd=digil;swi();ifkeyr();digitaloutright(); //secondl
 519   1        }
 520          /*---------------------------------------------------------------------------
 521          /*---------------------------------------------------------------------------
 522          下面这个ymdnsrout函数用于将数组中的data取出用;
 523          ---------------------------------------------------------------------------*/
 524                ymdhmsrout()
 525           {
 526   1        year  =datacenter[0][2]*10+datacenter[0][3];
 527   1        month =datacenter[0][5]*10+datacenter[0][6];
 528   1        day   =datacenter[0][7]*10+datacenter[0][8];
 529   1      
 530   1        hour  =datacenter[1][1]*10+datacenter[1][2];
 531   1        minute=datacenter[1][4]*10+datacenter[1][5];
 532   1        second=datacenter[1][7]*10+datacenter[1][8];
 533   1      
 534   1        rout  =datacenter[2][4]*1000+datacenter[2][5]*100+datacenter[2][6]*10+datacenter[2][7];
 535   1      }
 536          /*---------------------------------------------------------------------------
 537          下面这个ymdnsrin函数用于将data装入数组;
 538          ---------------------------------------------------------------------------*/
 539                ymdhmsrin()
 540           {
 541   1        datacenter[0][2]=year/10;   datacenter[0][3]=year%10;
 542   1        datacenter[0][5]=month/10;  datacenter[0][6]=month%10;
 543   1        datacenter[0][7]=day/10;    datacenter[0][8]=day%10;
 544   1      
 545   1        datacenter[1][1]=hour/10;   datacenter[1][2]=hour%10;
 546   1        datacenter[1][4]=minute/10; datacenter[1][5]=minute%10;
 547   1        datacenter[1][7]=second/10; datacenter[1][8]=second%10;
 548   1      
 549   1        datacenter[2][4]=rout/1000; datacenter[2][5]=(rout%1000)/100; datacenter[2][6]=((rout%1000)%100)/10;  da
             -tacenter[2][7]=(((rout%1000)%100)%10)%10;
C51 COMPILER V7.50   410                                                                   10/04/2007 14:21:04 PAGE 11  

 550   1      }
 551          /*---------------------------------------------------------------------------
 552          下面这个函数为主函数,根据程序要实现的功能写相应的应用程序
 553          ---------------------------------------------------------------------------*/
 554          void main(void) 
 555          { 
 556   1      
 557   1      
 558   1       // XBR2=0x40;//ENABLE 交叉开关
 559   1       // XBR1=0x08;//count
 560   1       // XBR0=0x08;//pca
 561   1        LCD_Initial();  
 562   1        LCD_keyclr(Left);
 563   1        LCD_keyclr(Right);
 564   1        firstpagelcd();
 565   1        enterkeynumber=1;
 566   1        LCD_keyclr(Left);
 567   1        LCD_keyclr(Right);
 568   1       }  


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   2403    ----
   CONSTANT SIZE    =   1630    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     83    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  5 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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