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

📄 3310_5110lcd.s

📁 5110综合演示 变成结构 流程 头文件
💻 S
📖 第 1 页 / 共 2 页
字号:
	.module _3310_5110LCD.c
	.area lit(rom, con, rel)
_font6x8::
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,47
	.byte 0,0
	.byte 0,0
	.byte 7,0
	.byte 7,0
	.byte 0,20
	.byte 127,20
	.byte 127,20
	.byte 0,36
	.byte 42,127
	.byte 42,18
	.byte 0,'b
	.byte 'd,8
	.byte 19,35
	.byte 0,54
	.byte 'I,'U
	.byte 34,'P
	.byte 0,0
	.byte 5,3
	.byte 0,0
	.byte 0,0
	.byte 28,34
	.byte 'A,0
	.byte 0,0
	.byte 'A,34
	.byte 28,0
	.byte 0,20
	.byte 8,62
	.byte 8,20
	.byte 0,8
	.byte 8,62
	.byte 8,8
	.byte 0,0
	.byte 0,160
	.byte 96,0
	.byte 0,8
	.byte 8,8
	.byte 8,8
	.byte 0,0
	.byte 96,96
	.byte 0,0
	.byte 0,32
	.byte 16,8
	.byte 4,2
	.byte 0,62
	.byte 'Q,'I
	.byte 'E,62
	.byte 0,0
	.byte 'B,127
	.byte 64,0
	.byte 0,'B
	.byte 'a,'Q
	.byte 'I,'F
	.byte 0,33
	.byte 'A,'E
	.byte 'K,49
	.byte 0,24
	.byte 20,18
	.byte 127,16
	.byte 0,39
	.byte 'E,'E
	.byte 'E,57
	.byte 0,60
	.byte 'J,'I
	.byte 'I,48
	.byte 0,1
	.byte 'q,9
	.byte 5,3
	.byte 0,54
	.byte 'I,'I
	.byte 'I,54
	.byte 0,6
	.byte 'I,'I
	.byte 41,30
	.byte 0,0
	.byte 54,54
	.byte 0,0
	.byte 0,0
	.byte 'V,54
	.byte 0,0
	.byte 0,8
	.byte 20,34
	.byte 'A,0
	.byte 0,20
	.byte 20,20
	.byte 20,20
	.byte 0,0
	.byte 'A,34
	.byte 20,8
	.byte 0,2
	.byte 1,'Q
	.byte 9,6
	.byte 0,50
	.byte 'I,'Y
	.byte 'Q,62
	.byte 0,124
	.byte 18,17
	.byte 18,124
	.byte 0,127
	.byte 'I,'I
	.byte 'I,54
	.byte 0,62
	.byte 'A,'A
	.byte 'A,34
	.byte 0,127
	.byte 'A,'A
	.byte 34,28
	.byte 0,127
	.byte 'I,'I
	.byte 'I,'A
	.byte 0,127
	.byte 9,9
	.byte 9,1
	.byte 0,62
	.byte 'A,'I
	.byte 'I,'z
	.byte 0,127
	.byte 8,8
	.byte 8,127
	.byte 0,0
	.byte 'A,127
	.byte 'A,0
	.byte 0,32
	.byte 64,'A
	.byte 63,1
	.byte 0,127
	.byte 8,20
	.byte 34,'A
	.byte 0,127
	.byte 64,64
	.byte 64,64
	.byte 0,127
	.byte 2,12
	.byte 2,127
	.byte 0,127
	.byte 4,8
	.byte 16,127
	.byte 0,62
	.byte 'A,'A
	.byte 'A,62
	.byte 0,127
	.byte 9,9
	.byte 9,6
	.byte 0,62
	.byte 'A,'Q
	.byte 33,94
	.byte 0,127
	.byte 9,25
	.byte 41,'F
	.byte 0,'F
	.byte 'I,'I
	.byte 'I,49
	.byte 0,1
	.byte 1,127
	.byte 1,1
	.byte 0,63
	.byte 64,64
	.byte 64,63
	.byte 0,31
	.byte 32,64
	.byte 32,31
	.byte 0,63
	.byte 64,56
	.byte 64,63
	.byte 0,'c
	.byte 20,8
	.byte 20,'c
	.byte 0,7
	.byte 8,'p
	.byte 8,7
	.byte 0,'a
	.byte 'Q,'I
	.byte 'E,'C
	.byte 0,0
	.byte 127,'A
	.byte 'A,0
	.byte 0,'U
	.byte 42,'U
	.byte 42,'U
	.byte 0,0
	.byte 'A,'A
	.byte 127,0
	.byte 0,4
	.byte 2,1
	.byte 2,4
	.byte 0,64
	.byte 64,64
	.byte 64,64
	.byte 0,0
	.byte 1,2
	.byte 4,0
	.byte 0,32
	.byte 'T,'T
	.byte 'T,'x
	.byte 0,127
	.byte 'H,'D
	.byte 'D,56
	.byte 0,56
	.byte 'D,'D
	.byte 'D,32
	.byte 0,56
	.byte 'D,'D
	.byte 'H,127
	.byte 0,56
	.byte 'T,'T
	.byte 'T,24
	.byte 0,8
	.byte 126,9
	.byte 1,2
	.byte 0,24
	.byte 164,164
	.byte 164,124
	.byte 0,127
	.byte 8,4
	.byte 4,'x
	.byte 0,0
	.byte 'D,125
	.byte 64,0
	.byte 0,64
	.byte 128,132
	.byte 125,0
	.byte 0,127
	.byte 16,40
	.byte 'D,0
	.byte 0,0
	.byte 'A,127
	.byte 64,0
	.byte 0,124
	.byte 4,24
	.byte 4,'x
	.byte 0,124
	.byte 8,4
	.byte 4,'x
	.byte 0,56
	.byte 'D,'D
	.byte 'D,56
	.byte 0,252
	.byte 36,36
	.byte 36,24
	.byte 0,24
	.byte 36,36
	.byte 24,252
	.byte 0,124
	.byte 8,4
	.byte 4,8
	.byte 0,'H
	.byte 'T,'T
	.byte 'T,32
	.byte 0,4
	.byte 63,'D
	.byte 64,32
	.byte 0,60
	.byte 64,64
	.byte 32,124
	.byte 0,28
	.byte 32,64
	.byte 32,28
	.byte 0,60
	.byte 64,48
	.byte 64,60
	.byte 0,'D
	.byte 40,16
	.byte 40,'D
	.byte 0,28
	.byte 160,160
	.byte 160,124
	.byte 0,'D
	.byte 'd,'T
	.byte 'L,'D
	.byte 20,20
	.byte 20,20
	.byte 20,20
	.dbfile D:/avrvi/democode/5110_综合演示/source/lib\english_6x8_pixel.h
	.dbsym e font6x8 _font6x8 A[552:92:6]kc
	.area text(rom, con, rel)
	.dbfile D:/avrvi/democode/5110_综合演示/source/lib\english_6x8_pixel.h
	.dbfile D:\avrvi\democode\5110_综合演示\source\lib\3310_5110LCD.c
	.dbfunc e LCD_init _LCD_init fV
	.even
_LCD_init::
	.dbline -1
	.dbline 23
; /************************************************
; 文件:3310_5510LCD.c
; 用途:3310_5510LCD驱动
; 注意:
; 创建:2008.1.25
; 修改:2008.1.25
; Copy Right  (c)  www.avrvi.com  AVR与虚拟仪器
; ************************************************/
; 
; #include "..\config.h"
; #include "lib\english_6x8_pixel.h"
; /*************************************************************************
; ** 函数名称: LCD_init(void)
; ** 功能描述: 3310_5110LCD初始化
; ** 输 入: 
; ** 输出	 : 
; ** 全局变量: 无
; ** 调用模块: 
; ** 说明:
; ** 注意:
; **************************************************************************/
; void LCD_init(void)
;   {
	.dbline 24
;     PORTB &= ~LCD_RST;          // 产生一个让LCD复位的低电平脉冲
	cbi 0x18,6
	.dbline 25
;     delay_1us();
	xcall _delay_1us
	.dbline 26
;     PORTB |= LCD_RST;
	sbi 0x18,6
	.dbline 28
;     
;     PORTB &= ~LCD_CE ;		    // 关闭LCD
	cbi 0x18,4
	.dbline 29
;     delay_1us();
	xcall _delay_1us
	.dbline 30
;     PORTB |= LCD_CE;		    // 使能LCD
	sbi 0x18,4
	.dbline 31
;     delay_1us();
	xcall _delay_1us
	.dbline 33
; 
;     LCD_write_byte(0x21, 0);	// 使用扩展命令设置LCD模式
	clr R18
	ldi R16,33
	xcall _LCD_write_byte
	.dbline 34
;     LCD_write_byte(0xc8, 0);	// 设置偏置电压
	clr R18
	ldi R16,200
	xcall _LCD_write_byte
	.dbline 35
;     LCD_write_byte(0x06, 0);	// 温度校正
	clr R18
	ldi R16,6
	xcall _LCD_write_byte
	.dbline 36
;     LCD_write_byte(0x13, 0);	// 1:48
	clr R18
	ldi R16,19
	xcall _LCD_write_byte
	.dbline 37
;     LCD_write_byte(0x20, 0);	// 使用基本命令
	clr R18
	ldi R16,32
	xcall _LCD_write_byte
	.dbline 38
;     LCD_clear();	            // 清屏
	xcall _LCD_clear
	.dbline 39
;     LCD_write_byte(0x0c, 0);	// 设定显示模式,正常显示
	clr R18
	ldi R16,12
	xcall _LCD_write_byte
	.dbline 41
;         
;     PORTB &= ~LCD_CE ;          // 关闭LCD
	cbi 0x18,4
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e LCD_clear _LCD_clear fV
;              i -> R20,R21
	.even
_LCD_clear::
	xcall push_gset1
	.dbline -1
	.dbline 54
;   }
; /*************************************************************************
; ** 函数名称: LCD_clear(void)
; ** 功能描述: LCD清屏函数
; ** 输 入: 
; ** 输出	 : 
; ** 全局变量: 无
; ** 调用模块: 
; ** 说明:
; ** 注意:
; **************************************************************************/
; void LCD_clear(void)
;   {
	.dbline 57
;     unsigned int i;
; 
;     LCD_write_byte(0x0c, 0);			
	clr R18
	ldi R16,12
	xcall _LCD_write_byte
	.dbline 58
;     LCD_write_byte(0x80, 0);			
	clr R18
	ldi R16,128
	xcall _LCD_write_byte
	.dbline 60
; 
;     for (i=0; i<504; i++)
	clr R20
	clr R21
	xjmp L6
L3:
	.dbline 61
	ldi R18,1
	clr R16
	xcall _LCD_write_byte
L4:
	.dbline 60
	subi R20,255  ; offset = 1
	sbci R21,255
L6:
	.dbline 60
	cpi R20,248
	ldi R30,1
	cpc R21,R30
	brlo L3
	.dbline -2
L2:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 i
	.dbend
	.dbfunc e LCD_set_XY _LCD_set_XY fV
;              Y -> R22
;              X -> R20
	.even
_LCD_set_XY::
	xcall push_gset2
	mov R22,R18
	mov R20,R16
	.dbline -1
	.dbline 75
;       LCD_write_byte(0, 1);			
;   }
; /*************************************************************************
; ** 函数名称: LCD_set_XY(unsigned char X, unsigned char Y)
; ** 功能描述: 设置LCD坐标函数
; ** 输 入: X :0-83 X 坐标
;            Y :0-5  Y 坐标
; ** 输出	 : 
; ** 全局变量: 无
; ** 调用模块: 
; ** 说明:
; ** 注意:
; **************************************************************************/
; void LCD_set_XY(unsigned char X, unsigned char Y)
;   {
	.dbline 76
;     LCD_write_byte(0x40 | Y, 0);		// column
	clr R18
	mov R16,R22
	ori R16,64
	xcall _LCD_write_byte
	.dbline 77
;     LCD_write_byte(0x80 | X, 0);          	// row
	clr R18
	mov R16,R20
	ori R16,128
	xcall _LCD_write_byte
	.dbline -2
L7:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r Y 22 c
	.dbsym r X 20 c
	.dbend
	.dbfunc e LCD_write_char _LCD_write_char fV
;           line -> R20
;              c -> R22
	.even
_LCD_write_char::
	xcall push_gset2
	mov R22,R16
	.dbline -1
	.dbline 90
;   }
; /*************************************************************************
; ** 函数名称: LCD_write_char(unsigned char c)
; ** 功能描述: 显示英文字符
; ** 输 入: c :显示的字符
; ** 输出	 : 
; ** 全局变量: 无
; ** 调用模块: 
; ** 说明:
; ** 注意:
; **************************************************************************/
; void LCD_write_char(unsigned char c)
;   {
	.dbline 93
;     unsigned char line;
; 
;     c -= 32;
	subi R22,32
	.dbline 95
; 
;     for (line=0; line<6; line++)
	clr R20
	xjmp L12
L9:
	.dbline 96
	ldi R18,1
	ldi R24,6
	mul R24,R22
	movw R2,R0
	ldi R24,<_font6x8
	ldi R25,>_font6x8
	add R2,R24
	adc R3,R25
	mov R30,R20
	clr R31
	add R30,R2
	adc R31,R3
	lpm R16,Z
	xcall _LCD_write_byte
L10:
	.dbline 95
	inc R20
L12:
	.dbline 95
	cpi R20,6
	brlo L9
	.dbline -2
L8:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r line 20 c
	.dbsym r c 22 c
	.dbend
	.dbfunc e LCD_write_english_string _LCD_write_english_string fV
;              s -> R20,R21
;              Y -> R10
;              X -> R22
	.even
_LCD_write_english_string::
	xcall push_gset3
	mov R10,R18
	mov R22,R16
	ldd R20,y+6
	ldd R21,y+7
	.dbline -1
	.dbline 110
;       LCD_write_byte(font6x8[c][line], 1);
;   }
; /*************************************************************************
; ** 函数名称: LCD_write_english_string(unsigned char X,unsigned char Y,char *s)
; ** 功能描述: 英文字符串显示函数
; ** 输 入: *s    :英文字符串指针;
;            X、Y  : 显示字符串的位置,x 0-83 ,y 0-5
; ** 输出	 : 
; ** 全局变量: 无
; ** 调用模块: 
; ** 说明:
; ** 注意:
; **************************************************************************/
; void LCD_write_english_string(unsigned char X,unsigned char Y,char *s)
;   {
	.dbline 111
;     LCD_set_XY(X,Y);
	mov R18,R10
	mov R16,R22
	xcall _LCD_set_XY
	xjmp L15
L14:
	.dbline 113
	.dbline 114
	movw R30,R20
	ldd R16,z+0
	xcall _LCD_write_char
	.dbline 115
	subi R20,255  ; offset = 1
	sbci R21,255
	.dbline 116
L15:
	.dbline 112
;     while (*s)
	movw R30,R20
	ldd R2,z+0
	tst R2
	brne L14
	.dbline -2
L13:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r s 20 pc
	.dbsym r Y 10 c
	.dbsym r X 22 c
	.dbend
	.dbfunc e LCD_write_chinese_string _LCD_write_chinese_string fV
;              p -> R20,R21
;              i -> R22
;              n -> R10
;              s -> y+22
;            row -> R12
;           line -> R14
;            num -> y+16
;        ch_with -> y+14
;              Y -> y+12
;              X -> y+10
	.even
_LCD_write_chinese_string::
	xcall push_arg4
	xcall push_gset5
	ldd R14,y+18
	ldd R12,y+20
	.dbline -1
	.dbline 134
;       {
; 	 LCD_write_char(*s);
; 	 s++;
;       }
;   }
; /*************************************************************************
; ** 函数名称: LCD_write_chinese_string(unsigned char X, unsigned char Y,unsigned char ch_with,unsigned char num,unsigned char line,unsigned char row,unsigned char (*s)[24])
; ** 功能描述: 英文字符串显示函数
; ** 输 入: X、Y    :显示汉字的起始X、Y坐标;
;            ch_with :汉字点阵的宽度
;            num     :显示汉字的个数;  
;            line    :汉字点阵数组中的起始行数
;            row     :汉字显示的行间距
; 		   s       : 要显示的汉字
; ** 输出	 : 
; ** 全局变量: 无
; ** 调用模块: 
; ** 说明:LCD_write_chinese_string(0,0,12,7,0,0,write_chinese_string);
; ** 注意:
; **************************************************************************/                      
; void LCD_write_chinese_string(unsigned char X, unsigned char Y,unsigned char ch_with,unsigned char num,unsigned char line,unsigned char row,unsigned char (*s)[24])
;   {
	.dbline 136
;     unsigned char i,n,(*p)[24];

⌨️ 快捷键说明

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