📄 12232.lst
字号:
C51 COMPILER V7.50 12232 10/21/2007 15:38:56 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE 12232
OBJECT MODULE PLACED IN 12232.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 12232.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include <reg51.h>
2 //功能引脚定义
3 sbit A0 = P1^3; //数据1/命令0选择
4 sbit _WR = P1^2; //读1/写0
5 sbit E1 = P1^1; //片选1(Master)
6 sbit E2 = P1^0; //片选2(slave)
7 //sbit RST = P1^5;
8 #define lcd_data P2 //数据
9
10 //常用操作宏定义
11 #define set_E1() (E1=1) //1片选M
12 #define set_E2() (E2=1) //1片选S
13 #define set_A0() (A0=1) //1数据
14 #define set_WR() (_WR=1) //1读
15
16 #define clr_E1() (E1=0) //0
17 #define clr_E2() (E2=0) //0
18 #define clr_A0() (A0=0) //0命令
19 #define clr_WR() (_WR=0) //0写
20
21 //液晶显示控制命令表
22 #define disp_off 0xAE //显示关闭
23 #define disp_on 0xAF //显示打开
24 #define disp_start_line 0xC0 //显示起始地址(后5位-表示0-31行)
25 #define page_addr_set 0xB8 //页地址设置(0~3)
26 #define col_addr_set 0x00 //列地址设置(0~61)
27 #define status_busy 0x80 //0=ready
28 #define mode_write 0xEE //写模式
29 #define dynamic_driver 0xA4 //动态驱动
30 #define adc_select 0xA0 //clockwise
31 #define clk32 0xA9 //刷新时钟设置1/32
32 #define clk16 0xA8 //刷新时钟设置1/16
33 #define reset 0xE2 //软件复位
34 ////新的驱动着重在简化代码,这样外部可调用的函数为:系统初始化,清屏,判忙标志////
35 ////ASCII和汉字混合输出函数,RAM buffer数据显示输出(一般用于输出数字)//////////
36 #include <reg51.h>
37 #include <intrins.h>
38 #define uchar unsigned char
39 #define uint unsigned int
40 #define NOP() _nop_();
41
42 uchar dot_buffer[32]; //点阵缓存区
43 uchar disp_buffer[10]={2,0,0,7,1,0,2,1,};
44 //ram数据显示缓存区
45
46 void lcd_init(void); //LCD初始化
47 void lcd_clr(void); //LCD清屏
48 void wait_ready(void); //等待ready
49 void draw_bmp(uchar col,uchar layer,uchar width,uchar *bmp);
50 //点阵码显示输出
51 void disp_one_ascii(uchar col,uchar layer,uchar ascii_code,uchar mode);
52 //单个ascci码输出(ascii_code为ascii编码)
53 void disp_ram_data(uchar col,uchar layer,uchar n,uchar mode);
54 //ram数据(数字)显示输出
55 void dprintf(uchar col,uchar layer,uchar *buf,uchar mode);
C51 COMPILER V7.50 12232 10/21/2007 15:38:56 PAGE 2
56 //通用混合字串显示
57 typedef struct data_gb16 //汉字字模数据结构
58 {
59 uchar index[12];
60 uchar zimo[32];
61 };
62 struct data_gb16 code hz16[] =
63 {
64 "延",
65 0x00,0x84,0xC4,0xA4,0x94,0x8C,0x00,0xE4,
66 0x04,0x04,0xFC,0x42,0x63,0x42,0x00,0x00,
67 0x80,0x44,0x28,0x10,0x2C,0x43,0x40,0x4F,
68 0x48,0x48,0x4F,0x48,0x4C,0x68,0x20,0x00,
69 "时",
70 0x00,0xFC,0x84,0x84,0x84,0xFE,0x14,0x10,
71 0x90,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
72 0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,
73 0x00,0x23,0x40,0x80,0x7F,0x00,0x00,0x00,
74 "中",
75 0x00,0x00,0xFC,0x08,0x08,0x08,0x08,0xFF,
76 0x08,0x08,0x08,0x08,0xFC,0x08,0x00,0x00,
77 0x00,0x00,0x07,0x02,0x02,0x02,0x02,0xFF,
78 0x02,0x02,0x02,0x02,0x07,0x00,0x00,0x00,
79 "北",
80 0x00,0x20,0x20,0x20,0x20,0xFF,0x00,0x00,
81 0x00,0xFF,0x40,0x20,0x30,0x18,0x10,0x00,
82 0x10,0x30,0x18,0x08,0x04,0x7F,0x00,0x00,
83 0x00,0x3F,0x40,0x40,0x40,0x40,0x78,0x00,
84 "大",
85 0x20,0x20,0x20,0x20,0x20,0x20,0xA0,0x7F,
86 0xA0,0x20,0x20,0x20,0x20,0x20,0x20,0x00,
87 0x00,0x80,0x40,0x20,0x10,0x0C,0x03,0x00,
88 0x01,0x06,0x08,0x30,0x60,0xC0,0x40,0x00,
89 "学",
90 0x40,0x30,0x10,0x12,0x5C,0x54,0x50,0x51,
91 0x5E,0xD4,0x50,0x18,0x57,0x32,0x10,0x00,
92 0x00,0x02,0x02,0x02,0x02,0x02,0x42,0x82,
93 0x7F,0x02,0x02,0x02,0x02,0x02,0x02,0x00,
94 "沈",
95 0x10,0x22,0x64,0x0C,0xA0,0x18,0x08,0x88,
96 0x7F,0xC8,0x08,0x08,0x28,0x18,0x00,0x00,
97 0x04,0x04,0xFE,0x81,0x40,0x20,0x18,0x07,
98 0x00,0x3F,0x40,0x40,0x40,0x40,0x70,0x00,
99 "阳",
100 0x00,0xFE,0x02,0x22,0x5A,0x86,0x00,0xFE,
101 0x42,0x42,0x42,0x42,0x42,0xFE,0x00,0x00,
102 0x00,0xFF,0x04,0x08,0x04,0x03,0x00,0x3F,
103 0x10,0x10,0x10,0x10,0x10,0x3F,0x00,0x00,
104 "测",
105 0x08,0x31,0x86,0x60,0x00,0xFE,0x02,0xF2,
106 0x02,0xFE,0x00,0xF8,0x00,0x00,0xFF,0x00,
107 0x04,0xFC,0x03,0x00,0x80,0x47,0x30,0x0F,
108 0x10,0x67,0x00,0x07,0x40,0x80,0x7F,0x00,
109 "试",
110 0x40,0x42,0xDC,0x08,0x00,0x90,0x90,0x90,
111 0x90,0x90,0xFF,0x10,0x12,0x1C,0x10,0x00,
112 0x00,0x00,0x7F,0x20,0x10,0x20,0x20,0x1F,
113 0x10,0x10,0x01,0x06,0x18,0x20,0x78,0x00,
114 "我",
115 0x20,0x20,0x22,0x22,0xFE,0x21,0x21,0x20,
116 0x20,0xFF,0x20,0x22,0xAC,0x20,0x20,0x00,
117 0x04,0x04,0x42,0x82,0x7F,0x01,0x01,0x10,
C51 COMPILER V7.50 12232 10/21/2007 15:38:56 PAGE 3
118 0x10,0x08,0x07,0x1A,0x21,0x40,0xF0,0x00,
119 "成",
120 0x00,0x00,0xF8,0x48,0x48,0x48,0xC8,0x08,
121 0xFF,0x08,0x09,0x0A,0xC8,0x88,0x08,0x00,
122 0x40,0x30,0x0F,0x00,0x08,0x50,0x4F,0x20,
123 0x10,0x0B,0x0C,0x12,0x21,0x40,0xF0,0x00,
124 "功",
125 0x00,0x04,0x04,0x04,0xFC,0x04,0x14,0x14,
126 0x10,0x90,0x7F,0x10,0x10,0xF0,0x00,0x00,
127 0x04,0x0C,0x04,0x04,0x03,0x42,0x22,0x11,
128 0x0C,0x23,0x20,0x60,0x20,0x1F,0x00,0x00,
129 "您",
130 0x80,0x40,0xF0,0x2C,0x43,0x20,0x98,0x0F,
131 0x0A,0xE8,0x08,0x88,0x28,0x1C,0x08,0x00,
132 0x00,0x00,0x7F,0x00,0x10,0x0C,0x03,0x21,
133 0x40,0x3F,0x00,0x00,0x03,0x1C,0x08,0x00
134 };
135
136 uchar code ascii[] = {
137 //前面0x20(32个)ASCII码为控制命令
138 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
139 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
140 0x00,0x00,0x38,0xFC,0xFC,0x38,0x00,0x00,//!
141 0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,
142 0x00,0x0E,0x1E,0x00,0x00,0x1E,0x0E,0x00,//"
143 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
144 0x20,0xF8,0xF8,0x20,0xF8,0xF8,0x20,0x00,//#
145 0x02,0x0F,0x0F,0x02,0x0F,0x0F,0x02,0x00,
146 0x38,0x7C,0x44,0x47,0x47,0xCC,0x98,0x00,//$
147 0x03,0x06,0x04,0x1C,0x1C,0x07,0x03,0x00,
148 0x30,0x30,0x00,0x80,0xC0,0x60,0x30,0x00,//%
149 0x0C,0x06,0x03,0x01,0x00,0x0C,0x0C,0x00,
150 0x80,0xD8,0x7C,0xE4,0xBC,0xD8,0x40,0x00,//&
151 0x07,0x0F,0x08,0x08,0x07,0x0F,0x08,0x00,
152 0x00,0x10,0x1E,0x0E,0x00,0x00,0x00,0x00,//'
153 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
154 0x00,0x00,0xF0,0xF8,0x0C,0x04,0x00,0x00,//(
155 0x00,0x00,0x03,0x07,0x0C,0x08,0x00,0x00,
156 0x00,0x00,0x04,0x0C,0xF8,0xF0,0x00,0x00,//)
157 0x00,0x00,0x08,0x0C,0x07,0x03,0x00,0x00,
158 0x80,0xA0,0xE0,0xC0,0xC0,0xE0,0xA0,0x80,//*
159 0x00,0x02,0x03,0x01,0x01,0x03,0x02,0x00,
160 0x00,0x80,0x80,0xE0,0xE0,0x80,0x80,0x00,//+
161 0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x00,
162 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//,
163 0x00,0x00,0x10,0x1E,0x0E,0x00,0x00,0x00,
164 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,//-
165 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
166 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//.
167 0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x00,
168 0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x00,///
169 0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,
170 0xF8,0xFC,0x04,0xC4,0x24,0xFC,0xF8,0x00,//0
171 0x07,0x0F,0x09,0x08,0x08,0x0F,0x07,0x00,
172 0x00,0x10,0x18,0xFC,0xFC,0x00,0x00,0x00,//1
173 0x00,0x08,0x08,0x0F,0x0F,0x08,0x08,0x00,
174 0x08,0x0C,0x84,0xC4,0x64,0x3C,0x18,0x00,//2
175 0x0E,0x0F,0x09,0x08,0x08,0x0C,0x0C,0x00,
176 0x08,0x0C,0x44,0x44,0x44,0xFC,0xB8,0x00,//3
177 0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,
178 0xC0,0xE0,0xB0,0x98,0xFC,0xFC,0x80,0x00,//4
179 0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,
C51 COMPILER V7.50 12232 10/21/2007 15:38:56 PAGE 4
180 0x7C,0x7C,0x44,0x44,0xC4,0xC4,0x84,0x00,//5
181 0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,
182 0xF0,0xF8,0x4C,0x44,0x44,0xC0,0x80,0x00,//6
183 0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
184 0x0C,0x0C,0x04,0x84,0xC4,0x7C,0x3C,0x00,//7
185 0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,
186 0xB8,0xFC,0x44,0x44,0x44,0xFC,0xB8,0x00,//8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -