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

📄 stm32f10x_usart.lst

📁 完成数据的采集
💻 LST
📖 第 1 页 / 共 4 页
字号:
    688          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    689          *                    peripheral.
    690          *                  - USART_FLAG: specifies the flag to check.
    691          *                    This parameter can be one of the following values:
    692          *                       - USART_FLAG_CTS
    693          *                       - USART_FLAG_LBD
    694          *                       - USART_FLAG_TXE
    695          *                       - USART_FLAG_TC
    696          *                       - USART_FLAG_RXNE
    697          *                       - USART_FLAG_IDLE
    698          *                       - USART_FLAG_ORE
    699          *                       - USART_FLAG_NE
    700          *                       - USART_FLAG_FE
    701          *                       - USART_FLAG_PE
    702          * Output         : None
    703          * Return         : The new state of USART_FLAG (SET or RESET).
    704          *******************************************************************************/
    705          FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, u16 USART_FLAG)
    706          {
    707            FlagStatus bitstatus = RESET;
    708            
    709            /* Check the parameters */
    710            assert_param(IS_USART_FLAG(USART_FLAG));
    711            
    712            if ((USARTx->SR & USART_FLAG) != (u16)RESET)
    713            {
    714              bitstatus = SET;
    715            }
    716            else
    717            {
    718              bitstatus = RESET;
    719            }
    720            return bitstatus;
    721          }
    722          
    723          /*******************************************************************************
    724          * Function Name  : USART_ClearFlag
    725          * Description    : Clears the USARTx's pending flags.
    726          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    727          *                    peripheral.
    728          *                  - USART_FLAG: specifies the flag to clear.
    729          *                    This parameter can be any combination of the following values:
    730          *                       - USART_FLAG_CTS
    731          *                       - USART_FLAG_LBD
    732          *                       - USART_FLAG_TXE
    733          *                       - USART_FLAG_TC
    734          *                       - USART_FLAG_RXNE
    735          *                       - USART_FLAG_IDLE
    736          *                       - USART_FLAG_ORE
    737          *                       - USART_FLAG_NE
    738          *                       - USART_FLAG_FE
    739          *                       - USART_FLAG_PE
    740          * Output         : None
    741          * Return         : None
    742          *******************************************************************************/
    743          void USART_ClearFlag(USART_TypeDef* USARTx, u16 USART_FLAG)
    744          {
    745            /* Check the parameters */
    746            assert_param(IS_USART_CLEAR_FLAG(USART_FLAG));
    747             
    748            USARTx->SR &= (u16)~USART_FLAG;
    749          }
    750          
    751          /*******************************************************************************
    752          * Function Name  : USART_GetITStatus
    753          * Description    : Checks whether the specified USART interrupt has occurred or not.
    754          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    755          *                    peripheral.
    756          *                  - USART_IT: specifies the USART interrupt source to check.
    757          *                    This parameter can be one of the following values:
    758          *                       - USART_IT_PE
    759          *                       - USART_IT_TXE
    760          *                       - USART_IT_TC
    761          *                       - USART_IT_RXNE
    762          *                       - USART_IT_IDLE
    763          *                       - USART_IT_LBD
    764          *                       - USART_IT_CTS
    765          *                       - USART_IT_ORE
    766          *                       - USART_IT_NE
    767          *                       - USART_IT_FE
    768          * Output         : None
    769          * Return         : The new state of USART_IT (SET or RESET).
    770          *******************************************************************************/
    771          ITStatus USART_GetITStatus(USART_TypeDef* USARTx, u16 USART_IT)
    772          {
    773            u32 bitpos = 0x00, itmask = 0x00, usartreg = 0;
    774            ITStatus bitstatus = RESET;
    775          
    776            /* Check the parameters */
    777            assert_param(IS_USART_IT(USART_IT));
    778            
    779            /* Get the USART register index */
    780            usartreg = (((u8)USART_IT) >> 0x05);
    781          
    782            /* Get the interrupt position */
    783            itmask = USART_IT & USART_IT_Mask;
    784          
    785            itmask = (u32)0x01 << itmask;
    786            
    787            if (usartreg == 0x01) /* The IT  is in CR1 register */
    788            {
    789              itmask &= USARTx->CR1;
    790            }
    791            else if (usartreg == 0x02) /* The IT  is in CR2 register */
    792            {
    793              itmask &= USARTx->CR2;
    794            }
    795            else /* The IT  is in CR3 register */
    796            {
    797              itmask &= USARTx->CR3;
    798            }
    799            
    800            bitpos = USART_IT >> 0x08;
    801          
    802            bitpos = (u32)0x01 << bitpos;
    803            bitpos &= USARTx->SR;
    804          
    805            if ((itmask != (u16)RESET)&&(bitpos != (u16)RESET))
    806            {
    807              bitstatus = SET;
    808            }
    809            else
    810            {
    811              bitstatus = RESET;
    812            }
    813            return bitstatus;
    814          }
    815          
    816          /*******************************************************************************
    817          * Function Name  : USART_ClearITPendingBit
    818          * Description    : Clears the USARTx抯 interrupt pending bits.
    819          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    820          *                    peripheral.
    821          *                  - USART_IT: specifies the interrupt pending bit to clear.
    822          *                    This parameter can be one of the following values:
    823          *                       - USART_IT_PE
    824          *                       - USART_IT_TXE
    825          *                       - USART_IT_TC
    826          *                       - USART_IT_RXNE
    827          *                       - USART_IT_IDLE
    828          *                       - USART_IT_LBD
    829          *                       - USART_IT_CTS
    830          *                       - USART_IT_ORE
    831          *                       - USART_IT_NE
    832          *                       - USART_IT_FE
    833          * Output         : None
    834          * Return         : None
    835          *******************************************************************************/
    836          void USART_ClearITPendingBit(USART_TypeDef* USARTx, u16 USART_IT)
    837          {
    838            u32 bitpos = 0x00, itmask = 0x00;
    839            
    840            /* Check the parameters */
    841            assert_param(IS_USART_IT(USART_IT));
    842            
    843            bitpos = USART_IT >> 0x08;
    844          
    845            itmask = (u32)0x01 << bitpos;
    846            USARTx->SR &= ~itmask;
    847          }
    848          
    849          /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/

   Maximum stack usage in bytes:

     Function                       .cstack
     --------                       -------
     USART_ClearFlag                     0
     USART_ClearITPendingBit             8
     USART_Cmd                           0
     USART_DMACmd                        0
     USART_DeInit                        8
     USART_GetFlagStatus                 8
     USART_GetITStatus                  16
     USART_HalfDuplexCmd                 0
     USART_ITConfig                     16
     USART_Init                         48
     USART_IrDACmd                       0
     USART_IrDAConfig                    0
     USART_LINBreakDetectLengthConfig
                                         0
     USART_LINCmd                        0
     USART_ReceiveData                   0
     USART_ReceiverWakeUpCmd             0
     USART_SendBreak                     0
     USART_SendData                      0
     USART_SetAddress                    0
     USART_SetGuardTime                  0
     USART_SetPrescaler                  0
     USART_SmartCardCmd                  0
     USART_SmartCardNACKCmd              0
     USART_StructInit                    0
     USART_WakeUpConfig                  0


   Section sizes:

     Function/Label                 Bytes
     --------------                 -----
     USART_DeInit                    100
     USART_Init                      224
     USART_StructInit                 44
     USART_Cmd                        32
     USART_ITConfig                   86
     USART_DMACmd                     22
     USART_SetAddress                 24
     USART_WakeUpConfig               20
     USART_ReceiverWakeUpCmd          26
     USART_LINBreakDetectLengthConfig
                                      16
     USART_LINCmd                     32
     USART_SendData                    8
     USART_ReceiveData                 8
     USART_SendBreak                  10
     USART_SetGuardTime               20
     USART_SetPrescaler               18
     USART_SmartCardCmd               26
     USART_SmartCardNACKCmd           32
     USART_HalfDuplexCmd              32
     USART_IrDAConfig                 20
     USART_IrDACmd                    26
     USART_GetFlagStatus              34
     USART_ClearFlag                   8
     USART_GetITStatus               124
     USART_ClearITPendingBit          36
     ??DataTable2                      4
     ??DataTable3                      4

 
 1 036 bytes in section .text
 
 1 036 bytes of CODE memory

Errors: none
Warnings: none

⌨️ 快捷键说明

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