📄 uart.lst
字号:
\ 00000004 0E1C MOV R6,R1
\ 00000006 171C MOV R7,R2
\ 00000008 1D1C MOV R5,R3
\ 0000000A 05E0 B ??UART_DataReceive_0
290 u16 wStatus;
291 while(DataLength--)
292 wStatus=UART_ByteReceive(UARTx,Data++,TimeOut);
\ ??UART_DataReceive_1:
\ 0000000C 2A1C MOV R2,R5
\ 0000000E 311C MOV R1,R6
\ 00000010 201C MOV R0,R4
\ 00000012 ........ BL UART_ByteReceive
\ 00000016 761C ADD R6,R6,#+0x1
\ ??UART_DataReceive_0:
\ 00000018 391C MOV R1,R7
\ 0000001A 7F1E SUB R7,R7,#+0x1
\ 0000001C 0906 LSL R1,R1,#+0x18
\ 0000001E F5D1 BNE ??UART_DataReceive_1
293 return wStatus;
\ 00000020 0004 LSL R0,R0,#+0x10
\ 00000022 000C LSR R0,R0,#+0x10
\ 00000024 F0BC POP {R4-R7}
\ 00000026 02BC POP {R1}
\ 00000028 0847 BX R1 ;; return
294 }
295
296 /*******************************************************************************
297 * Function Name : UART_9BitDataReceive
298 * Description : This function gets 9 bits data bytes from the selected UART.
299 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
300 * Input 2 : A pointer to the buffer where the data will be stored
301 * Input 3 : The data length
302 * Input 4 : The time-out value
303 * Output : The received data
304 * Return : The UARTx.SR register contents
305 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
306 u16 UART_9BitDataReceive(UART_TypeDef *UARTx, u16 *Data, u8 DataLength, u8 TimeOut)
307 {
\ UART_9BitDataReceive:
\ 00000000 F0B5 PUSH {R4-R7,LR}
\ 00000002 041C MOV R4,R0
\ 00000004 0E1C MOV R6,R1
\ 00000006 171C MOV R7,R2
\ 00000008 1D1C MOV R5,R3
\ 0000000A 05E0 B ??UART_9BitDataReceive_0
308 u16 wStatus;
309 while(DataLength--)
310 wStatus=UART_9BitByteReceive(UARTx,Data++,TimeOut);
\ ??UART_9BitDataReceive_1:
\ 0000000C 2A1C MOV R2,R5
\ 0000000E 311C MOV R1,R6
\ 00000010 201C MOV R0,R4
\ 00000012 ........ BL UART_9BitByteReceive
\ 00000016 B61C ADD R6,R6,#+0x2
\ ??UART_9BitDataReceive_0:
\ 00000018 391C MOV R1,R7
\ 0000001A 7F1E SUB R7,R7,#+0x1
\ 0000001C 0906 LSL R1,R1,#+0x18
\ 0000001E F5D1 BNE ??UART_9BitDataReceive_1
311 return wStatus;
\ 00000020 0004 LSL R0,R0,#+0x10
\ 00000022 000C LSR R0,R0,#+0x10
\ 00000024 F0BC POP {R4-R7}
\ 00000026 02BC POP {R1}
\ 00000028 0847 BX R1 ;; return
312 }
313
314 /*******************************************************************************
315 * Function Name : UART_StringReceive
316 * Description : This function gets 8 bits data bytes from the selected UART.
317 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
318 * Input 2 : A pointer to the buffer where the string will be stored
319 * Output : The received string
320 * Return : The UARTx.SR register contents
321 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
322 u16 UART_StringReceive(UART_TypeDef *UARTx, u8 *Data)
323 {
\ UART_StringReceive:
\ 00000000 30B4 PUSH {R4,R5}
\ 00000002 021C MOV R2,R0
324 u8 *pSTRING=Data;
\ 00000004 FF23 MOV R3,#+0xFF
\ 00000006 9B1C ADD R3,R3,#+0x2 ;; #+0x101
325 u16 wStatus;
326 do
327 {
328 while (!((wStatus=UARTx->SR) & (UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
\ ??UART_StringReceive_0:
\ 00000008 908A LDRH R0,[R2, #+0x14]
\ 0000000A 1842 TST R0,R3
\ 0000000C FCD0 BEQ ??UART_StringReceive_0
329 *(pSTRING++) = (u8)UARTx->RxBUFR; // then read the RxBUFR
\ 0000000E 1489 LDRH R4,[R2, #+0x8]
\ 00000010 0C70 STRB R4,[R1, #+0]
\ 00000012 491C ADD R1,R1,#+0x1
330 } while((*(pSTRING - 1)!=0x0D)&(*(pSTRING - 1)!='\0'));
\ 00000014 4C1E SUB R4,R1,#+0x1
\ 00000016 2578 LDRB R5,[R4, #+0]
\ 00000018 0D2D CMP R5,#+0xD
\ 0000001A 01D0 BEQ ??UART_StringReceive_1
\ 0000001C 002D CMP R5,#+0
\ 0000001E F3D1 BNE ??UART_StringReceive_0
331 *(pSTRING - 1)='\0';
\ ??UART_StringReceive_1:
\ 00000020 0021 MOV R1,#+0
\ 00000022 2170 STRB R1,[R4, #+0]
332 return wStatus;
\ 00000024 30BC POP {R4,R5}
\ 00000026 00B0 ADD SP,#+0
\ 00000028 7047 BX LR ;; return
333 }
\ In segment CODE, align 4, keep-with-next
\ ??DataTable1:
\ 00000000 FFFF0000 DC32 0xffff
334
335 #ifdef USE_SERIAL_PORT
336 /*******************************************************************************
337 * Function Name : sendchar
338 * Description : This function sends a character to the selected UART.
339 * Input 1 : A pointer to the character to send.
340 * Output : None
341 * Return : None
342 *******************************************************************************/
343 void sendchar( char *ch )
344 {
345 #ifdef USE_UART0
346 #define UARTx UART0
347 #endif /* Use_UART0 */
348
349 #ifdef USE_UART1
350 #define UARTx UART1
351 #endif /* Use_UART1 */
352
353 #ifdef USE_UART2
354 #define UARTx UART2
355 #endif /* Use_UART2 */
356
357 #ifdef USE_UART3
358 #define UARTx UART3
359 #endif /* Use_UART3 */
360
361 UART_ByteSend(UARTx,(u8 *)ch);
362 }
363 #endif /* USE_SERIAL_PORT */
364
365 /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
Maximum stack usage in bytes:
Function CSTACK
-------- ------
UART_9BitByteReceive 0
UART_9BitByteSend 4
UART_9BitDataReceive 20
UART_9BitDataSend 16
UART_BaudRateConfig 12
UART_ByteReceive 0
UART_ByteSend 4
UART_Config 20
UART_DataReceive 20
UART_DataSend 16
UART_FifoConfig 4
UART_FifoReset 4
UART_Init 0
UART_ItConfig 4
UART_LoopBackConfig 4
UART_OnOffConfig 4
UART_RxConfig 4
UART_StringReceive 12
UART_StringSend 12
Segment part sizes:
Function/Label Bytes
-------------- -----
UART_Init 16
UART_BaudRateConfig 26
UART_Config 76
UART_ItConfig 22
UART_FifoConfig 28
UART_FifoReset 16
UART_LoopBackConfig 28
UART_RxConfig 28
UART_OnOffConfig 28
UART_ByteSend 28
UART_9BitByteSend 28
UART_DataSend 34
UART_9BitDataSend 34
UART_StringSend 42
UART_ByteReceive 20
UART_9BitByteReceive 20
UART_DataReceive 42
UART_9BitDataReceive 42
UART_StringReceive 42
??DataTable1 4
Others 176
780 bytes in segment CODE
604 bytes of CODE memory (+ 176 bytes shared)
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -