📄 main.lss
字号:
//***************************************************************************//
//程序:LCD501_Init(unsigned int InitialData)
//描述:液晶显示初始化函数 C语言调用
//参数:unsigned int InitialData 初始化显示的字
// 声明: 手心 20070117 AVRGCC
//***************************************************************************//
void LCD501_Init(unsigned int InitialData)
{
19a: af 92 push r10
19c: bf 92 push r11
19e: cf 92 push r12
1a0: df 92 push r13
1a2: ef 92 push r14
1a4: ff 92 push r15
1a6: 0f 93 push r16
1a8: 1f 93 push r17
1aa: cf 93 push r28
1ac: df 93 push r29
1ae: 5c 01 movw r10, r24
unsigned int i,j;
F_SPLC501_Initial_IO(); //Initial LCD IO
1b0: 0e 94 a0 00 call 0x140 <F_SPLC501_Initial_IO>
F_SPLC501_Write_Com(M_LCD_ON); //LCD On
1b4: 8f ea ldi r24, 0xAF ; 175
1b6: 90 e0 ldi r25, 0x00 ; 0
1b8: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_POWER_ALL); //设置上电控制模式
1bc: 8f e2 ldi r24, 0x2F ; 47
1be: 90 e0 ldi r25, 0x00 ; 0
1c0: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_ELE_VOL); //电量设置模式(显示亮度)
1c4: 81 e8 ldi r24, 0x81 ; 129
1c6: 90 e0 ldi r25, 0x00 ; 0
1c8: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(0x12); //指令数据0x00~0x3f
1cc: 82 e1 ldi r24, 0x12 ; 18
1ce: 90 e0 ldi r25, 0x00 ; 0
1d0: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_VDD_SET); //V5内部电压调节电阻设置
1d4: 85 e2 ldi r24, 0x25 ; 37
1d6: 90 e0 ldi r25, 0x00 ; 0
1d8: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_VDD); //LCD偏压设置,V3时选
1dc: 82 ea ldi r24, 0xA2 ; 162
1de: 90 e0 ldi r25, 0x00 ; 0
1e0: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_COM_NOR); //Com 扫描方式设置
1e4: 80 ec ldi r24, 0xC0 ; 192
1e6: 90 e0 ldi r25, 0x00 ; 0
1e8: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_SEG_REV); //Segment方向选择
1ec: 81 ea ldi r24, 0xA1 ; 161
1ee: 90 e0 ldi r25, 0x00 ; 0
1f0: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_ALL_LOW); //全屏点亮/变暗指令
1f4: 84 ea ldi r24, 0xA4 ; 164
1f6: 90 e0 ldi r25, 0x00 ; 0
1f8: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_ALL_NOR); //正向反向显示控制指令
1fc: 86 ea ldi r24, 0xA6 ; 166
1fe: 90 e0 ldi r25, 0x00 ; 0
200: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_STATIC_OFF); //关闭静态指示器
204: 8c ea ldi r24, 0xAC ; 172
206: 90 e0 ldi r25, 0x00 ; 0
208: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(0x00); //指令数据
20c: 80 e0 ldi r24, 0x00 ; 0
20e: 90 e0 ldi r25, 0x00 ; 0
210: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_BEGIN_LINE+0); //设置显示起始行对应RAM
214: 80 e4 ldi r24, 0x40 ; 64
216: 90 e0 ldi r25, 0x00 ; 0
218: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
for(i=0;i<8;i++) //往LCD中填充初始化的显示数据
21c: c0 e0 ldi r28, 0x00 ; 0
21e: d0 e0 ldi r29, 0x00 ; 0
{
F_SPLC501_Write_Com(M_LCD_COL_PAGE+i);
220: ce 01 movw r24, r28
222: 80 55 subi r24, 0x50 ; 80
224: 9f 4f sbci r25, 0xFF ; 255
226: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_COL_LINE_LOW);
22a: 84 e0 ldi r24, 0x04 ; 4
22c: 90 e0 ldi r25, 0x00 ; 0
22e: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_COL_LINE_HIG);
232: 80 e1 ldi r24, 0x10 ; 16
234: 90 e0 ldi r25, 0x00 ; 0
236: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
for(j=0;j<128;j++)
23a: ee 24 eor r14, r14
23c: ff 24 eor r15, r15
23e: 0b e2 ldi r16, 0x2B ; 43
240: 11 e0 ldi r17, 0x01 ; 1
242: 30 e5 ldi r19, 0x50 ; 80
244: c3 2e mov r12, r19
246: 3f ef ldi r19, 0xFF ; 255
248: d3 2e mov r13, r19
24a: c0 0e add r12, r16
24c: d1 1e adc r13, r17
{
switch(i)
24e: c2 30 cpi r28, 0x02 ; 2
250: d1 05 cpc r29, r1
252: 81 f0 breq .+32 ; 0x274 <LCD501_Init+0xda>
254: c3 30 cpi r28, 0x03 ; 3
256: d1 05 cpc r29, r1
258: 20 f4 brcc .+8 ; 0x262 <LCD501_Init+0xc8>
25a: c1 30 cpi r28, 0x01 ; 1
25c: d1 05 cpc r29, r1
25e: 41 f0 breq .+16 ; 0x270 <LCD501_Init+0xd6>
260: 1d c0 rjmp .+58 ; 0x29c <LCD501_Init+0x102>
262: c4 30 cpi r28, 0x04 ; 4
264: d1 05 cpc r29, r1
266: 41 f0 breq .+16 ; 0x278 <LCD501_Init+0xde>
268: c5 30 cpi r28, 0x05 ; 5
26a: d1 05 cpc r29, r1
26c: 69 f0 breq .+26 ; 0x288 <LCD501_Init+0xee>
26e: 16 c0 rjmp .+44 ; 0x29c <LCD501_Init+0x102>
{
case 1:
F_SPLC501_Write_Data(Welcome_word[j]);//Welcome_word
270: f6 01 movw r30, r12
272: 07 c0 rjmp .+14 ; 0x282 <LCD501_Init+0xe8>
break;
case 2:
F_SPLC501_Write_Data((Welcome_word[j]>>8));//Welcome_word
274: f6 01 movw r30, r12
276: 0d c0 rjmp .+26 ; 0x292 <LCD501_Init+0xf8>
break;
case 4:
if(j>=40 && j<88)
278: c7 01 movw r24, r14
27a: 88 97 sbiw r24, 0x28 ; 40
27c: c0 97 sbiw r24, 0x30 ; 48
27e: 70 f4 brcc .+28 ; 0x29c <LCD501_Init+0x102>
F_SPLC501_Write_Data(Welcome_word[128+j-40]);//Welcome_word
280: f8 01 movw r30, r16
282: 80 81 ld r24, Z
284: 91 81 ldd r25, Z+1 ; 0x01
286: 0b c0 rjmp .+22 ; 0x29e <LCD501_Init+0x104>
else
F_SPLC501_Write_Data(InitialData);
break;
case 5:
if(j>=40 && j<88)
288: c7 01 movw r24, r14
28a: 88 97 sbiw r24, 0x28 ; 40
28c: c0 97 sbiw r24, 0x30 ; 48
28e: 30 f4 brcc .+12 ; 0x29c <LCD501_Init+0x102>
F_SPLC501_Write_Data((Welcome_word[128+j-40]>>8));//Welcome_word
290: f8 01 movw r30, r16
292: 80 81 ld r24, Z
294: 91 81 ldd r25, Z+1 ; 0x01
296: 89 2f mov r24, r25
298: 99 27 eor r25, r25
29a: 01 c0 rjmp .+2 ; 0x29e <LCD501_Init+0x104>
else
F_SPLC501_Write_Data(InitialData);
break;
default:
F_SPLC501_Write_Data(InitialData);
29c: c5 01 movw r24, r10
29e: 0e 94 ae 00 call 0x15c <F_SPLC501_Write_Data>
2a2: 08 94 sec
2a4: e1 1c adc r14, r1
2a6: f1 1c adc r15, r1
2a8: 82 e0 ldi r24, 0x02 ; 2
2aa: 90 e0 ldi r25, 0x00 ; 0
2ac: c8 0e add r12, r24
2ae: d9 1e adc r13, r25
2b0: 08 0f add r16, r24
2b2: 19 1f adc r17, r25
2b4: 90 e8 ldi r25, 0x80 ; 128
2b6: e9 16 cp r14, r25
2b8: f1 04 cpc r15, r1
2ba: 48 f2 brcs .-110 ; 0x24e <LCD501_Init+0xb4>
2bc: 21 96 adiw r28, 0x01 ; 1
2be: c8 30 cpi r28, 0x08 ; 8
2c0: d1 05 cpc r29, r1
2c2: 08 f4 brcc .+2 ; 0x2c6 <LCD501_Init+0x12c>
2c4: ad cf rjmp .-166 ; 0x220 <LCD501_Init+0x86>
break;
}
}
}
F_SPLC501_Write_Com(0xee);
2c6: 8e ee ldi r24, 0xEE ; 238
2c8: 90 e0 ldi r25, 0x00 ; 0
2ca: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
CurPaintMode = 0;
2ce: 10 92 bd 05 sts 0x05BD, r1
2d2: 10 92 bc 05 sts 0x05BC, r1
CurPowerMode = 1; //now is normal mode
2d6: 21 e0 ldi r18, 0x01 ; 1
2d8: 30 e0 ldi r19, 0x00 ; 0
2da: 30 93 c1 05 sts 0x05C1, r19
2de: 20 93 c0 05 sts 0x05C0, r18
CurLCDSet = 8;
2e2: 88 e0 ldi r24, 0x08 ; 8
2e4: 90 e0 ldi r25, 0x00 ; 0
2e6: 90 93 c3 05 sts 0x05C3, r25
2ea: 80 93 c2 05 sts 0x05C2, r24
CurScroll = 0;
2ee: 10 92 c5 05 sts 0x05C5, r1
2f2: 10 92 c4 05 sts 0x05C4, r1
CurScrMode = 1;
2f6: 30 93 bf 05 sts 0x05BF, r19
2fa: 20 93 be 05 sts 0x05BE, r18
CurASCIIFont = 1;
2fe: 30 93 c7 05 sts 0x05C7, r19
302: 20 93 c6 05 sts 0x05C6, r18
306: df 91 pop r29
308: cf 91 pop r28
30a: 1f 91 pop r17
30c: 0f 91 pop r16
30e: ff 90 pop r15
310: ef 90 pop r14
312: df 90 pop r13
314: cf 90 pop r12
316: bf 90 pop r11
318: af 90 pop r10
31a: 08 95 ret
0000031c <LCD501_Power>:
}
//======================================================
// 程序: void LCD501_Power(unsigned int ModeCode)
// 描述: SPLC501电源管理,进入参数指定的模式,而当LCD在SLEEP和STDBY模式下时,
// 调用该函数会使LCD唤醒
// 参数: ModeCode - 可以是下列参数之一:
// 1 PWR_ON: 正常工作模式
// 2 PWR_SLEEP: 睡眠模式,屏幕不显示,但内容在唤醒后仍保留
// 3 PWR_STDBY: 待机模式,比SLEEP省电,但显示内容会丢失
// 0 PWR_OFF: 关闭电源
// 声明: 手心 20070117 AVRGCC
//======================================================
void LCD501_Power(unsigned int ModeCode)
{
31c: cf 93 push r28
31e: df 93 push r29
320: ec 01 movw r28, r24
if(CurPowerMode == PWR_SLEEP)
322: 80 91 c0 05 lds r24, 0x05C0
326: 90 91 c1 05 lds r25, 0x05C1
32a: 82 30 cpi r24, 0x02 ; 2
32c: 91 05 cpc r25, r1
32e: 59 f4 brne .+22 ; 0x346 <LCD501_Power+0x2a>
{
F_SPLC501_Write_Com(M_LCD_ALL_LOW);
330: 84 ea ldi r24, 0xA4 ; 164
332: 90 e0 ldi r25, 0x00 ; 0
334: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_STATIC_ON);
338: 8d ea ldi r24, 0xAD ; 173
33a: 90 e0 ldi r25, 0x00 ; 0
33c: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(0x0003);
340: 83 e0 ldi r24, 0x03 ; 3
342: 90 e0 ldi r25, 0x00 ; 0
344: 08 c0 rjmp .+16 ; 0x356 <LCD501_Power+0x3a>
CurPowerMode = 1;
}
else if(CurPowerMode == PWR_STDBY)
346: 03 97 sbiw r24, 0x03 ; 3
348: 79 f4 brne .+30 ; 0x368 <LCD501_Power+0x4c>
{
F_SPLC501_Write_Com(M_LCD_ON);
34a: 8f ea ldi r24, 0xAF ; 175
34c: 90 e0 ldi r25, 0x00 ; 0
34e: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_ALL_LOW);
352: 84 ea ldi r24, 0xA4 ; 164
354: 90 e0 ldi r25, 0x00 ; 0
356: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
CurPowerMode = 1;
35a: 81 e0 ldi r24, 0x01 ; 1
35c: 90 e0 ldi r25, 0x00 ; 0
35e: 90 93 c1 05 sts 0x05C1, r25
362: 80 93 c0 05 sts 0x05C0, r24
366: 2e c0 rjmp .+92 ; 0x3c4 <LCD501_Power+0xa8>
}
else{
switch(ModeCode)
368: c2 30 cpi r28, 0x02 ; 2
36a: d1 05 cpc r29, r1
36c: 71 f0 breq .+28 ; 0x38a <LCD501_Power+0x6e>
36e: c3 30 cpi r28, 0x03 ; 3
370: d1 05 cpc r29, r1
372: 20 f4 brcc .+8 ; 0x37c <LCD501_Power+0x60>
374: c1 30 cpi r28, 0x01 ; 1
376: d1 05 cpc r29, r1
378: 29 f0 breq .+10 ; 0x384 <LCD501_Power+0x68>
37a: 1c c0 rjmp .+56 ; 0x3b4 <LCD501_Power+0x98>
37c: c3 30 cpi r28, 0x03 ; 3
37e: d1 05 cpc r29, r1
380: 59 f0 breq .+22 ; 0x398 <LCD501_Power+0x7c>
382: 18 c0 rjmp .+48 ; 0x3b4 <LCD501_Power+0x98>
{
case PWR_ON:
F_SPLC501_Write_Com(M_LCD_ON);
384: 8f ea ldi r24, 0xAF ; 175
386: 90 e0 ldi r25, 0x00 ; 0
388: 17 c0 rjmp .+46 ; 0x3b8 <LCD501_Power+0x9c>
break;
case PWR_SLEEP:
F_SPLC501_Write_Com(M_LCD_STATIC_OFF);
38a: 8c ea ldi r24, 0xAC ; 172
38c: 90 e0 ldi r25, 0x00 ; 0
38e: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(0x0000);
392: 80 e0 ldi r24, 0x00 ; 0
394: 90 e0 ldi r25, 0x00 ; 0
396: 05 c0 rjmp .+10 ; 0x3a2 <LCD501_Power+0x86>
F_SPLC501_Write_Com(M_LCD_OFF);
F_SPLC501_Write_Com(M_LCD_ALL_LIGNT);
break;
case PWR_STDBY:
F_SPLC501_Write_Com(M_LCD_STATIC_ON);
398: 8d ea ldi r24, 0xAD ; 173
39a: 90 e0 ldi r25, 0x00 ; 0
39c: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(0x0003);
3a0: ce 01 movw r24, r28
3a2: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_OFF);
3a6: 8e ea ldi r24, 0xAE ; 174
3a8: 90 e0 ldi r25, 0x00 ; 0
3aa: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
F_SPLC501_Write_Com(M_LCD_ALL_LIGNT);
3ae: 85 ea ldi r24, 0xA5 ; 165
3b0: 90 e0 ldi r25, 0x00 ; 0
3b2: 02 c0 rjmp .+4 ; 0x3b8 <LCD501_Power+0x9c>
break;
default://POW_OFF
F_SPLC501_Write_Com(M_LCD_OFF);
3b4: 8e ea ldi r24, 0xAE ; 174
3b6: 90 e0 ldi r25, 0x00 ; 0
3b8: 0e 94 a7 00 call 0x14e <F_SPLC501_Write_Com>
break;
}//
CurPowerMode = ModeCode;
3bc: d0 93 c1 05 sts 0x05C1, r29
3c0: c0 93 c0 05 sts 0x05C0, r28
3c4: df 91 pop r29
3c6: cf 91 pop r28
3c8: 08 95 ret
000003ca <LCD501_SetContrast>:
}
}
//***************************************************************************//
// 程序: void LCD501_SetContrast(unsigned int Contrast)
// 描述: 设置显示对比度 C语言调用
// 参数: Contrast - 对比度值,范围从0到31,数值越大对比度越高
// 返回: 无
// 声明: 手心 20070117 AVRGCC
//***************************************************************************//
void LCD501_SetContrast(unsigned int Contrast)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -