📄 lcd_demo.lst
字号:
606 2 Draw_a(alarm_hour%10,56-8,2,8);
607 2
608 2 Draw_a(10,56,2,8);
609 2 Draw_a(alarm_min/10,56+8,1,8);
610 2 Draw_a(alarm_min%10,56+8+8,1,8);
611 2
612 2 }
613 1 if(data==3)
614 1 { // clrscr(); //clr
615 2
616 2 Draw_word(0,32-8,0,16); //
617 2 Draw_word(1,48-8,0,16); //
618 2 Draw_word(2,64,0,16); //
619 2 Draw_word(3,80,0,16);
620 2
621 2 times=CTIME0;
622 2 datas=CTIME1;
623 2
624 2 bak=(times>>16)&0x1f;
625 2
626 2
627 2
628 2 Draw_a(alarm_hour/10,48-8,1,8);
629 2 Draw_a(alarm_hour%10,56-8,2,8);
630 2 Draw_a(10,56,2,8);
631 2 Draw_a(alarm_min/10,64,1,8);
632 2 Draw_a(alarm_min%10,72,1,8);
633 2
634 2 }
635 1
636 1 }
637
638 void key_do(void)
639 {
640 1
641 1
642 1 //Draw_a(key_code/10,24,1,8);
643 1 // Draw_a(key_code%10,32,1,8);
644 1 switch(screen)
645 1 {
646 2 case 1 :
647 2
648 2 if(key_code==fun){screen=2;clrscr();} key_code=0;
649 2
650 2 break;
651 2 case 2 : //设置闹铃分
ARM COMPILER V2.53, Lcd_Demo 02/08/06 16:25:34 PAGE 11
652 2 if(key_code==fun){screen=1; clrscr();}
653 2 else if(key_code==add)
654 2 {
655 3 alarm_hour++; if(alarm_hour==24){alarm_hour=0;}
656 3 Draw_a(alarm_hour/10,48-8,1,8);
657 3 Draw_a(alarm_hour%10,56-8,2,8);
658 3 }
659 2 else if(key_code==dec)
660 2 {
661 3 alarm_hour--; if(alarm_hour==0){alarm_hour=23;}
662 3 Draw_a(alarm_hour/10,48-8,1,8);
663 3 Draw_a(alarm_hour%10,56-8,2,8);
664 3 }
665 2 else if(key_code==ok)
666 2 {screen=3; clrscr();}
667 2 key_code=0;
668 2 break;
669 2 //设置闹铃秒
670 2 case 3 :
671 2 if(key_code==fun){screen=1; clrscr();}
672 2 else if(key_code==add)
673 2 {
674 3 alarm_min++; if(alarm_min==60){alarm_min=0;}
675 3 Draw_a(alarm_hour/10,48-8,1,8);
676 3 Draw_a(alarm_hour%10,56-8,1,8);
677 3
678 3
679 3
680 3 Draw_a(alarm_min/10,56+8,1,8);
681 3 Draw_a(alarm_min%10,56+8+8,1,8);
682 3
683 3
684 3 }
685 2 else if(key_code==dec)
686 2 {
687 3 alarm_min--; if(alarm_min==0){alarm_min=0;}
688 3 Draw_a(alarm_hour/10,48-8,1,8);
689 3 Draw_a(alarm_hour%10,56-8,1,8);
690 3
691 3 // Draw_a(10,56+8+8,1,8);
692 3
693 3 Draw_a(alarm_min/10,56+8,1,8);
694 3 Draw_a(alarm_min%10,56+8+8,1,8);
695 3 }
696 2 else if(key_code==ok)
697 2 {screen=1; clrscr();}
698 2 key_code=0;
699 2 break;
700 2
701 2 }
702 1
703 1
704 1 }
705
706 //演示程序
707 void main()
-
708 {
709 1
710 1 uchar key_code=0; screen=1;
711 1 init_port();
-
712 1 lcdini(); //reset
713 1 RTCInit();
714 1
715 1
ARM COMPILER V2.53, Lcd_Demo 02/08/06 16:25:34 PAGE 12
716 1
717 1
718 1 clrscr(); //clr
719 1 AD0CR|=(1<<1)|((Fpclk/1000000-1)<<8)|(0<<16)|(0<<17)|(1<<21)|(0<<22)|(1<<24)|(0<<27);
720 1
721 1 data=AD0DR1;
722 1
723 1 /*for(data=15;data>0;data--){
724 1 Draw_a(data,8*data,0,8);
725 1 delay1s(3);
726 1 }
727 1 clrscr();
728 1
729 1 for(data=0;data<15;data++){
730 1 Draw_a(data,8*data,1,8);
731 1 delay1s(3);
732 1 }
733 1
734 1 */
735 1
736 1 delay1s(8);
737 1 clrscr();
738 1
739 1 /* clrscr();
740 1 Draw_word(0,0,1,16); //
741 1 Draw_word(1,16,1,16); //
742 1 Draw_word(2,32,1,16); //
743 1 Draw_word(3,48,1,16); //
744 1 Draw_word(0,64,0,16); //
745 1 Draw_word(1,80,0,16); //
746 1 Draw_word(2,96,0,16); //
747 1
748 1 delay1s(8); */
749 1
750 1 clrscr(); //
751 1 DrawBmp(0,112,ARMKIT_bmp);
752 1 DrawBmp(1,119,Bmp002); //
753 1 delay1s(8);
754 1 clrscr(); //
755 1 DrawBmp1(0,122,Bmp012); //LOGO
756 1 delay1s(8);
757 1 clrscr(); //
758 1
759 1
760 1
761 1 Timer0_init();
762 1 while(1)
763 1 {
764 2 // delay1s(3);
765 2 // if(key_code>0){
766 2 key_do();
767 2 // }
768 2
769 2 Display(screen);
770 2 // Beep_Alarm(key_code);
771 2
772 2
773 2
774 2
775 2 /* clrscr(); //
776 2 DrawBmp1(10,101,Bmp07); //
777 2 delay1s(8);
778 2 clrscr(); //
779 2 wait1(3);
780 2 DrawBmp1(0,122,Bmp04); //
781 2 delay1s(8);
ARM COMPILER V2.53, Lcd_Demo 02/08/06 16:25:34 PAGE 13
782 2 clrscr(); //
783 2 wait1(3);
784 2 DrawBmp1(0,122,Bmp03); //超前科技
785 2 delay1s(8);
786 2 clrscr(); //
787 2 wait1(3);
788 2 clrscr(); //
789 2 DrawBmp1(10,101,Bmp05); //
790 2 delay1s(8);
791 2 clrscr(); //
792 2 wait1(3);
793 2 clrscr(); //
794 2 DrawBmp1(10,101,Bmp06); //
795 2 delay1s(8);
796 2 clrscr(); //
797 2 wait1(3);
798 2 clrscr(); //
799 2 DrawBmp1(10,101,Bmp08); //
800 2 delay1s(8);
801 2 clrscr(); //
802 2 wait1(3);
803 2 clrscr(); //
804 2 DrawBmp1(0,122,Bmp01); //
805 2 wait1(8); */
806 2 }
807 1 }
808
809
ARM COMPILER V2.53, Lcd_Demo 02/08/06 16:25:34 PAGE 14
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN CODE16 (RTCInit?T)
EXTERN CODE16 (ReadRTC?T)
EXTERN CODE16 (Scan_Key?T)
EXTERN DATA (Bmpt1)
EXTERN DATA (Bmpt2)
EXTERN DATA (Bmpt3)
EXTERN DATA (Bmpt4)
EXTERN DATA (Bmpt5)
EXTERN DATA (Bmpt6)
EXTERN DATA (Bmpt7)
EXTERN DATA (Bmptc)
EXTERN DATA (bmp001)
EXTERN DATA (Bmp012)
EXTERN DATA (Bmp002)
EXTERN DATA (ARMKIT_bmp)
EXTERN DATA (bmp009)
EXTERN CODE16 (Ad_fun?T)
EXTERN CODE32 (Scan_Key?A)
EXTERN CODE16 (?C?SDIV?T)
EXTERN CODE16 (?C?UDIV?T)
EXTERN NUMBER (__startup)
*** PUBLICS:
PUBLIC delay1s?T
PUBLIC Draw_a?T
PUBLIC Io_Set?T
PUBLIC Io_Clr?T
PUBLIC Io_Set1?T
PUBLIC Io_Clr1?T
PUBLIC OUT_DATA?T
PUBLIC delay?T
PUBLIC delayms?T
PUBLIC OUTMD?T
PUBLIC OUTMI?T
PUBLIC OUTSD?T
PUBLIC OUTSI?T
PUBLIC lcdini?T
PUBLIC SetPage?T
PUBLIC SetAddress?T
PUBLIC PutCharR?T
PUBLIC PutCharL?T
PUBLIC DrawBmp?T
PUBLIC clrscr?T
PUBLIC DrawBmp1?T
PUBLIC Draw_word?T
PUBLIC Beep_Alarm?T
PUBLIC IRQ_Timer0?A
PUBLIC Timer0_init?T
PUBLIC wait1?T
PUBLIC init_port?T
PUBLIC Display?T
PUBLIC key_do?T
PUBLIC main
PUBLIC key_code
PUBLIC data
PUBLIC screen
PUBLIC alarm_hour
PUBLIC alarm_min
*** DATA SEGMENT '?DT0?Lcd_Demo':
00000000 data:
00000000 BEGIN_INIT
ARM COMPILER V2.53, Lcd_Demo 02/08/06 16:25:34 PAGE 15
00000000 00000000 DD 0x0
00000004 END_INIT
00000004 key_code:
00000004 BEGIN_INIT
00000004 00 DB 0x0
00000005 END_INIT
00000005 screen:
00000005 DS 1
00000006 alarm_hour:
00000006 DS 1
00000007 alarm_min:
00000007 DS 1
*** CODE SEGMENT '?PR?Io_Set?T?Lcd_Demo':
57: void Io_Set(uchar pin) //单个IO口置位函数
00000000 1C01 MOV R1,R0 ; pin
00000002 ---- Variable 'pin' assigned to Register 'R1' ----
58: {
00000002 ; SCOPE-START
59: unsigned int io_data=1;
00000002 2201 MOV R2,#0x1
00000004 ---- Variable 'io_data' assigned to Register 'R2' ----
60: io_data=io_data<<pin;
00000004 1C08 MOV R0,R1 ; pin
00000006 0600 LSL R0,R0,#0x18 ; pin
00000008 0E00 LSR R0,R0,#0x18
0000000A 4082 LSL R2,R0
61: IOSET0=io_data; //IOSET0为IO线上置位寄存器,1有效,0无
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -