📄 lcm.lst
字号:
C51 COMPILER V8.02 LCM 09/09/2006 18:05:50 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE LCM
OBJECT MODULE PLACED IN LCM.OBJ
COMPILER INVOKED BY: E:\电设计\keil\C51\BIN\C51.EXE LCM.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include "LCM.h"
2 #include "Serial.h"
3
4 //背光: 0开 1关
5 /*void lcd_light(uchar light)
6 {
7 WriteByte(0x1b);
8 WriteByte(0x25);
9 WriteByte(light);}
10
11 //清屏 */
12 void lcd_cls(void)
13 {
14 1 WriteByte(0x1b);
15 1 WriteByte(0x32);
16 1 }
17
18 //设置光标位置
19 void lcd_cursor(uchar x, uchar y)
20 {
21 1 WriteByte(0x1b);
22 1 WriteByte(0x33);
23 1 WriteByte(x);
24 1 WriteByte(y);
25 1 }
26
27 //光标闪烁还是关闭
28 /*void lcd_showcursor(uchar attr)
29 {
30 WriteByte(0x1b);
31 WriteByte(0x34);
32 WriteByte(attr);
33 }
34 */
35 //显示字符串
36 void lcd_string(uchar attr,uchar *string)
37 {
38 1 WriteByte(0x1b);
39 1 WriteByte(0x37);
40 1 WriteByte(attr);
41 1 WriteString(string);
42 1 WriteByte(0x00);
43 1 }
44
45 //画圆
46 /*void lcd_circle(uchar attr,uchar ox,uchar oy,uchar rx)
47 {
48 WriteByte(0x1b);
49 WriteByte(0x41);
50 WriteByte(attr);
51 WriteByte(ox);
52 WriteByte(oy);
53 WriteByte(rx);
54 }
55 */
C51 COMPILER V8.02 LCM 09/09/2006 18:05:50 PAGE 2
56 //画线 0擦除1实线2虚线
57 void lcd_line(uchar attr,uchar x0,uchar y0,uchar x1,uchar y1)
58 {
59 1 WriteByte(0x1b);
60 1 WriteByte(0x39);
61 1 WriteByte(attr);
62 1 WriteByte(x0);
63 1 WriteByte(y0);
64 1 WriteByte(x1);
65 1 WriteByte(y1);
66 1 }
67
68 //画点
69 /*void lcd_dot(uchar attr,uchar x,uchar y)
70 {
71 WriteByte(0x1b);
72 WriteByte(0x38);
73 WriteByte(attr);
74 WriteByte(x);
75 WriteByte(y);
76 }
77 */
78 /*-----------------------------------------
79 功能: 任意位置显示一个汉字
80 输入汉字内码,坐标为像素
81 -----------------------------------------*/
82 /*void DisplayHZ(uchar x,uchar y,uchar ch1,uchar ch2)
83 {
84 WriteByte(0x1b);
85 WriteByte(0x3a);
86 WriteByte(x);
87 WriteByte(y);
88 WriteByte(ch1);
89 WriteByte(ch2);
90
91 }
92 */
93 /*-----------------------------------------
94 功能: 在指定的位置显示字符串
95 入口: attr 0 正显 1 反显
96 x 0--17 y 0--5
97 *string 字符串指针
98 -----------------------------------------*/
99 void DisplayStr(uchar attr,uchar x, uchar y,uchar *string)
100 {
101 1 lcd_cursor(x, y);
102 1 lcd_string(attr,string);
103 1 }
104
105 /*-----------------------------------------
106 功能: 在指定的位置显示16进制数
107 显示范围 00--FF
108 -----------------------------------------*/
109 /*void DisplayHex(uchar x, uchar y,uchar num)
110 {
111 uchar str[3];
112 uchar tem;
113 str[2]='\0';
114
115 tem=num%16;
116 num/=16;
117 if(tem<10)
C51 COMPILER V8.02 LCM 09/09/2006 18:05:50 PAGE 3
118 str[1] = tem+0x30;
119 else
120 str[1] = tem+0x30+7;
121
122 if(num<10)
123 str[0] = num+0x30;
124 else
125 str[0] = num+0x30+7;
126
127 DisplayStr(0,x,y,str);
128 } */
129 /* 在指定位置显示10进制数 00-99 num为不大于99的数*/
130 /*void DisplayShi(uchar x,uchar y,uchar num)
131 {
132 uchar str[3];
133 uchar tem;
134 str[2]='\0';
135 tem=num%10;
136 num/=10;
137 str[1] = tem+0x30;
138 str[0] = num+0x30;
139 DisplayStr(0,x,y,str);
140 }*/
141
142 /*-----------------------------------------
143 功能: 在指定的位置显示浮点数
144 显示范围 00.00--99.99
145 -----------------------------------------*/
146 /*void DisplayFloat(uchar x, uchar y,float num)
147 {
148 uchar str[6];
149 uchar tem,tem2,tem3,tem4;
150 str[5]='\0';
151
152 tem=num/10;
153 num=num-tem*10;
154 tem2=num;
155 num=num-tem2;
156 tem3=num*10;
157 num=num-tem3*0.1;
158 tem4=num*100;
159
160
161 str[0] = tem+0x30;
162 str[1] = tem2+0x30;
163 str[2] = 0x2e;//.
164 str[3] = tem3+0x30;
165 str[4] = tem4+0x30;
166
167 DisplayStr(0,x,y,str);
168 } */
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 134 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 17
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILER V8.02 LCM 09/09/2006 18:05:50 PAGE 4
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -