⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm32f10x_usart.s79

📁 用于监视I2C通信总线
💻 S79
📖 第 1 页 / 共 5 页
字号:
//  645 *                  - USART_Prescaler: specifies the prescaler clock.
//  646 * Output         : None
//  647 * Return         : None
//  648 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock19 Using cfiCommon0
        CFI Function USART_SetPrescaler
        THUMB
//  649 void USART_SetPrescaler(USART_TypeDef* USARTx, u8 USART_Prescaler)
//  650 { 
//  651   /* Check the parameters */
//  652   assert_param(IS_USART_ALL_PERIPH(USARTx));
//  653   
//  654   /* Clear the USART prescaler */
//  655   USARTx->GTPR &= GTPR_MSB_Mask;
USART_SetPrescaler:
        LDRH     R2,[R0, #+24]
        ANDS     R2,R2,#0xFF00
        STRH     R2,[R0, #+24]
//  656   /* Set the USART prescaler */
//  657   USARTx->GTPR |= USART_Prescaler;
        LDRH     R2,[R0, #+24]
        ORRS     R1,R1,R2
        STRH     R1,[R0, #+24]
//  658 }
        BX       LR               ;; return
        CFI EndBlock cfiBlock19
//  659 
//  660 /*******************************************************************************
//  661 * Function Name  : USART_SmartCardCmd
//  662 * Description    : Enables or disables the USART抯 Smart Card mode.
//  663 * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
//  664 *                    peripheral. 
//  665 *                    Note: The Smart Card mode is not available for UART4 and UART5.
//  666 *                  - NewState: new state of the Smart Card mode.
//  667 *                    This parameter can be: ENABLE or DISABLE.
//  668 * Output         : None
//  669 * Return         : None
//  670 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock20 Using cfiCommon0
        CFI Function USART_SmartCardCmd
        THUMB
//  671 void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
//  672 {
//  673   /* Check the parameters */
//  674   assert_param(IS_USART_123_PERIPH(USARTx));
//  675   assert_param(IS_FUNCTIONAL_STATE(NewState));
//  676 
//  677   if (NewState != DISABLE)
USART_SmartCardCmd:
        CMP      R1,#+0
        LDRH     R1,[R0, #+20]
        BEQ.N    ??USART_SmartCardCmd_0
//  678   {
//  679     /* Enable the SC mode by setting the SCEN bit in the CR3 register */
//  680     USARTx->CR3 |= CR3_SCEN_Set;
        ORRS     R1,R1,#0x20
        STRH     R1,[R0, #+20]
        BX       LR
//  681   }
//  682   else
//  683   {
//  684     /* Disable the SC mode by clearing the SCEN bit in the CR3 register */
//  685     USARTx->CR3 &= CR3_SCEN_Reset;
??USART_SmartCardCmd_0:
        LDR.N    R2,??DataTable4  ;; 0xffdf
        B.N      ?Subroutine2
        CFI EndBlock cfiBlock20
//  686   }
//  687 }

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable4:
        DC32     0xffdf
//  688 
//  689 /*******************************************************************************
//  690 * Function Name  : USART_SmartCardNACKCmd
//  691 * Description    : Enables or disables NACK transmission.
//  692 * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
//  693 *                    peripheral. 
//  694 *                    Note: The Smart Card mode is not available for UART4 and UART5.
//  695 *                  - NewState: new state of the NACK transmission.
//  696 *                    This parameter can be: ENABLE or DISABLE.
//  697 * Output         : None
//  698 * Return         : None
//  699 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock21 Using cfiCommon0
        CFI Function USART_SmartCardNACKCmd
        THUMB
//  700 void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState)
//  701 {
//  702   /* Check the parameters */
//  703   assert_param(IS_USART_123_PERIPH(USARTx));  
//  704   assert_param(IS_FUNCTIONAL_STATE(NewState));
//  705 
//  706   if (NewState != DISABLE)
USART_SmartCardNACKCmd:
        CMP      R1,#+0
        LDRH     R1,[R0, #+20]
        BEQ.N    ??USART_SmartCardNACKCmd_0
//  707   {
//  708     /* Enable the NACK transmission by setting the NACK bit in the CR3 register */
//  709     USARTx->CR3 |= CR3_NACK_Set;
        ORRS     R1,R1,#0x10
        STRH     R1,[R0, #+20]
        BX       LR
//  710   }
//  711   else
//  712   {
//  713     /* Disable the NACK transmission by clearing the NACK bit in the CR3 register */
//  714     USARTx->CR3 &= CR3_NACK_Reset;
??USART_SmartCardNACKCmd_0:
        LDR.N    R2,??Subroutine2_0  ;; 0xffef
        CFI EndBlock cfiBlock21
        REQUIRE ?Subroutine2
        ;; // Fall through to label ?Subroutine2
//  715   }
//  716 }

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock22 Using cfiCommon0
        CFI NoFunction
        THUMB
?Subroutine2:
        ANDS     R2,R2,R1
        STRH     R2,[R0, #+20]
        BX       LR               ;; return
        Nop      
        DATA
??Subroutine2_0:
        DC32     0xffef
        CFI EndBlock cfiBlock22
//  717 
//  718 /*******************************************************************************
//  719 * Function Name  : USART_HalfDuplexCmd
//  720 * Description    : Enables or disables the USART抯 Half Duplex communication.
//  721 * Input          : - USARTx: Select the USART or the UART peripheral. 
//  722 *                    This parameter can be one of the following values:
//  723 *                     - USART1, USART2, USART3, UART4 or UART5.
//  724 *                  - NewState: new state of the USART Communication.
//  725 *                    This parameter can be: ENABLE or DISABLE.
//  726 * Output         : None
//  727 * Return         : None
//  728 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock23 Using cfiCommon0
        CFI Function USART_HalfDuplexCmd
        THUMB
//  729 void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState)
//  730 {
//  731   /* Check the parameters */
//  732   assert_param(IS_USART_ALL_PERIPH(USARTx));
//  733   assert_param(IS_FUNCTIONAL_STATE(NewState));
//  734   
//  735   if (NewState != DISABLE)
USART_HalfDuplexCmd:
        CMP      R1,#+0
        LDRH     R1,[R0, #+20]
        BEQ.N    ??USART_HalfDuplexCmd_0
//  736   {
//  737     /* Enable the Half-Duplex mode by setting the HDSEL bit in the CR3 register */
//  738     USARTx->CR3 |= CR3_HDSEL_Set;
        ORRS     R1,R1,#0x8
        STRH     R1,[R0, #+20]
        BX       LR
//  739   }
//  740   else
//  741   {
//  742     /* Disable the Half-Duplex mode by clearing the HDSEL bit in the CR3 register */
//  743     USARTx->CR3 &= CR3_HDSEL_Reset;
??USART_HalfDuplexCmd_0:
        LDR.N    R2,??USART_HalfDuplexCmd_1  ;; 0xfff7
        B.N      ?Subroutine2
        Nop      
        DATA
??USART_HalfDuplexCmd_1:
        DC32     0xfff7
        CFI EndBlock cfiBlock23
//  744   }
//  745 }
//  746 
//  747 /*******************************************************************************
//  748 * Function Name  : USART_IrDAConfig
//  749 * Description    : Configures the USART抯 IrDA interface.
//  750 * Input          : - USARTx: Select the USART or the UART peripheral. 
//  751 *                    This parameter can be one of the following values:
//  752 *                     - USART1, USART2, USART3, UART4 or UART5.
//  753 *                  - USART_IrDAMode: specifies the IrDA mode.
//  754 *                    This parameter can be one of the following values:
//  755 *                       - USART_IrDAMode_LowPower
//  756 *                       - USART_IrDAMode_Normal
//  757 * Output         : None
//  758 * Return         : None
//  759 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock24 Using cfiCommon0
        CFI Function USART_IrDAConfig
        THUMB
//  760 void USART_IrDAConfig(USART_TypeDef* USARTx, u16 USART_IrDAMode)
//  761 {
//  762   /* Check the parameters */
//  763   assert_param(IS_USART_ALL_PERIPH(USARTx));
//  764   assert_param(IS_USART_IRDA_MODE(USART_IrDAMode));
//  765     
//  766   USARTx->CR3 &= CR3_IRLP_Mask;
USART_IrDAConfig:
        LDRH     R2,[R0, #+20]
        LDR.N    R3,??USART_IrDAConfig_0  ;; 0xfffb
        ANDS     R3,R3,R2
        STRH     R3,[R0, #+20]
//  767   USARTx->CR3 |= USART_IrDAMode;
        LDRH     R2,[R0, #+20]
        ORRS     R1,R1,R2
        STRH     R1,[R0, #+20]
//  768 }
        BX       LR               ;; return
        DATA
??USART_IrDAConfig_0:
        DC32     0xfffb
        CFI EndBlock cfiBlock24
//  769 
//  770 /*******************************************************************************
//  771 * Function Name  : USART_IrDACmd
//  772 * Description    : Enables or disables the USART抯 IrDA interface.
//  773 * Input          : - USARTx: Select the USART or the UART peripheral. 
//  774 *                    This parameter can be one of the following values:
//  775 *                     - USART1, USART2, USART3, UART4 or UART5.
//  776 *                  - NewState: new state of the IrDA mode.
//  777 *                    This parameter can be: ENABLE or DISABLE.
//  778 * Output         : None
//  779 * Return         : None
//  780 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock25 Using cfiCommon0
        CFI Function USART_IrDACmd
        THUMB
//  781 void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState)
//  782 {
//  783   /* Check the parameters */
//  784   assert_param(IS_USART_ALL_PERIPH(USARTx));
//  785   assert_param(IS_FUNCTIONAL_STATE(NewState));
//  786     
//  787   if (NewState != DISABLE)
USART_IrDACmd:
        CMP      R1,#+0
        LDRH     R1,[R0, #+20]
        BEQ.N    ??USART_IrDACmd_0
//  788   {
//  789     /* Enable the IrDA mode by setting the IREN bit in the CR3 register */
//  790     USARTx->CR3 |= CR3_IREN_Set;
        ORRS     R1,R1,#0x2
        STRH     R1,[R0, #+20]
        BX       LR
//  791   }
//  792   else
//  793   {
//  794     /* Disable the IrDA mode by clearing the IREN bit in the CR3 register */
//  795     USARTx->CR3 &= CR3_IREN_Reset;
??USART_IrDACmd_0:
        LDR.N    R2,??DataTable5  ;; 0xfffd
        B.N      ?Subroutine2
        CFI EndBlock cfiBlock25
//  796   }
//  797 }

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable5:
        DC32     0xfffd
//  798 
//  799 /*******************************************************************************
//  800 * Function Name  : USART_GetFlagStatus
//  801 * Description    : Checks whether the specified USART flag is set or not.
//  802 * Input          : - USARTx: Select the USART or the UART peripheral. 
//  803 *                    This parameter can be one of the following values:
//  804 *                     - USART1, USART2, USART3, UART4 or UART5.
//  805 *                  - USART_FLAG: specifies the flag to check.
//  806 *                    This parameter can be one of the following values:
//  807 *                       - USART_FLAG_CTS:  CTS Change flag (not available for 
//  808 *                                          UART4 and UART5)
//  809 *                       - USART_FLAG_LBD:  LIN Break detection flag
//  810 *                       - USART_FLAG_TXE:  Transmit data register empty flag
//  811 *                       - USART_FLAG_TC:   Transmission Complete flag
//  812 *                       - USART_FLAG_RXNE: Receive data register not empty flag
//  813 *                       - USART_FLAG_IDLE: Idle Line detection flag
//  814 *                       - USART_FLAG_ORE:  OverRun Error flag
//  815 *                       - USART_FLAG_NE:   Noise Error flag
//  816 *                       - USART_FLAG_FE:   Framing Error flag
//  817 *                       - USART_FLAG_PE:   Parity Error flag
//  818 * Output         : None
//  819 * Return         : The new state of USART_FLAG (SET or RESET).
//  820 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock26 Using cfiCommon0
        CFI Function U

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -