⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uart_test.txt

📁 此源码是sc3c2410串口测试程序
💻 TXT
字号:
; generated by ARM/Thumb C/C++ Compiler with , RVCT3.1 [Build 902] for uVision
; commandline ArmCC [--debug -c --asm --interleave -o.\obj\uart_test.o --depend=.\obj\uart_test.d --device=DARMSS9 --apcs=interwork -I..\common\inc -IC:\Keil\ARM\INC\Samsung --omf_browse=.\obj\uart_test.crf uart_test.c]
                          ARM

                          AREA ||.text||, CODE, READONLY, ALIGN=2

                  uart0_test PROC
;;;22     void uart0_test(void)
;;;23     {
000000  e92d4070          PUSH     {r4-r6,lr}
000004  e24ddc01          SUB      sp,sp,#0x100
;;;24     	char cInput[256];
;;;25     	UINT8T ucInNo=0;
000008  e3a04000          MOV      r4,#0
;;;26     	UINT32T	g_nKeyPress;
;;;27     	char c;
;;;28     	uart_init(0,115200,0);
00000c  e3a02000          MOV      r2,#0
000010  e59f10a4          LDR      r1,|L1.188|
000014  e1a00002          MOV      r0,r2
000018  ebfffffe          BL       uart_init
;;;29     	uart_printf("\n UART0 Communication Test Example\n");	
00001c  e28f009c          ADR      r0,|L1.192|
000020  ebfffffe          BL       uart_printf
;;;30     	uart_printf(" Please input words, then press Enter:\n");
000024  e28f00b8          ADR      r0,|L1.228|
000028  ebfffffe          BL       uart_printf
;;;31     	uart_printf(" />");
00002c  e28f00d8          ADR      r0,|L1.268|
000030  ebfffffe          BL       uart_printf
;;;32     #ifdef BOARDTEST	
;;;33     	sprintf(&cInput, "Type via UART0 to test.");
;;;34     	print_lcd(195,170,0x1c,&cInput);	
;;;35     #endif
;;;36     	uart_printf(" ");
000034  e28f00d4          ADR      r0,|L1.272|
000038  ebfffffe          BL       uart_printf
;;;37     	g_nKeyPress = 1;
00003c  e3a06001          MOV      r6,#1
;;;38     	while(g_nKeyPress==1)			// only for board test to exit
000040  ea000010          B        |L1.136|
                  |L1.68|
;;;39     	{
;;;40     		c=uart_getch();
000044  ebfffffe          BL       uart_getch
000048  e1a05000          MOV      r5,r0
;;;41     		//uart_sendbyte(c);
;;;42     		
;;;43     		uart_printf("%c",c);
00004c  e1a01005          MOV      r1,r5
000050  e28f00bc          ADR      r0,|L1.276|
000054  ebfffffe          BL       uart_printf
;;;44     		if(c!='\r')
000058  e355000d          CMP      r5,#0xd
00005c  0a000005          BEQ      |L1.120|
;;;45     			cInput[ucInNo++]=c;
000060  e1a00004          MOV      r0,r4
000064  e2841001          ADD      r1,r4,#1
000068  e20140ff          AND      r4,r1,#0xff
00006c  e28d1000          ADD      r1,sp,#0
000070  e7c15000          STRB     r5,[r1,r0]
000074  ea000003          B        |L1.136|
                  |L1.120|
;;;46     		else
;;;47     		{
;;;48     			cInput[ucInNo]='\0';
000078  e3a00000          MOV      r0,#0
00007c  e28d1000          ADD      r1,sp,#0
000080  e7c10004          STRB     r0,[r1,r4]
;;;49     			break;
000084  ea000001          B        |L1.144|
                  |L1.136|
000088  e3560001          CMP      r6,#1
00008c  0affffec          BEQ      |L1.68|
                  |L1.144|
000090  e1a00000          MOV      r0,r0
;;;50     		}
;;;51     	}
;;;52     	delay(1000);	
000094  e3a00ffa          MOV      r0,#0x3e8
000098  ebfffffe          BL       delay
;;;53     
;;;54     	uart_printf(" \nThe words that you input are: %s\n",cInput);		
00009c  e28d1000          ADD      r1,sp,#0
0000a0  e28f0070          ADR      r0,|L1.280|
0000a4  ebfffffe          BL       uart_printf
;;;55     	uart_printf(" end.\n"); 
0000a8  e28f008c          ADR      r0,|L1.316|
0000ac  ebfffffe          BL       uart_printf
;;;56     }
0000b0  e28ddc01          ADD      sp,sp,#0x100
0000b4  e8bd4070          POP      {r4-r6,lr}
0000b8  e12fff1e          BX       lr
                          ENDP

                  |L1.188|
0000bc  0001c200          DCD      0x0001c200
                  |L1.192|
0000c0  0a205541          DCB      "\n\40\125\101"
0000c4  52543020          DCB      "RT0 "
0000c8  436f6d6d          DCB      "Comm"
0000cc  756e6963          DCB      "unic"
0000d0  6174696f          DCB      "atio"
0000d4  6e205465          DCB      "n Te"
0000d8  73742045          DCB      "st E"
0000dc  78616d70          DCB      "xamp"
0000e0  6c650a00          DCB      "le\n\0"
                  |L1.228|
0000e4  20506c65          DCB      " Ple"
0000e8  61736520          DCB      "ase "
0000ec  696e7075          DCB      "inpu"
0000f0  7420776f          DCB      "t wo"
0000f4  7264732c          DCB      "rds,"
0000f8  20746865          DCB      " the"
0000fc  6e207072          DCB      "n pr"
000100  65737320          DCB      "ess "
000104  456e7465          DCB      "Ente"
000108  723a0a00          DCB      "r:\n\0"
                  |L1.268|
00010c  202f3e00          DCB      " />\0"
                  |L1.272|
000110  20000000          DCB      " \0\0\0"
                  |L1.276|
000114  25630000          DCB      "%c\0\0"
                  |L1.280|
000118  200a5468          DCB      " \n\124\150"
00011c  6520776f          DCB      "e wo"
000120  72647320          DCB      "rds "
000124  74686174          DCB      "that"
000128  20796f75          DCB      " you"
00012c  20696e70          DCB      " inp"
000130  75742061          DCB      "ut a"
000134  72653a20          DCB      "re: "
000138  25730a00          DCB      "%s\n\0"
                  |L1.316|
00013c  20656e64          DCB      " end"
000140  2e0a0000          DCB      ".\n\0\0"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -