?? tft_lcd.txt
字號:
00008a e033 B |L8.244|
|L8.140|
;;;307 }
;;;308 }
;;;309 else /* armfly 添加:實(shí)現(xiàn)文字疊加在圖片上的功能 */
;;;310 {
;;;311 for (index = 0; index < 16; index++) /* 字符高度 */
00008c f04f0800 MOV r8,#0
000090 e02d B |L8.238|
|L8.146|
;;;312 {
;;;313 uint16_t x = Xpos;
000092 46a3 MOV r11,r4
;;;314
;;;315 for (i = 0; i < width; i++) /* 字符寬度 */
000094 f04f0900 MOV r9,#0
000098 e021 B |L8.222|
|L8.154|
;;;316 {
;;;317 if ((c[index * (width / 8) + i / 8] & (0x80 >> (i % 8))) != 0x00)
00009a 17f9 ASRS r1,r7,#31
00009c eb077151 ADD r1,r7,r1,LSR #29
0000a0 10c9 ASRS r1,r1,#3
0000a2 fb01f108 MUL r1,r1,r8
0000a6 eb0101d9 ADD r1,r1,r9,LSR #3
0000aa 5c72 LDRB r2,[r6,r1]
0000ac f0090307 AND r3,r9,#7
0000b0 2180 MOVS r1,#0x80
0000b2 4119 ASRS r1,r1,r3
0000b4 420a TST r2,r1
0000b6 d00c BEQ |L8.210|
;;;318 {
;;;319 LCD_SetCursor(x, Yaddress);
0000b8 4651 MOV r1,r10
0000ba 4658 MOV r0,r11
0000bc f7fffffe BL LCD_SetCursor
;;;320
;;;321 LCD->LCD_REG = 0x202;
0000c0 f2402002 MOV r0,#0x202
0000c4 f04f41d8 MOV r1,#0x6c000000
0000c8 8008 STRH r0,[r1,#0]
;;;322 LCD->LCD_RAM = s_TextColor;
0000ca 480b LDR r0,|L8.248|
0000cc 1f00 SUBS r0,r0,#4
0000ce 8800 LDRH r0,[r0,#0] ; s_TextColor
0000d0 8048 STRH r0,[r1,#2]
|L8.210|
;;;323 }
;;;324 x++;
0000d2 f10b0001 ADD r0,r11,#1
0000d6 fa1ffb80 UXTH r11,r0
0000da f1090901 ADD r9,r9,#1 ;315
|L8.222|
0000de 45b9 CMP r9,r7 ;315
0000e0 d3db BCC |L8.154|
;;;325 }
;;;326 Yaddress++;
0000e2 f10a0001 ADD r0,r10,#1
0000e6 f0000aff AND r10,r0,#0xff
0000ea f1080801 ADD r8,r8,#1 ;311
|L8.238|
0000ee f1b80f10 CMP r8,#0x10 ;311
0000f2 d3ce BCC |L8.146|
|L8.244|
;;;327 }
;;;328 }
;;;329 }
0000f4 e8bd8ff0 POP {r4-r11,pc}
;;;330
ENDP
|L8.248|
DCD ||.data||+0x4
AREA ||i.LCD_DrawCircle||, CODE, READONLY, ALIGN=2
LCD_DrawCircle PROC
;;;644 */
;;;645 void LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius)
000000 e92d43f0 PUSH {r4-r9,lr}
;;;646 {
000004 4604 MOV r4,r0
000006 460d MOV r5,r1
000008 4616 MOV r6,r2
;;;647 int32_t D; /* Decision Variable */
;;;648 uint32_t CurX; /* 當(dāng)前 X 值 */
;;;649 uint32_t CurY; /* 當(dāng)前 Y 值 */
;;;650
;;;651 D = 3 - (Radius << 1);
00000a 2003 MOVS r0,#3
00000c eba00746 SUB r7,r0,r6,LSL #1
;;;652 CurX = 0;
000010 f04f0800 MOV r8,#0
;;;653 CurY = Radius;
000014 46b1 MOV r9,r6
;;;654
;;;655 while (CurX <= CurY)
000016 e080 B |L9.282|
|L9.24|
;;;656 {
;;;657 LCD_SetCursor(Xpos + CurX, Ypos + CurY);
000018 eb050209 ADD r2,r5,r9
00001c b291 UXTH r1,r2
00001e eb040208 ADD r2,r4,r8
000022 b290 UXTH r0,r2
000024 f7fffffe BL LCD_SetCursor
;;;658 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
000028 f7fffffe BL LCD_WriteRAM_Prepare
;;;659 LCD_WriteRAM(s_TextColor);
00002c 483d LDR r0,|L9.292|
00002e 8800 LDRH r0,[r0,#0] ; s_TextColor
000030 f7fffffe BL LCD_WriteRAM
;;;660
;;;661 LCD_SetCursor(Xpos + CurX, Ypos - CurY);
000034 eba50209 SUB r2,r5,r9
000038 b291 UXTH r1,r2
00003a eb040208 ADD r2,r4,r8
00003e b290 UXTH r0,r2
000040 f7fffffe BL LCD_SetCursor
;;;662 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
000044 f7fffffe BL LCD_WriteRAM_Prepare
;;;663 LCD_WriteRAM(s_TextColor);
000048 4836 LDR r0,|L9.292|
00004a 8800 LDRH r0,[r0,#0] ; s_TextColor
00004c f7fffffe BL LCD_WriteRAM
;;;664
;;;665 LCD_SetCursor(Xpos - CurX, Ypos + CurY);
000050 eb050209 ADD r2,r5,r9
000054 b291 UXTH r1,r2
000056 eba40208 SUB r2,r4,r8
00005a b290 UXTH r0,r2
00005c f7fffffe BL LCD_SetCursor
;;;666 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
000060 f7fffffe BL LCD_WriteRAM_Prepare
;;;667 LCD_WriteRAM(s_TextColor);
000064 482f LDR r0,|L9.292|
000066 8800 LDRH r0,[r0,#0] ; s_TextColor
000068 f7fffffe BL LCD_WriteRAM
;;;668
;;;669 LCD_SetCursor(Xpos - CurX, Ypos - CurY);
00006c eba50209 SUB r2,r5,r9
000070 b291 UXTH r1,r2
000072 eba40208 SUB r2,r4,r8
000076 b290 UXTH r0,r2
000078 f7fffffe BL LCD_SetCursor
;;;670 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
00007c f7fffffe BL LCD_WriteRAM_Prepare
;;;671 LCD_WriteRAM(s_TextColor);
000080 4828 LDR r0,|L9.292|
000082 8800 LDRH r0,[r0,#0] ; s_TextColor
000084 f7fffffe BL LCD_WriteRAM
;;;672
;;;673 LCD_SetCursor(Xpos + CurY, Ypos + CurX);
000088 eb050208 ADD r2,r5,r8
00008c b291 UXTH r1,r2
00008e eb040209 ADD r2,r4,r9
000092 b290 UXTH r0,r2
000094 f7fffffe BL LCD_SetCursor
;;;674 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
000098 f7fffffe BL LCD_WriteRAM_Prepare
;;;675 LCD_WriteRAM(s_TextColor);
00009c 4821 LDR r0,|L9.292|
00009e 8800 LDRH r0,[r0,#0] ; s_TextColor
0000a0 f7fffffe BL LCD_WriteRAM
;;;676
;;;677 LCD_SetCursor(Xpos + CurY, Ypos - CurX);
0000a4 eba50208 SUB r2,r5,r8
0000a8 b291 UXTH r1,r2
0000aa eb040209 ADD r2,r4,r9
0000ae b290 UXTH r0,r2
0000b0 f7fffffe BL LCD_SetCursor
;;;678 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
0000b4 f7fffffe BL LCD_WriteRAM_Prepare
;;;679 LCD_WriteRAM(s_TextColor);
0000b8 481a LDR r0,|L9.292|
0000ba 8800 LDRH r0,[r0,#0] ; s_TextColor
0000bc f7fffffe BL LCD_WriteRAM
;;;680
;;;681 LCD_SetCursor(Xpos - CurY, Ypos + CurX);
0000c0 eb050208 ADD r2,r5,r8
0000c4 b291 UXTH r1,r2
0000c6 eba40209 SUB r2,r4,r9
0000ca b290 UXTH r0,r2
0000cc f7fffffe BL LCD_SetCursor
;;;682 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
0000d0 f7fffffe BL LCD_WriteRAM_Prepare
;;;683 LCD_WriteRAM(s_TextColor);
0000d4 4813 LDR r0,|L9.292|
0000d6 8800 LDRH r0,[r0,#0] ; s_TextColor
0000d8 f7fffffe BL LCD_WriteRAM
;;;684
;;;685 LCD_SetCursor(Xpos - CurY, Ypos - CurX);
0000dc eba50208 SUB r2,r5,r8
0000e0 b291 UXTH r1,r2
0000e2 eba40209 SUB r2,r4,r9
0000e6 b290 UXTH r0,r2
0000e8 f7fffffe BL LCD_SetCursor
;;;686 LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
0000ec f7fffffe BL LCD_WriteRAM_Prepare
;;;687 LCD_WriteRAM(s_TextColor);
0000f0 480c LDR r0,|L9.292|
0000f2 8800 LDRH r0,[r0,#0] ; s_TextColor
0000f4 f7fffffe BL LCD_WriteRAM
;;;688
;;;689 if (D < 0)
0000f8 2f00 CMP r7,#0
0000fa da04 BGE |L9.262|
;;;690 {
;;;691 D += (CurX << 2) + 6;
0000fc 2006 MOVS r0,#6
0000fe eb000088 ADD r0,r0,r8,LSL #2
000102 4407 ADD r7,r7,r0
000104 e007 B |L9.278|
|L9.262|
;;;692 }
;;;693 else
;;;694 {
;;;695 D += ((CurX - CurY) << 2) + 10;
000106 eba80009 SUB r0,r8,r9
00010a 210a MOVS r1,#0xa
00010c eb010080 ADD r0,r1,r0,LSL #2
000110 4407 ADD r7,r7,r0
;;;696 CurY--;
000112 f1a90901 SUB r9,r9,#1
|L9.278|
;;;697 }
;;;698 CurX++;
000116 f1080801 ADD r8,r8,#1
|L9.282|
00011a 45c8 CMP r8,r9 ;655
00011c f67faf7c BLS |L9.24|
;;;699 }
;;;700 }
000120 e8bd83f0 POP {r4-r9,pc}
;;;701
ENDP
|L9.292|
DCD ||.data||
AREA ||i.LCD_DrawLine||, CODE, READONLY, ALIGN=2
LCD_DrawLine PROC
;;;554 */
;;;555 void LCD_DrawLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length, uint8_t Direction)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;556 {
000004 4604 MOV r4,r0
000006 460d MOV r5,r1
000008 4616 MOV r6,r2
00000a 4698 MOV r8,r3
;;;557 uint32_t i = 0;
00000c 2700 MOVS r7,#0
;;;558
;;;559 /* 設(shè)置線的起始坐標(biāo) */
;;;560 LCD_SetCursor(Xpos, Ypos);
00000e 4629 MOV r1,r5
000010 4620 MOV r0,r4
000012 f7fffffe BL LCD_SetCursor
;;;561
;;;562 if (Direction == Horizontal) /* 水平繪制 */
000016 f1b80f00 CMP r8,#0
00001a d10b BNE |L10.52|
;;;563 {
;;;564 LCD_WriteRAM_Prepare();
00001c f7fffffe BL LCD_WriteRAM_Prepare
;;;565 for (i = 0; i < Length; i++)
000020 bf00 NOP
000022 e004 B |L10.46|
|L10.36|
;;;566 {
;;;567 LCD_WriteRAM(s_TextColor);
000024 480d LDR r0,|L10.92|
000026 8800 LDRH r0,[r0,#0] ; s_TextColor
000028 f7fffffe BL LCD_WriteRAM
00002c 1c7f ADDS r7,r7,#1 ;565
|L10.46|
00002e 42b7 CMP r7,r6 ;565
000030 d3f8 BCC |L10.36|
000032 e010 B |L10.86|
|L10.52|
;;;568 }
;;;569 }
;;;570 else /* 垂直繪制 */
;;;571 {
;;;572 for (i = 0; i < Length; i++)
000034 2700 MOVS r7,#0
000036 e00c B |L10.82|
|L10.56|
;;;573 {
;;;574 LCD_WriteRAM_Prepare();
000038 f7fffffe BL LCD_WriteRAM_Prepare
;;;575 LCD_WriteRAM(s_TextColor);
00003c 4807 LDR r0,|L10.92|
00003e 8800 LDRH r0,[r0,#0] ; s_TextColor
000040 f7fffffe BL LCD_WriteRAM
;;;576 Ypos++;
000044 1c68 ADDS r0,r5,#1
000046 b285 UXTH r5,r0
;;;577 LCD_SetCursor(Xpos, Ypos);
000048 4629 MOV r1,r5
00004a 4620 MOV r0,r4
00004c f7fffffe BL LCD_SetCursor
000050 1c7f ADDS r7,r7,#1 ;572
|L10.82|
000052 42b7 CMP r7,r6 ;572
000054 d3f0 BCC |L10.56|
|L10.86|
;;;578 }
;;;579 }
;;;580 }
000056 e8bd81f0 POP {r4-r8,pc}
;;;581
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -