📄 stm32f10x_usart.lst
字号:
\ 0000001C 1030 ADDS R0,R0,#+16
\ 0000001E 00E0 B.N ??USART_ITConfig_1
384 }
385 else /* The IT is in CR3 register */
386 {
387 usartxbase += 0x14;
\ ??USART_ITConfig_2:
\ 00000020 1430 ADDS R0,R0,#+20
388 }
389 if (NewState != DISABLE)
\ ??USART_ITConfig_1:
\ 00000022 002A CMP R2,#+0
\ 00000024 0168 LDR R1,[R0, #+0]
\ 00000026 02D0 BEQ.N ??USART_ITConfig_3
390 {
391 *(vu32*)usartxbase |= itmask;
\ 00000028 0C43 ORRS R4,R4,R1
\ 0000002A 0460 STR R4,[R0, #+0]
\ 0000002C 10BD POP {R4,PC}
392 }
393 else
394 {
395 *(vu32*)usartxbase &= ~itmask;
\ ??USART_ITConfig_3:
\ 0000002E A143 BICS R1,R1,R4
\ 00000030 0160 STR R1,[R0, #+0]
396 }
397 }
\ 00000032 10BD POP {R4,PC} ;; return
398
399 /*******************************************************************************
400 * Function Name : USART_DMACmd
401 * Description : Enables or disables the USART抯 DMA interface.
402 * Input : - USARTx: Select the USART or the UART peripheral.
403 * This parameter can be one of the following values:
404 * - USART1, USART2, USART3 or UART4.
405 * Note: The DMA mode is not available for UART5.
406 * - USART_DMAReq: specifies the DMA request.
407 * This parameter can be any combination of the following values:
408 * - USART_DMAReq_Tx: USART DMA transmit request
409 * - USART_DMAReq_Rx: USART DMA receive request
410 * - NewState: new state of the DMA Request sources.
411 * This parameter can be: ENABLE or DISABLE.
412 * Output : None
413 * Return : None
414 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
415 void USART_DMACmd(USART_TypeDef* USARTx, u16 USART_DMAReq, FunctionalState NewState)
416 {
417 /* Check the parameters */
418 assert_param(IS_USART_1234_PERIPH(USARTx));
419 assert_param(IS_USART_DMAREQ(USART_DMAReq));
420 assert_param(IS_FUNCTIONAL_STATE(NewState));
421
422 if (NewState != DISABLE)
\ USART_DMACmd:
\ 00000000 002A CMP R2,#+0
\ 00000002 828A LDRH R2,[R0, #+20]
\ 00000004 02D0 BEQ.N ??USART_DMACmd_0
423 {
424 /* Enable the DMA transfer for selected requests by setting the DMAT and/or
425 DMAR bits in the USART CR3 register */
426 USARTx->CR3 |= USART_DMAReq;
\ 00000006 1143 ORRS R1,R1,R2
\ 00000008 8182 STRH R1,[R0, #+20]
\ 0000000A 7047 BX LR
427 }
428 else
429 {
430 /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
431 DMAR bits in the USART CR3 register */
432 USARTx->CR3 &= (u16)~USART_DMAReq;
\ ??USART_DMACmd_0:
\ 0000000C 8A43 BICS R2,R2,R1
\ 0000000E 8282 STRH R2,[R0, #+20]
433 }
434 }
\ 00000010 7047 BX LR ;; return
435
436 /*******************************************************************************
437 * Function Name : USART_SetAddress
438 * Description : Sets the address of the USART node.
439 * Input : - USARTx: Select the USART or the UART peripheral.
440 * This parameter can be one of the following values:
441 * - USART1, USART2, USART3, UART4 or UART5.
442 * - USART_Address: Indicates the address of the USART node.
443 * Output : None
444 * Return : None
445 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
446 void USART_SetAddress(USART_TypeDef* USARTx, u8 USART_Address)
447 {
448 /* Check the parameters */
449 assert_param(IS_USART_ALL_PERIPH(USARTx));
450 assert_param(IS_USART_ADDRESS(USART_Address));
451
452 /* Clear the USART address */
453 USARTx->CR2 &= CR2_Address_Mask;
\ USART_SetAddress:
\ 00000000 028A LDRH R2,[R0, #+16]
\ 00000002 034B LDR.N R3,??USART_SetAddress_0 ;; 0xfff0
\ 00000004 1340 ANDS R3,R3,R2
\ 00000006 0382 STRH R3,[R0, #+16]
454 /* Set the USART address node */
455 USARTx->CR2 |= USART_Address;
\ 00000008 028A LDRH R2,[R0, #+16]
\ 0000000A 1143 ORRS R1,R1,R2
\ 0000000C 0182 STRH R1,[R0, #+16]
456 }
\ 0000000E 7047 BX LR ;; return
\ ??USART_SetAddress_0:
\ 00000010 F0FF0000 DC32 0xfff0
457
458 /*******************************************************************************
459 * Function Name : USART_WakeUpConfig
460 * Description : Selects the USART WakeUp method.
461 * Input : - USARTx: Select the USART or the UART peripheral.
462 * This parameter can be one of the following values:
463 * - USART1, USART2, USART3, UART4 or UART5.
464 * - USART_WakeUp: specifies the USART wakeup method.
465 * This parameter can be one of the following values:
466 * - USART_WakeUp_IdleLine: WakeUp by an idle line detection
467 * - USART_WakeUp_AddressMark: WakeUp by an address mark
468 * Output : None
469 * Return : None
470 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
471 void USART_WakeUpConfig(USART_TypeDef* USARTx, u16 USART_WakeUp)
472 {
473 /* Check the parameters */
474 assert_param(IS_USART_ALL_PERIPH(USARTx));
475 assert_param(IS_USART_WAKEUP(USART_WakeUp));
476
477 USARTx->CR1 &= CR1_WAKE_Mask;
\ USART_WakeUpConfig:
\ 00000000 8289 LDRH R2,[R0, #+12]
\ 00000002 034B LDR.N R3,??USART_WakeUpConfig_0 ;; 0xf7ff
\ 00000004 1340 ANDS R3,R3,R2
\ 00000006 8381 STRH R3,[R0, #+12]
478 USARTx->CR1 |= USART_WakeUp;
\ 00000008 8289 LDRH R2,[R0, #+12]
\ 0000000A 1143 ORRS R1,R1,R2
\ 0000000C 8181 STRH R1,[R0, #+12]
479 }
\ 0000000E 7047 BX LR ;; return
\ ??USART_WakeUpConfig_0:
\ 00000010 FFF70000 DC32 0xf7ff
480
481 /*******************************************************************************
482 * Function Name : USART_ReceiverWakeUpCmd
483 * Description : Determines if the USART is in mute mode or not.
484 * Input : - USARTx: Select the USART or the UART peripheral.
485 * This parameter can be one of the following values:
486 * - USART1, USART2, USART3, UART4 or UART5.
487 * - NewState: new state of the USART mute mode.
488 * This parameter can be: ENABLE or DISABLE.
489 * Output : None
490 * Return : None
491 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
492 void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState)
493 {
494 /* Check the parameters */
495 assert_param(IS_USART_ALL_PERIPH(USARTx));
496 assert_param(IS_FUNCTIONAL_STATE(NewState));
497
498 if (NewState != DISABLE)
\ USART_ReceiverWakeUpCmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 8189 LDRH R1,[R0, #+12]
\ 00000004 03D0 BEQ.N ??USART_ReceiverWakeUpCmd_0
499 {
500 /* Enable the USART mute mode by setting the RWU bit in the CR1 register */
501 USARTx->CR1 |= CR1_RWU_Set;
\ 00000006 51F00201 ORRS R1,R1,#0x2
\ 0000000A 8181 STRH R1,[R0, #+12]
\ 0000000C 7047 BX LR
502 }
503 else
504 {
505 /* Disable the USART mute mode by clearing the RWU bit in the CR1 register */
506 USARTx->CR1 &= CR1_RWU_Reset;
\ ??USART_ReceiverWakeUpCmd_0:
\ 0000000E .... LDR.N R2,??DataTable5 ;; 0xfffd
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 8281 STRH R2,[R0, #+12]
507 }
508 }
\ 00000014 7047 BX LR ;; return
509
510 /*******************************************************************************
511 * Function Name : USART_LINBreakDetectLengthConfig
512 * Description : Sets the USART LIN Break detection length.
513 * Input : - USARTx: Select the USART or the UART peripheral.
514 * This parameter can be one of the following values:
515 * - USART1, USART2, USART3, UART4 or UART5.
516 * - USART_LINBreakDetectLength: specifies the LIN break
517 * detection length.
518 * This parameter can be one of the following values:
519 * - USART_LINBreakDetectLength_10b: 10-bit break detection
520 * - USART_LINBreakDetectLength_11b: 11-bit break detection
521 * Output : None
522 * Return : None
523 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
524 void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, u16 USART_LINBreakDetectLength)
525 {
526 /* Check the parameters */
527 assert_param(IS_USART_ALL_PERIPH(USARTx));
528 assert_param(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength));
529
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -