📄 uart0.txt
字号:
000d40 e5900000 LDR r0,[r0,#0] ; uart0RxStr
000d44 e5c01000 STRB r1,[r0,#0]
000d48 e2800001 ADD r0,r0,#1
000d4c e59f1030 LDR r1,|L1.3460|
000d50 e5810000 STR r0,[r1,#0] ; uart0RxStr
000d54 ea000008 B |L1.3452|
;;;266 }
;;;267 else
;;;268 {
;;;269 isRxInt=0;
|L1.3416|
000d58 e3a00000 MOV r0,#0
000d5c e51f105c LDR r1,|L1.3336|
000d60 e5810000 STR r0,[r1,#0] ; isRxInt
;;;270 *uart0RxStr='\0';
000d64 e3a00000 MOV r0,#0
000d68 e59f1014 LDR r1,|L1.3460|
000d6c e5911000 LDR r1,[r1,#0] ; uart0RxStr
000d70 e5c10000 STRB r0,[r1,#0]
;;;271 Uart_Printf("\n");
000d74 e24f0f48 ADR r0,|L1.3164|
000d78 ebfffffe BL Uart_Printf
;;;272 }
;;;273 }
|L1.3452|
000d7c e8bd8008 LDMFD sp!,{r3,pc}
|L1.3456|
000d80 00006325 DCB "%c\0\0"
|L1.3460|
000d84 0000009c DCD ||.bss$2|| + 156
ENDP
Uart0_RxIntOrErr PROC
;;;250 void __irq Uart0_RxIntOrErr(void)
;;;251 {
000d88 e92d500f STMFD sp!,{r0-r3,r12,lr}
;;;252 rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);
000d8c e3a0044a MOV r0,#0x4a000000
000d90 e590001c LDR r0,[r0,#0x1c]
000d94 e3800007 ORR r0,r0,#7
000d98 e3a0144a MOV r1,#0x4a000000
000d9c e581001c STR r0,[r1,#0x1c]
;;;253 if(rSUBSRCPND&BIT_SUB_RXD0) __sub_Uart0_RxInt();
000da0 e3a0044a MOV r0,#0x4a000000
000da4 e5900018 LDR r0,[r0,#0x18]
000da8 e3100001 TST r0,#1
000dac 0a000001 BEQ |L1.3512|
000db0 ebfffffe BL __sub_Uart0_RxInt
000db4 ea000000 B |L1.3516|
;;;254 else __sub_Uart0_RxErrInt();
|L1.3512|
000db8 ebfffffe BL __sub_Uart0_RxErrInt
;;;255 ClearPending(BIT_UART0);
|L1.3516|
000dbc e3a00540 MOV r0,#0x10000000
000dc0 e3a0144a MOV r1,#0x4a000000
000dc4 e5810000 STR r0,[r1,#0]
000dc8 e3a00540 MOV r0,#0x10000000
000dcc e3a0144a MOV r1,#0x4a000000
000dd0 e5810010 STR r0,[r1,#0x10]
000dd4 e3a0044a MOV r0,#0x4a000000
000dd8 e5900010 LDR r0,[r0,#0x10]
;;;256 rSUBSRCPND=(BIT_SUB_RXD0|BIT_SUB_ERR0); // Clear Sub int pending
000ddc e3a00005 MOV r0,#5
000de0 e3a0144a MOV r1,#0x4a000000
000de4 e5810018 STR r0,[r1,#0x18]
;;;257 rINTSUBMSK&=~(BIT_SUB_RXD0|BIT_SUB_ERR0);
000de8 e3a0044a MOV r0,#0x4a000000
000dec e590001c LDR r0,[r0,#0x1c]
000df0 e3c00005 BIC r0,r0,#5
000df4 e3a0144a MOV r1,#0x4a000000
000df8 e581001c STR r0,[r1,#0x1c]
;;;258 }
000dfc e8bd500f LDMFD sp!,{r0-r3,r12,lr}
000e00 e25ef004 SUBS pc,lr,#4
ENDP
Test_Uart0_Int PROC
;;;316 void Test_Uart0_Int(void)
;;;317 {
000e04 e92d4038 STMFD sp!,{r3-r5,lr}
;;;318 U8 ch;
;;;319 int iBaud;
;;;320
;;;321 Uart_Port_Set();
000e08 ebfffffe BL Uart_Port_Set
;;;322
;;;323 Uart_Select(1);
000e0c e3a00001 MOV r0,#1
000e10 ebfffffe BL Uart_Select
;;;324 Uart_Printf("\nConnect PC[COM1 or COM2] and UART0 of SMDK2442 with a serial cable!!! \n");
000e14 e59f0250 LDR r0,|L1.4204|
000e18 ebfffffe BL Uart_Printf
;;;325 Uart_Printf("Then, press any key........\n");
000e1c e28f0f93 ADR r0,|L1.4208|
000e20 ebfffffe BL Uart_Printf
;;;326 Uart_Select(0);
000e24 e3a00000 MOV r0,#0
000e28 ebfffffe BL Uart_Select
;;;327 Uart_Getch();
000e2c ebfffffe BL Uart_Getch
;;;328
;;;329 /******** For operating clock test *********/
;;;330 Uart_Printf("[Uart channel 0 Interrupt test]\n");
000e30 e28f0f96 ADR r0,|L1.4240|
000e34 ebfffffe BL Uart_Printf
;;;331 Uart_Printf("Select operating clock 1. PCLK(D) 2. UCLK 3. FCLK/n \nChoose : ");
000e38 e59f0274 LDR r0,|L1.4276|
000e3c ebfffffe BL Uart_Printf
;;;332 ch = Uart_Getch();
000e40 ebfffffe BL Uart_Getch
000e44 e1a05000 MOV r5,r0
;;;333 switch (ch)
000e48 e3550032 CMP r5,#0x32
000e4c 0a000002 BEQ |L1.3676|
000e50 e3550033 CMP r5,#0x33
000e54 1a00001a BNE |L1.3780|
000e58 ea00000b B |L1.3724|
;;;334 {
;;;335 case '2' :
;;;336 rMISCCR = rMISCCR & ~(7<<8) | (1<<10); // CLKOUT1 = PCLK
|L1.3676|
000e5c e3a00456 MOV r0,#0x56000000
000e60 e5900080 LDR r0,[r0,#0x80]
000e64 e3c00e70 BIC r0,r0,#0x700
000e68 e3800e40 ORR r0,r0,#0x400
000e6c e3a01456 MOV r1,#0x56000000
000e70 e5810080 STR r0,[r1,#0x80]
;;;337 Uart_Uextclk_En(0, 115200, Pclk);
000e74 e51f07f4 LDR r0,|L1.1672|
000e78 e5902000 LDR r2,[r0,#0] ; Pclk
000e7c e59f1234 LDR r1,|L1.4280|
000e80 e3a00000 MOV r0,#0
000e84 ebfffffe BL Uart_Uextclk_En
;;;338 break;
000e88 ea000010 B |L1.3792|
;;;339 case '3' :
;;;340 Uart_Printf("Type the baudrate and then change the same baudrate of host, too.\n");
|L1.3724|
000e8c e59f0228 LDR r0,|L1.4284|
000e90 ebfffffe BL Uart_Printf
;;;341 Uart_Printf("Baudrate (ex 9600, 115200[D], 921600) : ");
000e94 e28f0f89 ADR r0,|L1.4288|
000e98 ebfffffe BL Uart_Printf
;;;342 iBaud = Uart_GetIntNum();
000e9c ebfffffe BL Uart_GetIntNum
000ea0 e1a04000 MOV r4,r0
;;;343 if (iBaud == -1) iBaud = 115200;
000ea4 e3740001 CMN r4,#1
000ea8 1a000000 BNE |L1.3760|
000eac e59f4204 LDR r4,|L1.4280|
;;;344 Uart_Fclkn_En(0, iBaud);
|L1.3760|
000eb0 e1a01004 MOV r1,r4
000eb4 e3a00000 MOV r0,#0
000eb8 ebfffffe BL Uart_Fclkn_En
;;;345 Uart_Getch();
000ebc ebfffffe BL Uart_Getch
;;;346 break;
000ec0 ea000002 B |L1.3792|
;;;347 default :
;;;348 Uart_Pclk_En(0, 115200);
|L1.3780|
000ec4 e59f11ec LDR r1,|L1.4280|
000ec8 e3a00000 MOV r0,#0
000ecc ebfffffe BL Uart_Pclk_En
;;;349 }
;;;350
;;;351 #if 0
;;;352 /******** Select UART or IrDA *********/
;;;353 Uart_Printf("Select 1. UART(D) or 2. IrDA mode\nChoose : ");
;;;354 if (Uart_Getch() == '2')
;;;355 rULCON0 |= (1<<6); // IrDA mode
;;;356 else
;;;357 rULCON0 &= ~(1<<6); // UART mode
;;;358 #endif
;;;359
;;;360 /*********** UART0 Tx test with interrupt ***********/
;;;361 isTxInt=1;
|L1.3792|
000ed0 e3a00001 MOV r0,#1
000ed4 e51f12b0 LDR r1,|L1.3116|
000ed8 e5810000 STR r0,[r1,#0] ; isTxInt
;;;362 uart0TxStr="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890->UART0 Tx interrupt test is good!!!!\r\n";
000edc e59f0208 LDR r0,|L1.4332|
000ee0 e51f12c0 LDR r1,|L1.3112|
000ee4 e5810000 STR r0,[r1,#0] ; uart0TxStr
;;;363 Uart_Printf("[Uart channel 0 Tx Interrupt Test]\n");
000ee8 e28f0f80 ADR r0,|L1.4336|
000eec ebfffffe BL Uart_Printf
;;;364
;;;365 pISR_UART0=(unsigned)Uart0_TxInt;
000ef0 e59f021c LDR r0,|L1.4372|
000ef4 e59f121c LDR r1,|L1.4376|
000ef8 e5810f90 STR r0,[r1,#0xf90]
;;;366
;;;367 rULCON0=(0<<6)|(0<<3)|(0<<2)|(3); // Normal,No parity,One stop bit, 8bit
000efc e3a00003 MOV r0,#3
000f00 e3a01450 MOV r1,#0x50000000
000f04 e5810000 STR r0,[r1,#0]
;;;368 rUCON0 |= (TX_INTTYPE<<9)|(RX_INTTYPE<<8)|(0<<7)|(0<<6)|(0<<5)|(0<<4)|(1<<2)|(1);
000f08 e3a00450 MOV r0,#0x50000000
000f0c e5900004 LDR r0,[r0,#4]
000f10 e3800fc0 ORR r0,r0,#0x300
000f14 e3800005 ORR r0,r0,#5
000f18 e3a01450 MOV r1,#0x50000000
000f1c e5810004 STR r0,[r1,#4]
;;;369 //Clock,Tx:Def,Rx:Def,Rx timeout:x,Rx error int:x,Loop-back:x,Send break:x,Tx:int,Rx:int
;;;370 Uart_TxEmpty(1); //wait until tx buffer is empty.
000f20 e3a00001 MOV r0,#1
000f24 ebfffffe BL Uart_TxEmpty
;;;371 rINTMSK=~(BIT_UART0);
000f28 e3e00540 MVN r0,#0x10000000
000f2c e3a0144a MOV r1,#0x4a000000
000f30 e5810008 STR r0,[r1,#8]
;;;372 rINTSUBMSK=~(BIT_SUB_TXD0);
000f34 e3e00002 MVN r0,#2
000f38 e3a0144a MOV r1,#0x4a000000
000f3c e581001c STR r0,[r1,#0x1c]
;;;373
;;;374 while(isTxInt);
000f40 e1a00000 NOP
|L1.3908|
000f44 e51f0320 LDR r0,|L1.3116|
000f48 e5900000 LDR r0,[r0,#0] ; isTxInt
000f4c e3500000 CMP r0,#0
000f50 1afffffb BNE |L1.3908|
;;;375
;;;376 /*********** UART0 Rx test with interrupt ***********/
;;;377 isRxInt=1;
000f54 e3a00001 MOV r0,#1
000f58 e51f1258 LDR r1,|L1.3336|
000f5c e5810000 STR r0,[r1,#0] ; isRxInt
;;;378 uart0RxStr=(char *)UARTBUFFER;
000f60 e3a005c4 MOV r0,#0x31000000
000f64 e51f11e8 LDR r1,|L1.3460|
000f68 e5810000 STR r0,[r1,#0] ; uart0RxStr
;;;379 Uart_Printf("\n[Uart channel 0 Rx Interrupt Test]:\n");
000f6c e28f0f6a ADR r0,|L1.4380|
000f70 ebfffffe BL Uart_Printf
;;;380 Uart_Printf("After typing characters and ENTER key you will see the characters which was typed by you.");
000f74 e59f01c8 LDR r0,|L1.4420|
000f78 ebfffffe BL Uart_Printf
;;;381 Uart_Printf("\nTo quit, press ENTER key.!!!\n");
000f7c e28f0f71 ADR r0,|L1.4424|
000f80 ebfffffe BL Uart_Printf
;;;382
;;;383 Uart_TxEmpty(1); //wait until tx buffer is empty.
000f84 e3a00001 MOV r0,#1
000f88 ebfffffe BL Uart_TxEmpty
;;;384 pISR_UART0 =(unsigned)Uart0_RxIntOrErr;
000f8c e59f01d4 LDR r0,|L1.4456|
000f90 e59f1180 LDR r1,|L1.4376|
000f94 e5810f90 STR r0,[r1,#0xf90]
;;;385 rULCON0=(0<<6)|(0<<3)|(0<<2)|(3); // Normal,No parity,One stop bit, 8bit
000f98 e3a00003 MOV r0,#3
000f9c e3a01450 MOV r1,#0x50000000
000fa0 e5810000 STR r0,[r1,#0]
;;;386 rUCON0 |= (TX_INTTYPE<<9)|(RX_INTTYPE<<8)|(0<<7)|(1<<6)|(0<<5)|(0<<4)|(1<<2)|(1);
000fa4 e3a00450 MOV r0,#0x50000000
000fa8 e5900004 LDR r0,[r0,#4]
000fac e3800fc0 ORR r0,r0,#0x300
000fb0 e3800045 ORR r0,r0,#0x45
000fb4 e3a01450 MOV r1,#0x50000000
000fb8 e5810004 STR r0,[r1,#4]
;;;387 //Clock,Tx:pulse,Rx:pulse,Rx timeout:x,Rx error int:o,Loop-back:x,Send break:x,Tx:int,Rx:int
;;;388
;;;389 // Clear Int Pending and Unmask
;;;390 ClearPending(BIT_UART0);
000fbc e3a00540 MOV r0,#0x10000000
000fc0 e3a0144a MOV r1,#0x4a000000
000fc4 e5810000 STR r0,[r1,#0]
000fc8 e3a00540 MOV r0,#0x10000000
000fcc e3a0144a MOV r1,#0x4a000000
000fd0 e5810010 STR r0,[r1,#0x10]
000fd4 e3a0044a MOV r0,#0x4a000000
000fd8 e5900010 LDR r0,[r0,#0x10]
;;;391 rINTMSK=~(BIT_UART0);
000fdc e3e00540 MVN r0,#0x10000000
000fe0 e3a0144a MOV r1,#0x4a000000
000fe4 e5810008 STR r0,[r1,#8]
;;;392 rSUBSRCPND=(BIT_SUB_TXD0|BIT_SUB_RXD0|BIT_SUB_ERR0);
000fe8 e3a00007 MOV r0,#7
000fec e3a0144a MOV r1,#0x4a000000
000ff0 e5810018 STR r0,[r1,#0x18]
;;;393 rINTSUBMSK=~(BIT_SUB_RXD0|BIT_SUB_ERR0);
000ff4 e3e00005 MVN r0,#5
000ff8 e3a0144a MOV r1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -