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

📄 stm32f10x_usart.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
    530            USARTx->CR2 &= CR2_LBDL_Mask;
   \                     USART_LINBreakDetectLengthConfig:
   \   00000000   028A               LDRH     R2,[R0, #+16]
   \   00000002   ....               LDR.N    R3,??DataTable4  ;; 0xffdf
   \   00000004   1340               ANDS     R3,R3,R2
   \   00000006   0382               STRH     R3,[R0, #+16]
    531            USARTx->CR2 |= USART_LINBreakDetectLength;  
   \   00000008   028A               LDRH     R2,[R0, #+16]
   \   0000000A   1143               ORRS     R1,R1,R2
   \   0000000C   0182               STRH     R1,[R0, #+16]
    532          }
   \   0000000E   7047               BX       LR               ;; return
    533          
    534          /*******************************************************************************
    535          * Function Name  : USART_LINCmd
    536          * Description    : Enables or disables the USART抯 LIN mode.
    537          * Input          : - USARTx: Select the USART or the UART peripheral. 
    538          *                    This parameter can be one of the following values:
    539          *                     - USART1, USART2, USART3, UART4 or UART5.
    540          *                  - NewState: new state of the USART LIN mode.
    541          *                    This parameter can be: ENABLE or DISABLE.
    542          * Output         : None
    543          * Return         : None
    544          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    545          void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState)
    546          {
    547            /* Check the parameters */
    548            assert_param(IS_USART_ALL_PERIPH(USARTx));
    549            assert_param(IS_FUNCTIONAL_STATE(NewState));
    550            
    551            if (NewState != DISABLE)
   \                     USART_LINCmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   018A               LDRH     R1,[R0, #+16]
   \   00000004   03D0               BEQ.N    ??USART_LINCmd_0
    552            {
    553              /* Enable the LIN mode by setting the LINEN bit in the CR2 register */
    554              USARTx->CR2 |= CR2_LINEN_Set;
   \   00000006   51F48041           ORRS     R1,R1,#0x4000
   \   0000000A   0182               STRH     R1,[R0, #+16]
   \   0000000C   7047               BX       LR
    555            }
    556            else
    557            {
    558              /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */
    559              USARTx->CR2 &= CR2_LINEN_Reset;
   \                     ??USART_LINCmd_0:
   \   0000000E   024A               LDR.N    R2,??USART_LINCmd_1  ;; 0xbfff
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   0282               STRH     R2,[R0, #+16]
    560            }
    561          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??USART_LINCmd_1:
   \   00000018   FFBF0000           DC32     0xbfff
    562          
    563          /*******************************************************************************
    564          * Function Name  : USART_SendData
    565          * Description    : Transmits single data through the USARTx peripheral.
    566          * Input          : - USARTx: Select the USART or the UART peripheral. 
    567          *                    This parameter can be one of the following values:
    568          *                     - USART1, USART2, USART3, UART4 or UART5.
    569          *                  - Data: the data to transmit.
    570          * Output         : None
    571          * Return         : None
    572          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    573          void USART_SendData(USART_TypeDef* USARTx, u16 Data)
    574          {
    575            /* Check the parameters */
    576            assert_param(IS_USART_ALL_PERIPH(USARTx));
    577            assert_param(IS_USART_DATA(Data)); 
    578              
    579            /* Transmit Data */
    580            USARTx->DR = (Data & (u16)0x01FF);
   \                     USART_SendData:
   \   00000000   C905               LSLS     R1,R1,#+23
   \   00000002   C90D               LSRS     R1,R1,#+23
   \   00000004   8180               STRH     R1,[R0, #+4]
    581          }
   \   00000006   7047               BX       LR               ;; return
    582          
    583          /*******************************************************************************
    584          * Function Name  : USART_ReceiveData
    585          * Description    : Returns the most recent received data by the USARTx peripheral.
    586          * Input          : - USARTx: Select the USART or the UART peripheral. 
    587          *                    This parameter can be one of the following values:
    588          *                     - USART1, USART2, USART3, UART4 or UART5.
    589          * Output         : None
    590          * Return         : The received data.
    591          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    592          u16 USART_ReceiveData(USART_TypeDef* USARTx)
    593          {
    594            /* Check the parameters */
    595            assert_param(IS_USART_ALL_PERIPH(USARTx));
    596            
    597            /* Receive Data */
    598            return (u16)(USARTx->DR & (u16)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
    599          }
    600          
    601          /*******************************************************************************
    602          * Function Name  : USART_SendBreak
    603          * Description    : Transmits break characters.
    604          * Input          : - USARTx: Select the USART or the UART peripheral. 
    605          *                    This parameter can be one of the following values:
    606          *                     - USART1, USART2, USART3, UART4 or UART5.
    607          * Output         : None
    608          * Return         : None
    609          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    610          void USART_SendBreak(USART_TypeDef* USARTx)
    611          {
    612            /* Check the parameters */
    613            assert_param(IS_USART_ALL_PERIPH(USARTx));
    614            
    615            /* Send break characters */
    616            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]
    617          }
   \   00000008   7047               BX       LR               ;; return
    618          
    619          /*******************************************************************************
    620          * Function Name  : USART_SetGuardTime
    621          * Description    : Sets the specified USART guard time.
    622          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    623          *                    peripheral.
    624          *                  Note: The guard time bits are not available for UART4 and UART5.
    625          *                  - USART_GuardTime: specifies the guard time.
    626          * Output         : None
    627          * Return         : None
    628          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    629          void USART_SetGuardTime(USART_TypeDef* USARTx, u8 USART_GuardTime)
    630          {    
    631            /* Check the parameters */
    632            assert_param(IS_USART_123_PERIPH(USARTx));
    633            
    634            /* Clear the USART Guard time */
    635            USARTx->GTPR &= GTPR_LSB_Mask;
   \                     USART_SetGuardTime:
   \   00000000   028B               LDRH     R2,[R0, #+24]
   \   00000002   D2B2               UXTB     R2,R2
   \   00000004   0283               STRH     R2,[R0, #+24]
    636            /* Set the USART guard time */
    637            USARTx->GTPR |= (u16)((u16)USART_GuardTime << 0x08);
   \   00000006   028B               LDRH     R2,[R0, #+24]
   \   00000008   52EA0121           ORRS     R1,R2,R1, LSL #+8
   \   0000000C   0183               STRH     R1,[R0, #+24]
    638          }
   \   0000000E   7047               BX       LR               ;; return
    639          
    640          /*******************************************************************************
    641          * Function Name  : USART_SetPrescaler
    642          * Description    : Sets the system clock prescaler.
    643          * Input          : - USARTx: Select the USART or the UART peripheral. 
    644          *                    This parameter can be one of the following values:
    645          *                     - USART1, USART2, USART3, UART4 or UART5.
    646          *                  Note: The function is used for IrDA mode with UART4 and UART5.
    647          *                  - USART_Prescaler: specifies the prescaler clock.
    648          * Output         : None
    649          * Return         : None
    650          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    651          void USART_SetPrescaler(USART_TypeDef* USARTx, u8 USART_Prescaler)
    652          { 
    653            /* Check the parameters */
    654            assert_param(IS_USART_ALL_PERIPH(USARTx));
    655            
    656            /* Clear the USART prescaler */
    657            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]
    658            /* Set the USART prescaler */
    659            USARTx->GTPR |= USART_Prescaler;
   \   00000008   028B               LDRH     R2,[R0, #+24]
   \   0000000A   1143               ORRS     R1,R1,R2
   \   0000000C   0183               STRH     R1,[R0, #+24]
    660          }
   \   0000000E   7047               BX       LR               ;; return
    661          
    662          /*******************************************************************************
    663          * Function Name  : USART_SmartCardCmd
    664          * Description    : Enables or disables the USART抯 Smart Card mode.
    665          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    666          *                    peripheral. 
    667          *                    Note: The Smart Card mode is not available for UART4 and UART5.
    668          *                  - NewState: new state of the Smart Card mode.
    669          *                    This parameter can be: ENABLE or DISABLE.
    670          * Output         : None
    671          * Return         : None
    672          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    673          void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
    674          {
    675            /* Check the parameters */
    676            assert_param(I

⌨️ 快捷键说明

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