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

📄 lcd.lis

📁 AVR单片机 C语言程序设计经典实用
💻 LIS
📖 第 1 页 / 共 4 页
字号:
 0048           ; // Function    : Set_Data
 0048           ; // Input       : data - Data Line Level
 0048           ; // Output      : none
 0048           ; // Description : Low Level Interface Function
 0048           ; //******************************************************************************
 0048           ; void Set_Data(INT8U data)
 0048           ; {
 0048                   .dbline 163
 0048           ;       PORTA  = data;
 0048 0BBB              out 0x1b,R16
 004A                   .dbline -2
 004A                   .dbline 164
 004A           ; }
 004A           L19:
 004A                   .dbline 0 ; func end
 004A 0895              ret
 004C                   .dbsym r data 16 c
 004C                   .dbend
 004C                   .dbfunc e LCD_Command_DispOnOff _LCD_Command_DispOnOff fV
 004C           ;          onoff -> R20
                        .even
 004C           _LCD_Command_DispOnOff::
 004C 0E940000          xcall push_gset1
 0050 402F              mov R20,R16
 0052                   .dbline -1
 0052                   .dbline 173
 0052           ; 
 0052           ; //******************************************************************************
 0052           ; // Function    : LCD_Command_DispOnOff
 0052           ; // Input       : onoff = 1 -> LCD Display Enabled,else Disabled
 0052           ; // Output      : none
 0052           ; // Description : Command Level Function,Display ONOFF Control
 0052           ; //******************************************************************************
 0052           ; void LCD_Command_DispOnOff(INT8U onoff)
 0052           ; {
 0052                   .dbline 174
 0052           ;       Set_RW(0);
 0052 0027              clr R16
 0054 DBDF              xcall _Set_RW
 0056                   .dbline 175
 0056           ;       Set_DI(0);
 0056 0027              clr R16
 0058 D3DF              xcall _Set_DI
 005A                   .dbline 176
 005A           ;       Set_EN(0);
 005A 0027              clr R16
 005C DDDF              xcall _Set_EN
 005E                   .dbline 177
 005E           ;       Set_Data(0x3E + onoff);
 005E 042F              mov R16,R20
 0060 025C              subi R16,194    ; addi 62
 0062 F2DF              xcall _Set_Data
 0064                   .dbline 178
 0064           ;       Set_EN(1);
 0064 01E0              ldi R16,1
 0066 D8DF              xcall _Set_EN
 0068                   .dbline 179
 0068           ;       Set_EN(0);
 0068 0027              clr R16
 006A D6DF              xcall _Set_EN
 006C                   .dbline -2
 006C                   .dbline 180
 006C           ; }
 006C           L20:
 006C 0E940000          xcall pop_gset1
 0070                   .dbline 0 ; func end
 0070 0895              ret
 0072                   .dbsym r onoff 20 c
 0072                   .dbend
 0072                   .dbfunc e LCD_Command_SetStartLine _LCD_Command_SetStartLine fV
 0072           ;      startline -> R20
                        .even
 0072           _LCD_Command_SetStartLine::
 0072 0E940000          xcall push_gset1
 0076 402F              mov R20,R16
 0078                   .dbline -1
 0078                   .dbline 189
 0078           ; 
 0078           ; //******************************************************************************
 0078           ; // Function    : LCD_Command_SetStartLine
 0078           ; // Input       : startline - Display Start Line,See Specification
 0078           ; // Output      : none
 0078           ; // Description : Command Level Function,Set Display Start Line
 0078           ; //******************************************************************************
 0078           ; void LCD_Command_SetStartLine(INT8U startline)
 0078           ; {
 0078                   .dbline 190
 0078           ;       Set_RW(0);
 0078 0027              clr R16
 007A C8DF              xcall _Set_RW
 007C                   .dbline 191
 007C           ;       Set_DI(0);                                                                                                                              
 007C 0027              clr R16
 007E C0DF              xcall _Set_DI
 0080                   .dbline 192
 0080           ;       Set_EN(0);                                                                                                                              
 0080 0027              clr R16
 0082 CADF              xcall _Set_EN
 0084                   .dbline 193
 0084           ;       Set_Data(0xC0 + startline);
 0084 042F              mov R16,R20
 0086 0054              subi R16,64    ; addi 192
 0088 DFDF              xcall _Set_Data
 008A                   .dbline 194
 008A           ;       Set_EN(1);                                                                                                                              
 008A 01E0              ldi R16,1
 008C C5DF              xcall _Set_EN
 008E                   .dbline 195
 008E           ;       Set_EN(0);                                                                                                                              
 008E 0027              clr R16
 0090 C3DF              xcall _Set_EN
 0092                   .dbline -2
 0092                   .dbline 196
 0092           ; }
 0092           L21:
 0092 0E940000          xcall pop_gset1
 0096                   .dbline 0 ; func end
 0096 0895              ret
 0098                   .dbsym r startline 20 c
 0098                   .dbend
 0098                   .dbfunc e LCD_Command_Set_X _LCD_Command_Set_X fV
 0098           ;              x -> R20
                        .even
 0098           _LCD_Command_Set_X::
 0098 0E940000          xcall push_gset1
 009C 402F              mov R20,R16
 009E                   .dbline -1
 009E                   .dbline 205
 009E           ; 
 009E           ; //******************************************************************************
 009E           ; // Function    : LCD_Command_Set_X
 009E           ; // Input       : x - Display Row,from 0 to 7 for 128*64 LCD
 009E           ; // Output      : none
 009E           ; // Description : Command Level Function,Set Operation X Address
 009E           ; //******************************************************************************
 009E           ; void LCD_Command_Set_X(INT8U x)
 009E           ; {
 009E                   .dbline 206
 009E           ;       Set_RW(0);
 009E 0027              clr R16
 00A0 B5DF              xcall _Set_RW
 00A2                   .dbline 207
 00A2           ;       Set_DI(0);
 00A2 0027              clr R16
 00A4 ADDF              xcall _Set_DI
 00A6                   .dbline 208
 00A6           ;       Set_EN(0);
 00A6 0027              clr R16
 00A8 B7DF              xcall _Set_EN
 00AA                   .dbline 209
 00AA           ;       Set_Data(0xB8 + x);
 00AA 042F              mov R16,R20
 00AC 0854              subi R16,72    ; addi 184
 00AE CCDF              xcall _Set_Data
 00B0                   .dbline 210
 00B0           ;       Set_EN(1);
 00B0 01E0              ldi R16,1
 00B2 B2DF              xcall _Set_EN
 00B4                   .dbline 211
 00B4           ;       Set_EN(0);
 00B4 0027              clr R16
 00B6 B0DF              xcall _Set_EN
 00B8                   .dbline -2
 00B8                   .dbline 212
 00B8           ; }
 00B8           L22:
 00B8 0E940000          xcall pop_gset1
 00BC                   .dbline 0 ; func end
 00BC 0895              ret
 00BE                   .dbsym r x 20 c
 00BE                   .dbend
 00BE                   .dbfunc e LCD_Command_Set_Y _LCD_Command_Set_Y fV
 00BE           ;         column -> R20
                        .even
 00BE           _LCD_Command_Set_Y::
 00BE 0E940000          xcall push_gset1
 00C2 402F              mov R20,R16
 00C4                   .dbline -1
 00C4                   .dbline 221
 00C4           ; 
 00C4           ; //******************************************************************************
 00C4           ; // Function    : LCD_Command_Set_Y
 00C4           ; // Input       : y - Display Column,from 0 to 63 for 128*64 LCD
 00C4           ; // Output      : none
 00C4           ; // Description : Command Level Function,Set Operation Y Address
 00C4           ; //******************************************************************************
 00C4           ; void LCD_Command_Set_Y(INT8U column)
 00C4           ; {
 00C4                   .dbline 222
 00C4           ;       Set_RW(0);
 00C4 0027              clr R16
 00C6 A2DF              xcall _Set_RW
 00C8                   .dbline 223
 00C8           ;       Set_DI(0);
 00C8 0027              clr R16
 00CA 9ADF              xcall _Set_DI
 00CC                   .dbline 224
 00CC           ;       Set_EN(0);
 00CC 0027              clr R16
 00CE A4DF              xcall _Set_EN
 00D0                   .dbline 225
 00D0           ;       Set_Data(0x40 + column);
 00D0 042F              mov R16,R20
 00D2 005C              subi R16,192    ; addi 64
 00D4 B9DF              xcall _Set_Data
 00D6                   .dbline 226
 00D6           ;       Set_EN(1);
 00D6 01E0              ldi R16,1
 00D8 9FDF              xcall _Set_EN
 00DA                   .dbline 227
 00DA           ;       Set_EN(0);
 00DA 0027              clr R16
 00DC 9DDF              xcall _Set_EN
 00DE                   .dbline -2
 00DE                   .dbline 228
 00DE           ; }
 00DE           L23:
 00DE 0E940000          xcall pop_gset1
 00E2                   .dbline 0 ; func end
 00E2 0895              ret
 00E4                   .dbsym r column 20 c
 00E4                   .dbend
 00E4                   .dbfunc e LCD_Command_WriteByte _LCD_Command_WriteByte fV
 00E4           ;           data -> R20
                        .even
 00E4           _LCD_Command_WriteByte::
 00E4 0E940000          xcall push_gset1
 00E8 402F              mov R20,R16
 00EA                   .dbline -1
 00EA                   .dbline 237
 00EA           ; 
 00EA           ; //******************************************************************************
 00EA           ; // Function    : LCD_Command_WriteByte
 00EA           ; // Input       : data - Display Data
 00EA           ; // Output      : none
 00EA           ; // Description : Command Level Function,Write Display Data to DDRAM
 00EA           ; //******************************************************************************
 00EA           ; void LCD_Command_WriteByte(INT8U data)
 00EA           ; {
 00EA                   .dbline 238
 00EA           ;       Set_RW(0);
 00EA 0027              clr R16
 00EC 8FDF              xcall _Set_RW
 00EE                   .dbline 239
 00EE           ;       Set_DI(1);
 00EE 01E0              ldi R16,1
 00F0 87DF              xcall _Set_DI
 00F2                   .dbline 240
 00F2           ;       Set_EN(0);
 00F2 0027              clr R16
 00F4 91DF              xcall _Set_EN
 00F6                   .dbline 241
 00F6           ;       Set_Data(data);
 00F6 042F              mov R16,R20
 00F8 A7DF              xcall _Set_Data
 00FA                   .dbline 242
 00FA           ;       Set_EN(1);
 00FA 01E0              ldi R16,1
 00FC 8DDF              xcall _Set_EN
 00FE                   .dbline 243
 00FE           ;       Set_EN(0);
 00FE 0027              clr R16
 0100 8BDF              xcall _Set_EN
 0102                   .dbline -2
 0102                   .dbline 244
 0102           ; }
 0102           L24:
 0102 0E940000          xcall pop_gset1
 0106                   .dbline 0 ; func end
 0106 0895              ret
 0108                   .dbsym r data 20 c
 0108                   .dbend
 0108                   .dbfunc e LCD_Reset _LCD_Reset fV
                        .even
 0108           _LCD_Reset::
 0108                   .dbline -1
 0108                   .dbline 253
 0108           ; 
 0108           ; //******************************************************************************
 0108           ; // Function    : LCD_Reset
 0108           ; // Input       : none
 0108           ; // Output      : none
 0108           ; // Description : Command Level Function,Soft RESET LCD Module
 0108           ; //******************************************************************************
 0108           ; void LCD_Reset(void)
 0108           ; {
 0108                   .dbline 254
 0108           ;       Set_RST(0);
 0108 0027              clr R16
 010A 98DF              xcall _Set_RST
 010C                   .dbline 255
 010C           ;       Set_RST(1);
 010C 01E0              ldi R16,1
 010E                   .dbline -2
 010E                   .dbline 256
 010E           ; }
 010E           L25:
 010E                   .dbline 0 ; func end
 010E 96CF              xjmp _Set_RST
 0110                   .dbend
 0110                   .dbfunc e LCD_Init _LCD_Init fV
                        .even
 0110           _LCD_Init::
 0110                   .dbline -1
 0110                   .dbline 265
 0110           ; 
 0110           ; //******************************************************************************
 0110           ; // Function    : LCD_Init
 0110           ; // Input       : none
 0110           ; // Output      : none
 0110           ; // Description : Application Level Function,Init LCD
 0110           ; //******************************************************************************
 0110           ; void LCD_Init(void)
 0110           ; {
 0110                   .dbline 266
 0110           ;       LCD_Reset();
 0110 FBDF              xcall _LCD_Reset
 0112                   .dbline 267
 0112           ;       LCD_Clear_Line(0,7);
 0112 27E0              ldi R18,7
 0114 0027              clr R16
 0116 04D0              xcall _LCD_Clear_Line
 0118                   .dbline 268
 0118           ;       LCD_Command_DispOnOff(1);
 0118 01E0              ldi R16,1
 011A 98DF              xcall _LCD_Command_DispOnOff

⌨️ 快捷键说明

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