📄 uart.lst
字号:
\ 0000000E 828A LDRH R2,[R0, #+0x14]
\ 00000010 9207 LSL R2,R2,#+0x1E
\ 00000012 FCD5 BPL ??UART_9BitByteSend_0
186 UARTx->TxBUFR = *Data;
\ ??UART_9BitByteSend_2:
\ 00000014 0988 LDRH R1,[R1, #+0]
\ 00000016 8180 STRH R1,[R0, #+0x4]
187 }
\ 00000018 00B0 ADD SP,#+0
\ 0000001A 7047 BX LR ;; return
188
189 /*******************************************************************************
190 * Function Name : UART_DataSend
191 * Description : This function sends several data bytes to the selected UART.
192 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
193 * Input 2 : A pointer to the data to send
194 * Input 3 : The data length in bytes
195 * Output : None
196 * Return : None
197 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
198 void UART_DataSend(UART_TypeDef *UARTx, u8 *Data, u8 DataLength)
199 {
\ UART_DataSend:
\ 00000000 70B5 PUSH {R4-R6,LR}
\ 00000002 041C MOV R4,R0
\ 00000004 0D1C MOV R5,R1
\ 00000006 161C MOV R6,R2
\ 00000008 04E0 B ??UART_DataSend_0
200 while(DataLength--)
201 {
202 UART_ByteSend(UARTx,Data);
\ ??UART_DataSend_1:
\ 0000000A 291C MOV R1,R5
\ 0000000C 201C MOV R0,R4
\ 0000000E ........ BL UART_ByteSend
203 Data++;
\ 00000012 6D1C ADD R5,R5,#+0x1
204 }
\ ??UART_DataSend_0:
\ 00000014 301C MOV R0,R6
\ 00000016 761E SUB R6,R6,#+0x1
\ 00000018 0006 LSL R0,R0,#+0x18
\ 0000001A F6D1 BNE ??UART_DataSend_1
205 }
\ 0000001C 70BC POP {R4-R6}
\ 0000001E 01BC POP {R0}
\ 00000020 0047 BX R0 ;; return
206
207 /*******************************************************************************
208 * Function Name : UART_9BitDataSend
209 * Description : This function sends several 9 bits data bytes to the selected UART.
210 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
211 * Input 2 : A pointer to the data to send
212 * Input 3 : The data length
213 * Output : None
214 * Return : None
215 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
216 void UART_9BitDataSend(UART_TypeDef *UARTx, u16 *Data, u8 DataLength)
217 {
\ UART_9BitDataSend:
\ 00000000 70B5 PUSH {R4-R6,LR}
\ 00000002 041C MOV R4,R0
\ 00000004 0D1C MOV R5,R1
\ 00000006 161C MOV R6,R2
\ 00000008 04E0 B ??UART_9BitDataSend_0
218 while(DataLength--)
219 {
220 UART_9BitByteSend(UARTx,Data);
\ ??UART_9BitDataSend_1:
\ 0000000A 291C MOV R1,R5
\ 0000000C 201C MOV R0,R4
\ 0000000E ........ BL UART_9BitByteSend
221 Data++;
\ 00000012 AD1C ADD R5,R5,#+0x2
222 }
\ ??UART_9BitDataSend_0:
\ 00000014 301C MOV R0,R6
\ 00000016 761E SUB R6,R6,#+0x1
\ 00000018 0006 LSL R0,R0,#+0x18
\ 0000001A F6D1 BNE ??UART_9BitDataSend_1
223 }
\ 0000001C 70BC POP {R4-R6}
\ 0000001E 01BC POP {R0}
\ 00000020 0047 BX R0 ;; return
224
225 /*******************************************************************************
226 * Function Name : UART_StringSend
227 * Description : This function sends a string to the selected UART.
228 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
229 * Input 2 : A pointer to the string to send
230 * Output : None
231 * Return : None
232 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
233 void UART_StringSend(UART_TypeDef *UARTx, u8 *String)
234 {
\ UART_StringSend:
\ 00000000 30B5 PUSH {R4,R5,LR}
\ 00000002 041C MOV R4,R0
\ 00000004 0D1C MOV R5,R1
235 u8 *Data=String;
\ 00000006 04E0 B ??UART_StringSend_0
236 while(*Data != '\0')
237 UART_ByteSend(UARTx, Data++);
\ ??UART_StringSend_1:
\ 00000008 291C MOV R1,R5
\ 0000000A 201C MOV R0,R4
\ 0000000C ........ BL UART_ByteSend
\ 00000010 6D1C ADD R5,R5,#+0x1
\ ??UART_StringSend_0:
\ 00000012 2878 LDRB R0,[R5, #+0]
\ 00000014 0028 CMP R0,#+0
\ 00000016 F7D1 BNE ??UART_StringSend_1
238 *Data='\0';
\ 00000018 0020 MOV R0,#+0
\ 0000001A 2870 STRB R0,[R5, #+0]
239 UART_ByteSend(UARTx, Data);
\ 0000001C 291C MOV R1,R5
\ 0000001E 201C MOV R0,R4
\ 00000020 ........ BL UART_ByteSend
240 }
\ 00000024 30BC POP {R4,R5}
\ 00000026 01BC POP {R0}
\ 00000028 0047 BX R0 ;; return
241
242 /*******************************************************************************
243 * Function Name : UART_ByteReceive
244 * Description : This function gets a data byte from the selected UART.
245 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
246 * Input 2 : A pointer to the buffer where the data will be stored
247 * Input 3 : The time-out period
248 * Output : The received data
249 * Return : The UARTx.SR register contents
250 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
251 u16 UART_ByteReceive(UART_TypeDef *UARTx, u8 *Data, u8 TimeOut)
252 {
\ UART_ByteReceive:
\ 00000000 031C MOV R3,R0
253 u16 wStatus;
254 UARTx->TOR=TimeOut;// reload the Timeout counter
\ 00000002 8283 STRH R2,[R0, #+0x1C]
\ 00000004 FF22 MOV R2,#+0xFF
\ 00000006 8232 ADD R2,#+0x82 ;; #+0x181
255 while (!((wStatus=UARTx->SR) & (UART_TimeOutIdle|UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
\ ??UART_ByteReceive_0:
\ 00000008 988A LDRH R0,[R3, #+0x14]
\ 0000000A 1042 TST R0,R2
\ 0000000C FCD0 BEQ ??UART_ByteReceive_0
256 *Data = (u8)UARTx->RxBUFR; // then read the Receive Buffer Register
\ 0000000E 1A89 LDRH R2,[R3, #+0x8]
\ 00000010 0A70 STRB R2,[R1, #+0]
257 return wStatus;
\ 00000012 7047 BX LR ;; return
258 }
259
260 /*******************************************************************************
261 * Function Name : UART_9BitByteReceive
262 * Description : This function gets a 9 bits data byte from the selected UART.
263 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
264 * Input 2 : A pointer to the buffer where the data will be stored
265 * Input 3 : The time-out period value
266 * Output : The received data
267 * Return : The UARTx.SR register contents
268 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
269 u16 UART_9BitByteReceive(UART_TypeDef *UARTx, u16 *Data, u8 TimeOut)
270 {
\ UART_9BitByteReceive:
\ 00000000 031C MOV R3,R0
271 u16 wStatus;
272 UARTx->TOR=TimeOut;// reload the Timeout counter
\ 00000002 8283 STRH R2,[R0, #+0x1C]
\ 00000004 FF22 MOV R2,#+0xFF
\ 00000006 8232 ADD R2,#+0x82 ;; #+0x181
273 while (!((wStatus=UARTx->SR) & (UART_TimeOutIdle|UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
\ ??UART_9BitByteReceive_0:
\ 00000008 988A LDRH R0,[R3, #+0x14]
\ 0000000A 1042 TST R0,R2
\ 0000000C FCD0 BEQ ??UART_9BitByteReceive_0
274 *Data = (u16)UARTx->RxBUFR; // then read the RxBUFR
\ 0000000E 1A89 LDRH R2,[R3, #+0x8]
\ 00000010 0A80 STRH R2,[R1, #+0]
275 return wStatus;
\ 00000012 7047 BX LR ;; return
276 }
277
278 /*******************************************************************************
279 * Function Name : UART_DataReceive
280 * Description : This function gets 8 bits data bytes from the selected UART.
281 * Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
282 * Input 2 : A pointer to the buffer where the data will be stored
283 * Input 3 : The data length
284 * Input 4 : The time-out period value
285 * Output : The received data
286 * Return : The UARTx.SR register contents
287 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
288 u16 UART_DataReceive(UART_TypeDef *UARTx, u8 *Data, u8 DataLength, u8 TimeOut)
289 {
\ UART_DataReceive:
\ 00000000 F0B5 PUSH {R4-R7,LR}
\ 00000002 041C MOV R4,R0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -