📄 cepark-avr
字号:
1a6: dc 9a sbi 0x1b, 4 ; 27
1a8: dd 98 cbi 0x1b, 5 ; 27
1aa: 68 bb out 0x18, r22 ; 24
}
CLR_A0; //
1ac: dc 98 cbi 0x1b, 4 ; 27
SET_RW; //
1ae: dd 9a sbi 0x1b, 5 ; 27
1b0: 08 95 ret
000001b2 <clear_lcd>:
}
//清屏
void clear_lcd(void)
{
1b2: 0f 93 push r16
1b4: 1f 93 push r17
1b6: 08 eb ldi r16, 0xB8 ; 184
unsigned char a,b,c;
for(a = 0xb8;a < 0xbc;a++) //清屏0-3页,指令分别是b8,b9,ba,bb(X地址)
{
b = 0; //
WriteCommand(0x01,a); //左,第0页开始
1b8: 60 2f mov r22, r16
1ba: 81 e0 ldi r24, 0x01 ; 1
1bc: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x02,a); //右,第0页开始
1c0: 60 2f mov r22, r16
1c2: 82 e0 ldi r24, 0x02 ; 2
1c4: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x02,b); //右,第0行开始(Y地址)
1c8: 60 e0 ldi r22, 0x00 ; 0
1ca: 82 e0 ldi r24, 0x02 ; 2
1cc: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x01,b); // 左,第0行开始
1d0: 60 e0 ldi r22, 0x00 ; 0
1d2: 81 e0 ldi r24, 0x01 ; 1
1d4: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
1d8: 10 e0 ldi r17, 0x00 ; 0
for(c = 0;c < 61;c++) //总共122列,左右各61列
{
WriteData(0x01,0x00); //左,每列均填充0
1da: 60 e0 ldi r22, 0x00 ; 0
1dc: 81 e0 ldi r24, 0x01 ; 1
1de: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
WriteData(0x02,0x00); //右,每列均填充0
1e2: 60 e0 ldi r22, 0x00 ; 0
1e4: 82 e0 ldi r24, 0x02 ; 2
1e6: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
1ea: 1f 5f subi r17, 0xFF ; 255
1ec: 1d 33 cpi r17, 0x3D ; 61
1ee: a9 f7 brne .-22 ; 0x1da <clear_lcd+0x28>
1f0: 0f 5f subi r16, 0xFF ; 255
1f2: 0c 3b cpi r16, 0xBC ; 188
1f4: 09 f7 brne .-62 ; 0x1b8 <clear_lcd+0x6>
1f6: 1f 91 pop r17
1f8: 0f 91 pop r16
1fa: 08 95 ret
000001fc <tex_Write>:
}
}
}
//写字符
void tex_Write(unsigned char *pt)
{
1fc: ef 92 push r14
1fe: ff 92 push r15
200: 0f 93 push r16
202: 1f 93 push r17
204: cf 93 push r28
206: df 93 push r29
208: 7c 01 movw r14, r24
unsigned char a,b;
if(SEL_E1) //左选中?
20a: 80 91 a8 03 lds r24, 0x03A8
20e: 88 23 and r24, r24
210: 41 f1 breq .+80 ; 0x262 <tex_Write+0x66>
{
WriteCommand(0x01,0xb8); //页设置,第0页(X地址)
212: 68 eb ldi r22, 0xB8 ; 184
214: 81 e0 ldi r24, 0x01 ; 1
216: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x01,Add1); //第0行开始(Y)地址
21a: 60 91 aa 03 lds r22, 0x03AA
21e: 81 e0 ldi r24, 0x01 ; 1
220: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
224: e7 01 movw r28, r14
226: 18 e0 ldi r17, 0x08 ; 8
for(a = 8;a < 16;a++) //
{
WriteData(0x01,*(pt + a)); //上半部分8-16,总高度16,
228: 68 85 ldd r22, Y+8 ; 0x08
22a: 81 e0 ldi r24, 0x01 ; 1
22c: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
230: 1f 5f subi r17, 0xFF ; 255
232: 21 96 adiw r28, 0x01 ; 1
234: 10 31 cpi r17, 0x10 ; 16
236: c1 f7 brne .-16 ; 0x228 <tex_Write+0x2c>
}
WriteCommand(0x01,0xb9); //第一页
238: 69 eb ldi r22, 0xB9 ; 185
23a: 81 e0 ldi r24, 0x01 ; 1
23c: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x01,Add1); //
240: 60 91 aa 03 lds r22, 0x03AA
244: 81 e0 ldi r24, 0x01 ; 1
246: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
24a: e7 01 movw r28, r14
24c: 87 01 movw r16, r14
24e: 08 5f subi r16, 0xF8 ; 248
250: 1f 4f sbci r17, 0xFF ; 255
for(b = 0;b < 8;b++) //
{
WriteData(0x01,*(pt + b)); //下半部分
252: 69 91 ld r22, Y+
254: 81 e0 ldi r24, 0x01 ; 1
256: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
25a: c0 17 cp r28, r16
25c: d1 07 cpc r29, r17
25e: 41 f1 breq .+80 ; 0x2b0 <tex_Write+0xb4>
260: f8 cf rjmp .-16 ; 0x252 <tex_Write+0x56>
}
}
else if(SEL_E1 == 0) //若为0,写右半边
{
WriteCommand(0x02,0xb8); //
262: 68 eb ldi r22, 0xB8 ; 184
264: 82 e0 ldi r24, 0x02 ; 2
266: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x02,Add1); //
26a: 60 91 aa 03 lds r22, 0x03AA
26e: 82 e0 ldi r24, 0x02 ; 2
270: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
274: e7 01 movw r28, r14
276: 18 e0 ldi r17, 0x08 ; 8
for(a = 8;a < 16;a++) //
{
WriteData(0x02,*(pt + a)); //
278: 68 85 ldd r22, Y+8 ; 0x08
27a: 82 e0 ldi r24, 0x02 ; 2
27c: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
280: 1f 5f subi r17, 0xFF ; 255
282: 21 96 adiw r28, 0x01 ; 1
284: 10 31 cpi r17, 0x10 ; 16
286: c1 f7 brne .-16 ; 0x278 <tex_Write+0x7c>
}
WriteCommand(0x02,0xb9); //
288: 69 eb ldi r22, 0xB9 ; 185
28a: 82 e0 ldi r24, 0x02 ; 2
28c: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x02,Add1); //
290: 60 91 aa 03 lds r22, 0x03AA
294: 82 e0 ldi r24, 0x02 ; 2
296: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
29a: e7 01 movw r28, r14
29c: 87 01 movw r16, r14
29e: 08 5f subi r16, 0xF8 ; 248
2a0: 1f 4f sbci r17, 0xFF ; 255
for(b = 0;b < 8;b++) //
{
WriteData(0x02,*(pt + b)); //
2a2: 69 91 ld r22, Y+
2a4: 82 e0 ldi r24, 0x02 ; 2
2a6: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
2aa: c0 17 cp r28, r16
2ac: d1 07 cpc r29, r17
2ae: c9 f7 brne .-14 ; 0x2a2 <tex_Write+0xa6>
}
}
if((Add1 + 8) < 61)
2b0: 20 91 aa 03 lds r18, 0x03AA
2b4: 82 2f mov r24, r18
2b6: 99 27 eor r25, r25
2b8: c5 97 sbiw r24, 0x35 ; 53
2ba: 24 f4 brge .+8 ; 0x2c4 <tex_Write+0xc8>
Add1 += 8; //如果不超过61列列地址+8
2bc: 28 5f subi r18, 0xF8 ; 248
2be: 20 93 aa 03 sts 0x03AA, r18
2c2: 2f c0 rjmp .+94 ; 0x322 <tex_Write+0x126>
else //
{
Add1 = 0; //超过61列,则列地址置0,写右半边
2c4: 10 92 aa 03 sts 0x03AA, r1
WriteCommand(0x02,0xb8); //
2c8: 68 eb ldi r22, 0xB8 ; 184
2ca: 82 e0 ldi r24, 0x02 ; 2
2cc: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x02,Add1); //
2d0: 60 91 aa 03 lds r22, 0x03AA
2d4: 82 e0 ldi r24, 0x02 ; 2
2d6: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
2da: e7 01 movw r28, r14
2dc: 1c e0 ldi r17, 0x0C ; 12
for(a = 12;a < 16;a++) //一个字符占8列,所以在61列之后还要写4列
WriteData(0x02,*(pt + a)); //
2de: 6c 85 ldd r22, Y+12 ; 0x0c
2e0: 82 e0 ldi r24, 0x02 ; 2
2e2: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
2e6: 1f 5f subi r17, 0xFF ; 255
2e8: 21 96 adiw r28, 0x01 ; 1
2ea: 10 31 cpi r17, 0x10 ; 16
2ec: c1 f7 brne .-16 ; 0x2de <tex_Write+0xe2>
WriteCommand(0x02,0xb9); //
2ee: 69 eb ldi r22, 0xB9 ; 185
2f0: 82 e0 ldi r24, 0x02 ; 2
2f2: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x02,Add1); //
2f6: 60 91 aa 03 lds r22, 0x03AA
2fa: 82 e0 ldi r24, 0x02 ; 2
2fc: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
300: e7 01 movw r28, r14
302: 14 e0 ldi r17, 0x04 ; 4
for(b = 4;b < 8;b++) //
WriteData(0x02,*(pt + b)); //
304: 6c 81 ldd r22, Y+4 ; 0x04
306: 82 e0 ldi r24, 0x02 ; 2
308: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
30c: 1f 5f subi r17, 0xFF ; 255
30e: 21 96 adiw r28, 0x01 ; 1
310: 18 30 cpi r17, 0x08 ; 8
312: c1 f7 brne .-16 ; 0x304 <tex_Write+0x108>
Add1 += 4; //
314: 80 91 aa 03 lds r24, 0x03AA
318: 8c 5f subi r24, 0xFC ; 252
31a: 80 93 aa 03 sts 0x03AA, r24
SEL_E1 = 0; //
31e: 10 92 a8 03 sts 0x03A8, r1
322: df 91 pop r29
324: cf 91 pop r28
326: 1f 91 pop r17
328: 0f 91 pop r16
32a: ff 90 pop r15
32c: ef 90 pop r14
32e: 08 95 ret
00000330 <WriteCharacter>:
}
}
// 写汉字
void WriteCharacter(unsigned char *pt)
{
330: ef 92 push r14
332: ff 92 push r15
334: 0f 93 push r16
336: 1f 93 push r17
338: cf 93 push r28
33a: df 93 push r29
33c: 7c 01 movw r14, r24
unsigned char a,b;
if(SEL_E2) //
33e: 80 91 a9 03 lds r24, 0x03A9
342: 88 23 and r24, r24
344: 41 f1 breq .+80 ; 0x396 <WriteCharacter+0x66>
{
WriteCommand(0x01,0xba); //
346: 6a eb ldi r22, 0xBA ; 186
348: 81 e0 ldi r24, 0x01 ; 1
34a: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x01,Add2); //
34e: 60 91 ab 03 lds r22, 0x03AB
352: 81 e0 ldi r24, 0x01 ; 1
354: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
358: e7 01 movw r28, r14
35a: 10 e1 ldi r17, 0x10 ; 16
for(a=16;a<32;a++) //
{
WriteData(0x01,*(pt+a)); //
35c: 68 89 ldd r22, Y+16 ; 0x10
35e: 81 e0 ldi r24, 0x01 ; 1
360: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
364: 1f 5f subi r17, 0xFF ; 255
366: 21 96 adiw r28, 0x01 ; 1
368: 10 32 cpi r17, 0x20 ; 32
36a: c1 f7 brne .-16 ; 0x35c <WriteCharacter+0x2c>
}
WriteCommand(0x01,0xbb); //
36c: 6b eb ldi r22, 0xBB ; 187
36e: 81 e0 ldi r24, 0x01 ; 1
370: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
WriteCommand(0x01,Add2); //
374: 60 91 ab 03 lds r22, 0x03AB
378: 81 e0 ldi r24, 0x01 ; 1
37a: 0e 94 92 00 call 0x124 ; 0x124 <WriteCommand>
37e: e7 01 movw r28, r14
380: 87 01 movw r16, r14
382: 00 5f subi r16, 0xF0 ; 240
384: 1f 4f sbci r17, 0xFF ; 255
for(b=0;b<16;b++) //
{
WriteData(0x01,*(pt+b)); //
386: 69 91 ld r22, Y+
388: 81 e0 ldi r24, 0x01 ; 1
38a: 0e 94 c2 00 call 0x184 ; 0x184 <WriteData>
38e: c0 17 cp r28, r16
390: d1 07 cpc r29, r17
392: 41 f1 breq .+80 ; 0x3e4 <WriteCharacter+0xb4>
394: f8 cf rjmp .-16 ; 0x386 <WriteCharacter+0x56>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -