📄 lcd.lst
字号:
311
312
313 void lcd_reset(void)
314 {
315 1 E1=0;
316 1 E2=0;
317 1 lcd_commd=0xae;
318 1 LCD_WriteIR1();
319 1 //close display
320 1 lcd_commd=0xae;
321 1 LCD_WriteIR2();
322 1 //reset chip 1
323 1 lcd_commd=0xe2;
324 1 LCD_WriteIR1();
325 1 delay10ms(10);
326 1 //reset chip 2
327 1 lcd_commd=0xe2;
328 1 LCD_WriteIR2();
329 1 delay10ms(10);
330 1 }
331 //part--0: clear all display to normal state
332 // --1: clear all display to alarm state
333 // --2: clear left display
334 // --3: clear right display
335 void lcd_clr(byte part)
336 {
337 1 //close display
338 1 lcd_commd=0xae;
339 1 LCD_WriteIR1();
340 1 //close display
341 1 lcd_commd=0xae;
342 1 LCD_WriteIR2();
343 1 switch(part)
344 1 {
345 2 case 0:
346 2 //display the first row
347 2 lcd_commd=0xd4;
348 2 LCD_WriteIR1();
349 2 //display the first row
350 2 lcd_commd=0xd4;
351 2 LCD_WriteIR2();
352 2 clr1(0);
353 2 break;
354 2
355 2 case 1:
356 2 //display the first row
357 2 lcd_commd=0xd0;
358 2 LCD_WriteIR1();
359 2 //display the first row
360 2 lcd_commd=0xd0;
361 2 LCD_WriteIR2();
362 2 clr1(0);
363 2 break;
364 2
365 2 case 2:
C51 COMPILER V8.05a LCD 06/05/2007 06:25:15 PAGE 7
366 2 //display the first row
367 2 lcd_commd=0xd4;
368 2 LCD_WriteIR1();
369 2 //display the first row
370 2 lcd_commd=0xd4;
371 2 LCD_WriteIR2();
372 2 clr1(1);
373 2 break;
374 2
375 2 case 3:
376 2 //display the first row
377 2 lcd_commd=0xd4;
378 2 LCD_WriteIR1();
379 2 //display the first row
380 2 lcd_commd=0xd4;
381 2 LCD_WriteIR2();
382 2 clr1(2);
383 2 break;
384 2 default:
385 2 break;
386 2 }
387 1 //open display
388 1 lcd_commd=0xaf;
389 1 LCD_WriteIR1();
390 1 //open display
391 1 lcd_commd=0xaf;
392 1 LCD_WriteIR2();
393 1 }
394
395 void lcd_preset(void)
396 {
397 1 E1=0;
398 1 E2=0;
399 1 //close display
400 1 // lcd_commd=0xae;
401 1 // LCD_WriteIR1();
402 1 // delay10ms(1);
403 1 //close display
404 1 // lcd_commd=0xae;
405 1 // LCD_WriteIR2();
406 1 // delay10ms(1);
407 1
408 1 //close free state
409 1 lcd_commd=0xa4;
410 1 LCD_WriteIR1();
411 1 // set 1/32 duty rate
412 1 lcd_commd=0xa9;
413 1 LCD_WriteIR1();
414 1 //set clockwise sort
415 1 lcd_commd=0xa0;
416 1 LCD_WriteIR1();
417 1
418 1 //close free state
419 1 lcd_commd=0xa4;
420 1 LCD_WriteIR2();
421 1 // set 1/32 duty rate
422 1 lcd_commd=0xa9;
423 1 LCD_WriteIR2();
424 1 //set clockwise sort
425 1 lcd_commd=0xa0;
426 1 LCD_WriteIR2();
427 1 }
C51 COMPILER V8.05a LCD 06/05/2007 06:25:15 PAGE 8
428
429
430 //sbit da_stp P1^7;
431 //sbit cp P1^6;
432 //sbit le P1^5;
433 //function:transfer serial data to paral data
434 void seri_to_para(byte da)
435 {
436 1 byte i;
437 1 cp=0;
438 1 le=0;
439 1 for(i=0;i<8;i++)
440 1 {
441 2 cp=0;
442 2 if(da&0x01)
443 2 {
444 3 da_stp=1;
445 3 }
446 2 else
447 2 {
448 3 da_stp=0;
449 3 }
450 2 da>>=1;
451 2 // delay(5);
452 2 cp=1;
453 2 // delay(5);
454 2 }
455 1 le=1;
456 1 // delay(5);
457 1 _nop_();
458 1 _nop_();
459 1 le=0;
460 1 cp=0;
461 1 }
462 /*
463 byte LCD_Read_status(void)
464 {
465 byte da;
466 E1=0;
467 nobusyness(0);
468 E2=0;
469 nobusyness(1);
470 AA=0;
471 R_W=1;
472 E1=1;
473 da=0;
474 da|=(P1&0xfc);
475 if(DB0==1)
476 {
477 da|=0x01;
478 }
479 if(DB1==1)
480 {
481 da|=0x02;
482 }
483 E1=0;
484 return(da);
485 } */
486 void sear_dpl(void)
487 {
488 1 addr_dpl[0]=&dot_0;
489 1 addr_dpl[1]=&dot_1;
C51 COMPILER V8.05a LCD 06/05/2007 06:25:15 PAGE 9
490 1 addr_dpl[2]=&dot_2;
491 1 addr_dpl[3]=&dot_3;
492 1 addr_dpl[4]=&dot_4;
493 1 addr_dpl[5]=&dot_5;
494 1 addr_dpl[6]=&dot_6;
495 1 addr_dpl[7]=&dot_7;
496 1 addr_dpl[8]=&dot_8;
497 1 addr_dpl[9]=&dot_9;
498 1 addr_dpl[10]=&dot_ON;
499 1 addr_dpl[11]=&dot_OFF;
500 1 addr_dpl[12]=&dot_AUT;
501 1 addr_dpl[13]=&dot_Nothing;
502 1 addr_dpl[14]=&dot_PW_;
503 1 addr_dpl[15]=&dot_Ref_;
504 1 addr_dpl[16]=&dot_Wind_;
505 1 addr_dpl[17]=&dot_TA_;
506 1 addr_dpl[18]=&dot_WA_;
507 1 addr_dpl[19]=&dot2;
508 1 addr_dpl[20]=&dot_Tc_;
509 1
510 1 addr_dpl_up[0]=&dot_0_up;
511 1 addr_dpl_up[1]=&dot_1_up;
512 1 addr_dpl_up[2]=&dot_2_up;
513 1 addr_dpl_up[3]=&dot_3_up;
514 1 addr_dpl_up[4]=&dot_4_up;
515 1 addr_dpl_up[5]=&dot_5_up;
516 1 addr_dpl_up[6]=&dot_6_up;
517 1 addr_dpl_up[7]=&dot_7_up;
518 1 addr_dpl_up[8]=&dot_8_up;
519 1 addr_dpl_up[9]=&dot_9_up;
520 1 addr_dpl_up[10]=&dot_00_up;
521 1 addr_dpl_up[11]=&dot_50_up;
522 1 addr_dpl_up[12]=&dot_SENS_up;
523 1 addr_dpl_up[13]=&dot_AH_up;
524 1 addr_dpl_up[14]=&dot_AL_up;
525 1 addr_dpl_up[15]=&dot_PR_up;
526 1 addr_dpl_up[16]=&dot_nothing_up;
527 1
528 1 addr_dpl_down[0]=&dot_0_down;
529 1 addr_dpl_down[1]=&dot_1_down;
530 1 addr_dpl_down[2]=&dot_2_down;
531 1 addr_dpl_down[3]=&dot_3_down;
532 1 addr_dpl_down[4]=&dot_4_down;
533 1 addr_dpl_down[5]=&dot_5_down;
534 1 addr_dpl_down[6]=&dot_6_down;
535 1 addr_dpl_down[7]=&dot_7_down;
536 1 addr_dpl_down[8]=&dot_8_down;
537 1 addr_dpl_down[9]=&dot_9_down;
538 1 addr_dpl_down[10]=&dot_00_down;
539 1 addr_dpl_down[11]=&dot_50_down;
540 1 addr_dpl_down[12]=&dot_SENS_down;
541 1 addr_dpl_down[13]=&dot_AH_down;
542 1 addr_dpl_down[14]=&dot_AL_down;
543 1 addr_dpl_down[15]=&dot_PR_down;
544 1 addr_dpl_down[16]=&dot_nothing_down;
545 1
546 1 }
547
548 void dp_bigchara(byte addr,byte chip,byte row,byte column,byte len)
549 {
550 1 lcd_xchip=chip;
551 1 ptc=addr_dpl_up[addr];
C51 COMPILER V8.05a LCD 06/05/2007 06:25:15 PAGE 10
*** WARNING C289 IN LINE 551 OF LCD.C: '=': converting non-pointer to pointer
552 1 // ptc=(byte code * )addr_dpl_up+addr;
553 1 lcd_xrow=row;
554 1 lcd_xcolumn=column;
555 1 lcd_xlen=len;
556 1 LCD_Write_cbuff();
557 1 lcd_xrow=row+1;
558 1 ptc=addr_dpl_down[addr];
*** WARNING C289 IN LINE 558 OF LCD.C: '=': converting non-pointer to pointer
559 1 LCD_Write_cbuff();
560 1 }
561
562 void dp_chara(byte addr,byte chip,byte row,byte column,byte len)
563 {
564 1 lcd_xchip=chip;
565 1 ptc=addr_dpl[addr];
*** WARNING C289 IN LINE 565 OF LCD.C: '=': converting non-pointer to pointer
566 1 lcd_xrow=row;
567 1 lcd_xcolumn=column;
568 1 lcd_xlen=len;
569 1 LCD_Write_cbuff();
570 1 }
571
572 //part --0:clear all
573 // --1:clear left display
574 // --2:clear left display
575 void clr1(byte part)
576 {
577 1 byte i,j;
578 1 switch(part)
579 1 {
580 2 case 0:
581 2 //clear all
582 2 for(i=0;i<2;i++)
583 2 {
584 3 for(j=0;j<4;j++)
585 3 {
586 4 LCD_Write_da(i,j,0,0x00,61);
587 4 // delay10ms(2);
588 4 }
589 3 }
590 2 break;
591 2 //clear left display
592 2 case 1:
593 2 for(j=0;j<2;j++)
594 2 {
595 3
596 3 LCD_Write_da(0,j,0,0x00,61);
597 3 // delay10ms(2);
598 3 }
599 2 break;
600 2 //clear left display
601 2 case 2:
602 2 for(j=0;j<2;j++)
603 2 {
604 3
605 3 LCD_Write_da(1,j,0,0x00,61);
606 3 // delay10ms(2);
607 3 }
608 2 break;
609 2 }
610 1 }
C51 COMPILER V8.05a LCD 06/05/2007 06:25:15 PAGE 11
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1706 ----
CONSTANT SIZE = 1032 ----
XDATA SIZE = 144 ----
PDATA SIZE = ---- ----
DATA SIZE = 23 23
IDATA SIZE = 7 ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 3 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -