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

📄 misc.lis

📁 AVR单片机 C语言程序设计经典实用
💻 LIS
📖 第 1 页 / 共 2 页
字号:
                        .module misc.c
                        .area data(ram, con, rel)
 0000           _bLED_Test_Enable::
 0000                   .blkb 1
                        .area idata
 0000 00                .byte 0
                        .area data(ram, con, rel)
 0001                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 0001                   .dbsym e bLED_Test_Enable _bLED_Test_Enable c
 0001           _bBuzzer_Test_Enable::
 0001                   .blkb 1
                        .area idata
 0001 00                .byte 0
                        .area data(ram, con, rel)
 0002                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 0002                   .dbsym e bBuzzer_Test_Enable _bBuzzer_Test_Enable c
                        .area text(rom, con, rel)
 0000                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 0000                   .dbfunc e sSet_LED_Test _sSet_LED_Test fV
 0000           ;        bEnable -> R16
                        .even
 0000           _sSet_LED_Test::
 0000                   .dbline -1
 0000                   .dbline 22
 0000           ; //******************************************************************************
 0000           ; // File Name : misc.c
 0000           ; // Author    : Steaven
 0000           ; // Created   : 2008-06-09
 0000           ; // Modified  : 
 0000           ; // Revision  : V0.0
 0000           ; //******************************************************************************
 0000           ; 
 0000           ; #include "app.h"
 0000           ; 
 0000           ; //global variables definition
 0000           ; INT8U bLED_Test_Enable = 0;     //Enable LED Test
 0000           ; INT8U bBuzzer_Test_Enable = 0;  //Enable BUZZER Test
 0000           ; 
 0000           ; //****************************************************************
 0000           ; // Function    : sSet_LED_Test
 0000           ; // Input       : bEnable - whether Enable LED Test or not
 0000           ; // Output      : none
 0000           ; // Description : Interface Function-Set LED Test Flag
 0000           ; //****************************************************************
 0000           ; void sSet_LED_Test(INT8U bEnable)
 0000           ; {
 0000                   .dbline 23
 0000           ;       bLED_Test_Enable = bEnable;
 0000 00930000          sts _bLED_Test_Enable,R16
 0004                   .dbline -2
 0004                   .dbline 24
 0004           ; }
 0004           L1:
 0004                   .dbline 0 ; func end
 0004 0895              ret
 0006                   .dbsym r bEnable 16 c
 0006                   .dbend
 0006                   .dbfunc e sbGet_LED_Test _sbGet_LED_Test fc
                        .even
 0006           _sbGet_LED_Test::
 0006                   .dbline -1
 0006                   .dbline 33
 0006           ; 
 0006           ; //****************************************************************
 0006           ; // Function    : sbGet_LED_Test
 0006           ; // Input       : none
 0006           ; // Output      : none
 0006           ; // Description : Interface Function-Get LED Test Flag
 0006           ; //****************************************************************
 0006           ; INT8U sbGet_LED_Test(void)
 0006           ; {
 0006                   .dbline 34
 0006           ;       return(bLED_Test_Enable);
 0006 00910000          lds R16,_bLED_Test_Enable
 000A                   .dbline -2
 000A           L2:
 000A                   .dbline 0 ; func end
 000A 0895              ret
 000C                   .dbend
 000C                   .dbfunc e sSet_Buzzer_Test _sSet_Buzzer_Test fV
 000C           ;        bEnable -> R16
                        .even
 000C           _sSet_Buzzer_Test::
 000C                   .dbline -1
 000C                   .dbline 44
 000C           ; }
 000C           ; 
 000C           ; //****************************************************************
 000C           ; // Function    : sSet_Buzzer_Test
 000C           ; // Input       : bEnable - whether Enable BUZZER Test or not
 000C           ; // Output      : none
 000C           ; // Description : Interface Function-Set BUZZER Test Flag
 000C           ; //****************************************************************
 000C           ; void sSet_Buzzer_Test(INT8U bEnable)
 000C           ; {
 000C                   .dbline 45
 000C           ;       bBuzzer_Test_Enable = bEnable;
 000C 00930100          sts _bBuzzer_Test_Enable,R16
 0010                   .dbline -2
 0010                   .dbline 46
 0010           ; }
 0010           L3:
 0010                   .dbline 0 ; func end
 0010 0895              ret
 0012                   .dbsym r bEnable 16 c
 0012                   .dbend
 0012                   .dbfunc e sbGet_Buzzer_Test _sbGet_Buzzer_Test fc
                        .even
 0012           _sbGet_Buzzer_Test::
 0012                   .dbline -1
 0012                   .dbline 55
 0012           ; 
 0012           ; //****************************************************************
 0012           ; // Function    : sbGet_Buzzer_Test
 0012           ; // Input       : none
 0012           ; // Output      : none
 0012           ; // Description : Interface Function-Get BUZZER Test Flag
 0012           ; //****************************************************************
 0012           ; INT8U sbGet_Buzzer_Test(void)
 0012           ; {
 0012                   .dbline 56
 0012           ;       return(bBuzzer_Test_Enable);
 0012 00910100          lds R16,_bBuzzer_Test_Enable
 0016                   .dbline -2
 0016           L4:
 0016                   .dbline 0 ; func end
 0016 0895              ret
 0018                   .dbend
 0018                   .dbfunc e LED_ON_ALL _LED_ON_ALL fV
                        .even
 0018           _LED_ON_ALL::
 0018                   .dbline -1
 0018                   .dbline 66
 0018           ; }
 0018           ; 
 0018           ; //****************************************************************
 0018           ; // Function    : LED_ON_ALL
 0018           ; // Input       : none
 0018           ; // Output      : none
 0018           ; // Description : LED Control-ON LED
 0018           ; //****************************************************************
 0018           ; void LED_ON_ALL(void)
 0018           ; {
 0018                   .dbline 67
 0018           ;       PORTD |= 0xF0;
 0018 82B3              in R24,0x12
 001A 806F              ori R24,240
 001C 82BB              out 0x12,R24
 001E                   .dbline -2
 001E                   .dbline 68
 001E           ; }
 001E           L5:
 001E                   .dbline 0 ; func end
 001E 0895              ret
 0020                   .dbend
 0020                   .dbfunc e LED_OFF_ALL _LED_OFF_ALL fV
                        .even
 0020           _LED_OFF_ALL::
 0020                   .dbline -1
 0020                   .dbline 77
 0020           ; 
 0020           ; //****************************************************************
 0020           ; // Function    : LED_OFF_ALL
 0020           ; // Input       : none
 0020           ; // Output      : none
 0020           ; // Description : LED Control-OFF LED
 0020           ; //****************************************************************
 0020           ; void LED_OFF_ALL(void)
 0020           ; {
 0020                   .dbline 78
 0020           ;       PORTD &= 0x0F;
 0020 82B3              in R24,0x12
 0022 8F70              andi R24,15
 0024 82BB              out 0x12,R24
 0026                   .dbline -2
 0026                   .dbline 79
 0026           ; }
 0026           L6:
 0026                   .dbline 0 ; func end
 0026 0895              ret
 0028                   .dbend
 0028                   .dbfunc e BUZZER_ON _BUZZER_ON fV
                        .even
 0028           _BUZZER_ON::
 0028                   .dbline -1
 0028                   .dbline 88
 0028           ; 
 0028           ; //****************************************************************
 0028           ; // Function    : BUZZER_ON
 0028           ; // Input       : none
 0028           ; // Output      : none
 0028           ; // Description : BUZZER Control-ON BUZZER
 0028           ; //****************************************************************
 0028           ; void BUZZER_ON(void)
 0028           ; {
 0028                   .dbline 89
 0028           ;       PORTB |= 0x08;
 0028 C39A              sbi 0x18,3
 002A                   .dbline -2
 002A                   .dbline 90
 002A           ; }
 002A           L7:
 002A                   .dbline 0 ; func end
 002A 0895              ret
 002C                   .dbend
 002C                   .dbfunc e BUZZER_OFF _BUZZER_OFF fV
                        .even
 002C           _BUZZER_OFF::
 002C                   .dbline -1
 002C                   .dbline 99
 002C           ; 
 002C           ; //****************************************************************
 002C           ; // Function    : BUZZER_OFF
 002C           ; // Input       : none
 002C           ; // Output      : none
 002C           ; // Description : BUZZER Control-OFF BUZZER
 002C           ; //****************************************************************
 002C           ; void BUZZER_OFF(void)
 002C           ; {
 002C                   .dbline 100
 002C           ;       PORTB &= ~0x08;
 002C C398              cbi 0x18,3
 002E                   .dbline -2
 002E                   .dbline 101
 002E           ; }
 002E           L8:
 002E                   .dbline 0 ; func end
 002E 0895              ret
 0030                   .dbend
                        .area data(ram, con, rel)
 0002                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 0002           L10:
 0002                   .blkb 2
                        .area idata
 0002 0100              .word 1
                        .area data(ram, con, rel)
 0004                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
                        .area text(rom, con, rel)
 0030                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 0030                   .dbfunc e swGet_KEY_ESC _swGet_KEY_ESC fi
 0030                   .dbsym s wKeyStatus L10 i
                        .even
 0030           _swGet_KEY_ESC::
 0030                   .dbline -1
 0030                   .dbline 110
 0030           ; 
 0030           ; //****************************************************************
 0030           ; // Function    : swGet_Key1
 0030           ; // Input       : none
 0030           ; // Output      : true - Key1 active; false - Key1 - passitive
 0030           ; // Description : Key1 Detection,rising edge active
 0030           ; //****************************************************************
 0030           ; INT16U swGet_KEY_ESC(void)
 0030           ; {
 0030                   .dbline 112
 0030           ;       static INT16U wKeyStatus = 1;
 0030           ;       if(wKeyStatus == 1)
 0030 80910200          lds R24,L10
 0034 90910300          lds R25,L10+1
 0038 8130              cpi R24,1
 003A E0E0              ldi R30,0
 003C 9E07              cpc R25,R30
 003E 49F4              brne L11
 0040                   .dbline 113
 0040           ;       {
 0040                   .dbline 114
 0040           ;               if((PINB & (1 << cKey1)) == 0) //Key Pressed
 0040 B499              sbic 0x16,4
 0042 1AC0              rjmp L12
 0044                   .dbline 115
 0044           ;               {
 0044                   .dbline 116
 0044           ;                       wKeyStatus = 0;
 0044 2224              clr R2
 0046 3324              clr R3
 0048 30920300          sts L10+1,R3
 004C 20920200          sts L10,R2
 0050                   .dbline 117
 0050           ;               }
 0050                   .dbline 118
 0050           ;       }
 0050 13C0              xjmp L12
 0052           L11:
 0052                   .dbline 119
 0052           ;       else if(wKeyStatus == 0)
 0052 20900200          lds R2,L10
 0056 30900300          lds R3,L10+1
 005A 2220              tst R2
 005C 69F4              brne L15
 005E 3320              tst R3
 0060 59F4              brne L15
 0062           X0:
 0062                   .dbline 120
 0062           ;       {
 0062                   .dbline 121
 0062           ;               if(PINB & (1 << cKey1))       //Key Released
 0062 B49B              sbis 0x16,4
 0064 09C0              rjmp L17
 0066                   .dbline 122
 0066           ;               {
 0066                   .dbline 123
 0066           ;                       wKeyStatus = 1;
 0066 81E0              ldi R24,1
 0068 90E0              ldi R25,0
 006A 90930300          sts L10+1,R25
 006E 80930200          sts L10,R24
 0072                   .dbline 124
 0072           ;                       return(true);
 0072 01E0              ldi R16,1
 0074 10E0              ldi R17,0
 0076 02C0              xjmp L9
 0078           L17:
 0078                   .dbline 126
 0078           ;               }
 0078           ;       }
 0078           L15:
 0078           L12:
 0078                   .dbline 127
 0078           ;       return(false);
 0078 0027              clr R16
 007A 1127              clr R17
 007C                   .dbline -2
 007C           L9:
 007C                   .dbline 0 ; func end
 007C 0895              ret
 007E                   .dbend
                        .area data(ram, con, rel)
 0004                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 0004           L20:
 0004                   .blkb 2
                        .area idata
 0004 0100              .word 1
                        .area data(ram, con, rel)
 0006                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
                        .area text(rom, con, rel)
 007E                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\misc.c
 007E                   .dbfunc e swGet_KEY_UP _swGet_KEY_UP fi
 007E                   .dbsym s wKeyStatus L20 i
                        .even
 007E           _swGet_KEY_UP::
 007E                   .dbline -1
 007E                   .dbline 137
 007E           ; }
 007E           ; 
 007E           ; //******************************************************************************
 007E           ; // Function    : swGet_Key2
 007E           ; // Input       : none
 007E           ; // Output      : true - Key2 active; false - Key2 - passitive
 007E           ; // Description : Key1 Detection,rising edge active
 007E           ; //******************************************************************************
 007E           ; INT16U swGet_KEY_UP(void)
 007E           ; {
 007E                   .dbline 139
 007E           ;       static INT16U wKeyStatus = 1;
 007E           ;       if(wKeyStatus == 1)
 007E 80910400          lds R24,L20
 0082 90910500          lds R25,L20+1
 0086 8130              cpi R24,1

⌨️ 快捷键说明

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