?? lcd.txt
字號:
;;;653 while(SPI_GetFlagStatus(SPI2, SPI_FLAG_TXE) == RESET)
000436 2102 MOVS r1,#2
000438 4620 MOV r0,r4
00043a f7fff7ff BL SPI_GetFlagStatus
00043e 2800 CMP r0,#0
000440 d0f9 BEQ |L1.1078|
;;;654 {
;;;655 }
;;;656
;;;657 LCD_CtrlLinesWrite(GPIOB, CtrlPin_NCS, Bit_SET);
000442 4628 MOV r0,r5
000444 e8bde8bd POP {r4-r6,lr}
000448 2201 MOVS r2,#1
00044a 2104 MOVS r1,#4
00044c e7fe B LCD_CtrlLinesWrite
;;;658 }
;;;659
ENDP
LCD_DrawChar PROC
;;;253 void LCD_DrawChar(u8 Xpos, u16 Ypos, uc16 *c)
;;;254 {
00044e e92de92d PUSH {r4-r12,lr}
000452 468b MOV r11,r1
000454 4617 MOV r7,r2
;;;255 u32 index = 0, i = 0;
000456 2500 MOVS r5,#0
;;;256 u8 Xaddress = 0;
;;;257
;;;258 Xaddress = Xpos;
000458 4606 MOV r6,r0
;;;259
;;;260 LCD_SetCursor(Xaddress, Ypos);
00045a 4659 MOV r1,r11
00045c 4630 MOV r0,r6
00045e f7fff7ff BL LCD_SetCursor
;;;261
;;;262 for(index = 0; index < 24; index++)
000462 f8dff8df LDR r9,|L1.2072|
000466 f8dff8df LDR r10,|L1.2076|
00046a f04ff04f MOV r8,#1
|L1.1134|
;;;263 {
;;;264 for(i = 0; i < 16; i++)
00046e 2400 MOVS r4,#0
|L1.1136|
000470 f837f837 LDRH r0,[r7,r5,LSL #1]
000474 fa08fa08 LSL r1,r8,r4
000478 4208 TST r0,r1
;;;265 {
;;;266 if((c[index] & (1 << i)) == 0x00)
00047a d104 BNE |L1.1158|
00047c f8b9f8b9 LDRH r0,[r9,#0] ; BackColor
000480 f7fff7ff BL LCD_WriteRAM
;;;267 {
;;;268 LCD_WriteRAM(BackColor);
000484 e003 B |L1.1166|
|L1.1158|
000486 f8baf8ba LDRH r0,[r10,#0] ; TextColor
00048a f7fff7ff BL LCD_WriteRAM
|L1.1166|
00048e 1c64 ADDS r4,r4,#1
000490 2c10 CMP r4,#0x10
000492 d3ed BCC |L1.1136|
000494 1c70 ADDS r0,r6,#1
;;;269 }
;;;270 else
;;;271 {
;;;272 LCD_WriteRAM(TextColor);
;;;273 }
;;;274 }
;;;275 Xaddress++;
000496 b2c6 UXTB r6,r0
000498 4659 MOV r1,r11
00049a 4630 MOV r0,r6
00049c f7fff7ff BL LCD_SetCursor
0004a0 1c6d ADDS r5,r5,#1
0004a2 2d18 CMP r5,#0x18
0004a4 d3e3 BCC |L1.1134|
;;;276 LCD_SetCursor(Xaddress, Ypos);
;;;277 }
;;;278 }
0004a6 e8bde8bd POP {r4-r12,pc}
;;;279
ENDP
LCD_DisplayChar PROC
;;;292 {
;;;293 Ascii -= 32;
0004aa 3a20 SUBS r2,r2,#0x20
0004ac b2d2 UXTB r2,r2
;;;294 LCD_DrawChar(Line, Column, &ASCII_Table[Ascii * 24]);
0004ae 4bdc LDR r3,|L1.2080|
0004b0 eb02eb02 ADD r2,r2,r2,LSL #1
0004b4 eb03eb03 ADD r2,r3,r2,LSL #4
0004b8 e7fe B LCD_DrawChar
;;;295 }
;;;296
ENDP
LCD_DisplayStringLine PROC
;;;307 void LCD_DisplayStringLine(u8 Line, u8 *ptr)
;;;308 {
0004ba e92de92d PUSH {r4-r8,lr}
0004be 4607 MOV r7,r0
0004c0 460c MOV r4,r1
;;;309 u32 i = 0;
0004c2 2500 MOVS r5,#0
;;;310 u16 refcolumn = 319;
0004c4 f240f240 MOV r6,#0x13f
;;;311
;;;312 /* Send the string character by character on lCD */
;;;313 while ((*ptr != 0) & (i < 20))
0004c8 7820 LDRB r0,[r4,#0]
0004ca b100 CBZ r0,|L1.1230|
0004cc 2001 MOVS r0,#1
|L1.1230|
0004ce f010f010 TST r0,#1
0004d2 d013 BEQ |L1.1276|
|L1.1236|
;;;314 {
;;;315 /* Display one character on LCD */
;;;316 LCD_DisplayChar(Line, refcolumn, *ptr);
0004d4 7822 LDRB r2,[r4,#0]
0004d6 4631 MOV r1,r6
0004d8 4638 MOV r0,r7
0004da f7fff7ff BL LCD_DisplayChar
;;;317 /* Decrement the column position by 16 */
;;;318 refcolumn -= 16;
0004de f1a6f1a6 SUB r0,r6,#0x10
0004e2 b286 UXTH r6,r0
;;;319 /* Point on the next character */
;;;320 ptr++;
;;;321 /* Increment the character counter */
;;;322 i++;
0004e4 1c6d ADDS r5,r5,#1
0004e6 f814f814 LDRB r0,[r4,#1]!
0004ea b100 CBZ r0,|L1.1262|
0004ec 2001 MOVS r0,#1
|L1.1262|
0004ee 2d14 CMP r5,#0x14
0004f0 d201 BCS |L1.1270|
0004f2 2101 MOVS r1,#1
0004f4 e000 B |L1.1272|
|L1.1270|
0004f6 2100 MOVS r1,#0
|L1.1272|
0004f8 4208 TST r0,r1
0004fa d1eb BNE |L1.1236|
|L1.1276|
;;;323 }
;;;324 }
0004fc e8bde8bd POP {r4-r8,pc}
;;;325
ENDP
LCD_ClearLine PROC
;;;204 {
;;;205 LCD_DisplayStringLine(Line, " ");
000500 a1c8 ADR r1,|L1.2084|
000502 e7fe B LCD_DisplayStringLine
;;;206 }
;;;207
ENDP
LCD_Clear PROC
;;;215 void LCD_Clear(void)
;;;216 {
000504 b510 PUSH {r4,lr}
;;;217 u32 index = 0;
000506 2400 MOVS r4,#0
;;;218
;;;219 LCD_SetCursor(0x00, 0x013F);
000508 f240f240 MOV r1,#0x13f
00050c 2000 MOVS r0,#0
00050e f7fff7ff BL LCD_SetCursor
|L1.1298|
000512 f64ff64f MOV r0,#0xffff
000516 f7fff7ff BL LCD_WriteRAM
;;;220
;;;221 for(index = 0; index < 76800; index++)
00051a 1c64 ADDS r4,r4,#1
00051c f5b4f5b4 CMP r4,#0x12c00
000520 d3f7 BCC |L1.1298|
;;;222 {
;;;223 LCD_WriteRAM(White);
;;;224 }
;;;225 }
000522 bd10 POP {r4,pc}
;;;226
ENDP
StrLength PROC
;;;812 {
;;;813 u32 Index = 0;
000524 2100 MOVS r1,#0
|L1.1318|
;;;814
;;;815 /* Increment the Index unless the end of string */
;;;816 for(Index = 0; *Str != '\0'; Str++, Index++)
000526 7802 LDRB r2,[r0,#0]
000528 b112 CBZ r2,|L1.1328|
00052a 1c40 ADDS r0,r0,#1
00052c 1c49 ADDS r1,r1,#1
00052e e7fa B |L1.1318|
|L1.1328|
;;;817 {
;;;818 }
;;;819
;;;820 return Index;
000530 4608 MOV r0,r1
;;;821 }
000532 4770 BX lr
;;;822
ENDP
LCD_DisplayString PROC
;;;336 void LCD_DisplayString(u8 Line, u8 *ptr)
;;;337 {
000534 e92de92d PUSH {r4-r10,lr}
000538 4682 MOV r10,r0
00053a 460c MOV r4,r1
;;;338 u32 i = 0, column = 0, index = 0, spaceindex = 0;
00053c 2600 MOVS r6,#0
00053e 2700 MOVS r7,#0
000540 2500 MOVS r5,#0
;;;339 u16 refcolumn = 319;
000542 f240f240 MOV r9,#0x13f
;;;340 u32 length = 0;
;;;341
;;;342 /* Get the string length */
;;;343 length = StrLength(ptr);
000546 4620 MOV r0,r4
000548 f7fff7ff BL StrLength
00054c 4680 MOV r8,r0
;;;344 if(length > 200)
00054e f1b8f1b8 CMP r8,#0xc8
000552 d90c BLS |L1.1390|
;;;345 {
;;;346 /* Set the Cursor position */
;;;347 LCD_SetCursor(Line, 0x013F);
000554 f240f240 MOV r1,#0x13f
000558 4650 MOV r0,r10
00055a f7fff7ff BL LCD_SetCursor
;;;348 /* Clear the Selected Line */
;;;349 LCD_ClearLine(Line);
00055e 4650 MOV r0,r10
000560 f7fff7ff BL LCD_ClearLine
;;;350 LCD_DisplayStringLine(Line, " String too long ");
000564 4650 MOV r0,r10
000566 e8bde8bd POP {r4-r10,lr}
00056a a1b4 ADR r1,|L1.2108|
00056c e7fe B LCD_DisplayStringLine
|L1.1390|
;;;351 }
;;;352 else
;;;353 {
;;;354 /* Set the Cursor position */
;;;355 LCD_SetCursor(Line, 0x013F);
00056e f240f240 MOV r1,#0x13f
000572 4650 MOV r0,r10
000574 f7fff7ff BL LCD_SetCursor
;;;356 /* Clear the Selected Line */
;;;357 // LCD_ClearLine(Line);
;;;358
;;;359 while(length--)
000578 f1b8f1b8 SUBS r8,r8,#1
00057c d334 BCC |L1.1512|
|L1.1406|
;;;360 {
;;;361 if(index == 20)
00057e 2f14 CMP r7,#0x14
000580 d11d BNE |L1.1470|
;;;362 {
;;;363 if(*ptr == 0x20)
000582 7820 LDRB r0,[r4,#0]
000584 2820 CMP r0,#0x20
000586 d101 BNE |L1.1420|
;;;364 {
;;;365 ptr++;
000588 1c64 ADDS r4,r4,#1
00058a e011 B |L1.1456|
|L1.1420|
;;;366 }
;;;367 else
;;;368 {
;;;369 for(i = 0; i < spaceindex; i++)
00058c 2700 MOVS r7,#0
00058e 2d00 CMP r5,#0
000590 d908 BLS |L1.1444|
|L1.1426|
;;;370 {
;;;371 LCD_DisplayChar(Line, column, ' ');
000592 2220 MOVS r2,#0x20
000594 b2b1 UXTH r1,r6
000596 4650 MOV r0,r10
000598 f7fff7ff BL LCD_DisplayChar
;;;372 column -= 16;
00059c 3e10 SUBS r6,r6,#0x10
00059e 1c7f ADDS r7,r7,#1
0005a0 42af CMP r7,r5
0005a2 d3f6 BCC |L1.1426|
|L1.1444|
;;;373 }
;;;374 ptr -= (spaceindex - 1);
0005a4 1b60 SUBS r0,r4,r5
0005a6 1c44 ADDS r4,r0,#1
;;;375 length += (spaceindex - 1);
0005a8 eb08eb08 ADD r0,r8,r5
0005ac f1a0f1a0 SUB r8,r0,#1
|L1.1456|
;;;376 }
;;;377 Line += 24;
0005b0 f10af10a ADD r0,r10,#0x18
0005b4 f000f000 AND r10,r0,#0xff
;;;378 /* Clear the Selected Line */
;;;379 // LCD_ClearLine(Line);
;;;380 refcolumn = 319;
0005b8 f240f240 MOV r9,#0x13f
;;;381 index = 0;
0005bc 2700 MOVS r7,#0
|L1.1470|
;;;382 }
;;;383 /* Display one character on LCD */
;;;384 LCD_DisplayChar(Line, refcolumn, *ptr);
0005be 7822 LDRB r2,[r4,#0]
0005c0 4649 MOV r1,r9
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -