📄 stm32f10x_usart.lst
字号:
553
554 /**
555 * @brief Enables or disables the USART抯 LIN mode.
556 * @param USARTx: Select the USART or the UART peripheral.
557 * This parameter can be one of the following values:
558 * USART1, USART2, USART3, UART4 or UART5.
559 * @param NewState: new state of the USART LIN mode.
560 * This parameter can be: ENABLE or DISABLE.
561 * @retval None
562 */
\ In section .text, align 2, keep-with-next
563 void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState)
564 {
565 /* Check the parameters */
566 assert_param(IS_USART_ALL_PERIPH(USARTx));
567 assert_param(IS_FUNCTIONAL_STATE(NewState));
568
569 if (NewState != DISABLE)
\ USART_LINCmd:
\ 00000000 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000002 0029 CMP R1,#+0
\ 00000004 04D0 BEQ.N ??USART_LINCmd_0
570 {
571 /* Enable the LIN mode by setting the LINEN bit in the CR2 register */
572 USARTx->CR2 |= CR2_LINEN_Set;
\ 00000006 028A LDRH R2,[R0, #+16]
\ 00000008 52F48042 ORRS R2,R2,#0x4000
\ 0000000C 0282 STRH R2,[R0, #+16]
\ 0000000E 04E0 B.N ??USART_LINCmd_1
573 }
574 else
575 {
576 /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */
577 USARTx->CR2 &= CR2_LINEN_Reset;
\ ??USART_LINCmd_0:
\ 00000010 028A LDRH R2,[R0, #+16]
\ 00000012 4BF6FF73 MOVW R3,#+49151
\ 00000016 1A40 ANDS R2,R3,R2
\ 00000018 0282 STRH R2,[R0, #+16]
578 }
579 }
\ ??USART_LINCmd_1:
\ 0000001A 7047 BX LR ;; return
580
581 /**
582 * @brief Transmits single data through the USARTx peripheral.
583 * @param USARTx: Select the USART or the UART peripheral.
584 * This parameter can be one of the following values:
585 * USART1, USART2, USART3, UART4 or UART5.
586 * @param Data: the data to transmit.
587 * @retval None
588 */
\ In section .text, align 2, keep-with-next
589 void USART_SendData(USART_TypeDef* USARTx, uint16_t Data)
590 {
591 /* Check the parameters */
592 assert_param(IS_USART_ALL_PERIPH(USARTx));
593 assert_param(IS_USART_DATA(Data));
594
595 /* Transmit Data */
596 USARTx->DR = (Data & (uint16_t)0x01FF);
\ USART_SendData:
\ 00000000 CA05 LSLS R2,R1,#+23
\ 00000002 D20D LSRS R2,R2,#+23
\ 00000004 8280 STRH R2,[R0, #+4]
597 }
\ 00000006 7047 BX LR ;; return
598
599 /**
600 * @brief Returns the most recent received data by the USARTx peripheral.
601 * @param USARTx: Select the USART or the UART peripheral.
602 * This parameter can be one of the following values:
603 * USART1, USART2, USART3, UART4 or UART5.
604 * @retval The received data.
605 */
\ In section .text, align 2, keep-with-next
606 uint16_t USART_ReceiveData(USART_TypeDef* USARTx)
607 {
608 /* Check the parameters */
609 assert_param(IS_USART_ALL_PERIPH(USARTx));
610
611 /* Receive Data */
612 return (uint16_t)(USARTx->DR & (uint16_t)0x01FF);
\ USART_ReceiveData:
\ 00000000 8088 LDRH R0,[R0, #+4]
\ 00000002 C005 LSLS R0,R0,#+23
\ 00000004 C00D LSRS R0,R0,#+23
\ 00000006 7047 BX LR ;; return
613 }
614
615 /**
616 * @brief Transmits break characters.
617 * @param USARTx: Select the USART or the UART peripheral.
618 * This parameter can be one of the following values:
619 * USART1, USART2, USART3, UART4 or UART5.
620 * @retval None
621 */
\ In section .text, align 2, keep-with-next
622 void USART_SendBreak(USART_TypeDef* USARTx)
623 {
624 /* Check the parameters */
625 assert_param(IS_USART_ALL_PERIPH(USARTx));
626
627 /* Send break characters */
628 USARTx->CR1 |= CR1_SBK_Set;
\ USART_SendBreak:
\ 00000000 8189 LDRH R1,[R0, #+12]
\ 00000002 51F00101 ORRS R1,R1,#0x1
\ 00000006 8181 STRH R1,[R0, #+12]
629 }
\ 00000008 7047 BX LR ;; return
630
631 /**
632 * @brief Sets the specified USART guard time.
633 * @param USARTx: where x can be 1, 2 or 3 to select the USART peripheral.
634 * @param USART_GuardTime: specifies the guard time.
635 * @note The guard time bits are not available for UART4 and UART5.
636 * @retval None
637 */
\ In section .text, align 2, keep-with-next
638 void USART_SetGuardTime(USART_TypeDef* USARTx, uint8_t USART_GuardTime)
639 {
640 /* Check the parameters */
641 assert_param(IS_USART_123_PERIPH(USARTx));
642
643 /* Clear the USART Guard time */
644 USARTx->GTPR &= GTPR_LSB_Mask;
\ USART_SetGuardTime:
\ 00000000 028B LDRH R2,[R0, #+24]
\ 00000002 D2B2 UXTB R2,R2 ;; ZeroExt R2,R2,#+24,#+24
\ 00000004 0283 STRH R2,[R0, #+24]
645 /* Set the USART guard time */
646 USARTx->GTPR |= (uint16_t)((uint16_t)USART_GuardTime << 0x08);
\ 00000006 028B LDRH R2,[R0, #+24]
\ 00000008 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 0000000A 52EA0122 ORRS R2,R2,R1, LSL #+8
\ 0000000E 0283 STRH R2,[R0, #+24]
647 }
\ 00000010 7047 BX LR ;; return
648
649 /**
650 * @brief Sets the system clock prescaler.
651 * @param USARTx: Select the USART or the UART peripheral.
652 * This parameter can be one of the following values:
653 * USART1, USART2, USART3, UART4 or UART5.
654 * @param USART_Prescaler: specifies the prescaler clock.
655 * @note The function is used for IrDA mode with UART4 and UART5.
656 * @retval None
657 */
\ In section .text, align 2, keep-with-next
658 void USART_SetPrescaler(USART_TypeDef* USARTx, uint8_t USART_Prescaler)
659 {
660 /* Check the parameters */
661 assert_param(IS_USART_ALL_PERIPH(USARTx));
662
663 /* Clear the USART prescaler */
664 USARTx->GTPR &= GTPR_MSB_Mask;
\ USART_SetPrescaler:
\ 00000000 028B LDRH R2,[R0, #+24]
\ 00000002 12F47F42 ANDS R2,R2,#0xFF00
\ 00000006 0283 STRH R2,[R0, #+24]
665 /* Set the USART prescaler */
666 USARTx->GTPR |= USART_Prescaler;
\ 00000008 028B LDRH R2,[R0, #+24]
\ 0000000A C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 0000000C 0A43 ORRS R2,R1,R2
\ 0000000E 0283 STRH R2,[R0, #+24]
667 }
\ 00000010 7047 BX LR ;; return
668
669 /**
670 * @brief Enables or disables the USART抯 Smart Card mode.
671 * @param USARTx: where x can be 1, 2 or 3 to select the USART peripheral.
672 * @param NewState: new state of the Smart Card mode.
673 * This parameter can be: ENABLE or DISABLE.
674 * @note The Smart Card mode is not available for UART4 and UART5.
675 * @retval None
676 */
\ In section .text, align 2, keep-with-next
677 void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
678 {
679 /* Check the parameters */
680 assert_param(IS_USART_123_PERIPH(USARTx));
681 assert_param(IS_FUNCTIONAL_STATE(NewState));
682 if (NewState != DISABLE)
\ USART_SmartCardCmd:
\ 00000000 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000002 0029 CMP R1,#+0
\ 00000004 04D0 BEQ.N ??USART_SmartCardCmd_0
683 {
684 /* Enable the SC mode by setting the SCEN bit in the CR3 register */
685 USARTx->CR3 |= CR3_SCEN_Set;
\ 00000006 828A LDRH R2,[R0, #+20]
\ 00000008 52F02002 ORRS R2,R2,#0x20
\ 0000000C 8282 STRH R2,[R0, #+20]
\ 0000000E 04E0 B.N ??USART_SmartCardCmd_1
686 }
687 else
688 {
689 /* Disable the SC mode by clearing the SCEN bit in the CR3 register */
690 USARTx->CR3 &= CR3_SCEN_Reset;
\ ??USART_SmartCardCmd_0:
\ 00000010 828A LDRH R2,[R0, #+20]
\ 00000012 4FF6DF73 MOVW R3,#+65503
\ 00000016 1A40 ANDS R2,R3,R2
\ 00000018 8282 STRH R2,[R0, #+20]
691 }
692 }
\ ??USART_SmartCardCmd_1:
\ 0000001A 7047 BX LR ;; return
693
694 /**
695 * @brief Enables or disables NACK transmission.
696 * @param USARTx: where x can be 1, 2 or 3 to select the USART peripheral.
697 * @param NewState: new state of the NACK transmission.
698 * This parameter can be: ENABLE or DISABLE.
699 * @note The Smart Card mode is not available for UART4 and UART5.
700 * @retval None
701 */
\ In section .text, align 2, keep-with-next
702 void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState)
703 {
704 /* Check the parameters */
705
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -