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

📄 stm32f10x_usart.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 5 页
字号:
    269            USARTx->BRR = (uint16_t)tmpreg;
   \                     ??USART_Init_6:
   \   000000D6   2681               STRH     R6,[R4, #+8]
    270          }
   \   000000D8   06B0               ADD      SP,SP,#+24
   \   000000DA   BDE8F087           POP      {R4-R10,PC}      ;; return
    271          
    272          /**
    273            * @brief  Fills each USART_InitStruct member with its default value.
    274            * @param  USART_InitStruct: pointer to a USART_InitTypeDef structure
    275            *   which will be initialized.
    276            * @retval None
    277            */

   \                                 In section .text, align 2, keep-with-next
    278          void USART_StructInit(USART_InitTypeDef* USART_InitStruct)
    279          {
    280            /* USART_InitStruct members default value */
    281            USART_InitStruct->USART_BaudRate = 9600;
   \                     USART_StructInit:
   \   00000000   4FF41651           MOV      R1,#+9600
   \   00000004   0160               STR      R1,[R0, #+0]
    282            USART_InitStruct->USART_WordLength = USART_WordLength_8b;
   \   00000006   0021               MOVS     R1,#+0
   \   00000008   8180               STRH     R1,[R0, #+4]
    283            USART_InitStruct->USART_StopBits = USART_StopBits_1;
   \   0000000A   0021               MOVS     R1,#+0
   \   0000000C   C180               STRH     R1,[R0, #+6]
    284            USART_InitStruct->USART_Parity = USART_Parity_No ;
   \   0000000E   0021               MOVS     R1,#+0
   \   00000010   0181               STRH     R1,[R0, #+8]
    285            USART_InitStruct->USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
   \   00000012   0C21               MOVS     R1,#+12
   \   00000014   4181               STRH     R1,[R0, #+10]
    286            USART_InitStruct->USART_HardwareFlowControl = USART_HardwareFlowControl_None;  
   \   00000016   0021               MOVS     R1,#+0
   \   00000018   8181               STRH     R1,[R0, #+12]
    287          }
   \   0000001A   7047               BX       LR               ;; return
    288          
    289          /**
    290            * @brief  Initializes the USARTx peripheral Clock according to the 
    291            *   specified parameters in the USART_ClockInitStruct .
    292            * @param  USARTx: where x can be 1, 2, 3 to select the USART peripheral.
    293            * @param  USART_ClockInitStruct: pointer to a USART_ClockInitTypeDef
    294            *   structure that contains the configuration information for the specified 
    295            *   USART peripheral.  
    296            * @note The Smart Card mode is not available for UART4 and UART5.
    297            * @retval None
    298            */

   \                                 In section .text, align 2, keep-with-next
    299          void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USART_ClockInitStruct)
    300          {
   \                     USART_ClockInit:
   \   00000000   10B4               PUSH     {R4}
    301            uint32_t tmpreg = 0x00;
   \   00000002   0022               MOVS     R2,#+0
    302            /* Check the parameters */
    303            assert_param(IS_USART_123_PERIPH(USARTx));
    304            assert_param(IS_USART_CLOCK(USART_ClockInitStruct->USART_Clock));
    305            assert_param(IS_USART_CPOL(USART_ClockInitStruct->USART_CPOL));
    306            assert_param(IS_USART_CPHA(USART_ClockInitStruct->USART_CPHA));
    307            assert_param(IS_USART_LASTBIT(USART_ClockInitStruct->USART_LastBit));
    308            
    309          /*---------------------------- USART CR2 Configuration -----------------------*/
    310            tmpreg = USARTx->CR2;
   \   00000004   038A               LDRH     R3,[R0, #+16]
   \   00000006   1A00               MOVS     R2,R3
    311            /* Clear CLKEN, CPOL, CPHA and LBCL bits */
    312            tmpreg &= CR2_CLOCK_CLEAR_Mask;
   \   00000008   4FF2FF03           MOVW     R3,#+61695
   \   0000000C   1A40               ANDS     R2,R3,R2
    313            /* Configure the USART Clock, CPOL, CPHA and LastBit ------------*/
    314            /* Set CLKEN bit according to USART_Clock value */
    315            /* Set CPOL bit according to USART_CPOL value */
    316            /* Set CPHA bit according to USART_CPHA value */
    317            /* Set LBCL bit according to USART_LastBit value */
    318            tmpreg |= (uint32_t)USART_ClockInitStruct->USART_Clock | USART_ClockInitStruct->USART_CPOL | 
    319                           USART_ClockInitStruct->USART_CPHA | USART_ClockInitStruct->USART_LastBit;
   \   0000000E   0B88               LDRH     R3,[R1, #+0]
   \   00000010   4C88               LDRH     R4,[R1, #+2]
   \   00000012   2343               ORRS     R3,R4,R3
   \   00000014   8C88               LDRH     R4,[R1, #+4]
   \   00000016   2343               ORRS     R3,R4,R3
   \   00000018   CC88               LDRH     R4,[R1, #+6]
   \   0000001A   2343               ORRS     R3,R4,R3
   \   0000001C   1A43               ORRS     R2,R3,R2
    320            /* Write to USART CR2 */
    321            USARTx->CR2 = (uint16_t)tmpreg;
   \   0000001E   0282               STRH     R2,[R0, #+16]
    322          }
   \   00000020   10BC               POP      {R4}
   \   00000022   7047               BX       LR               ;; return
    323          
    324          /**
    325            * @brief  Fills each USART_ClockInitStruct member with its default value.
    326            * @param  USART_ClockInitStruct: pointer to a USART_ClockInitTypeDef
    327            *   structure which will be initialized.
    328            * @retval None
    329            */

   \                                 In section .text, align 2, keep-with-next
    330          void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct)
    331          {
    332            /* USART_ClockInitStruct members default value */
    333            USART_ClockInitStruct->USART_Clock = USART_Clock_Disable;
   \                     USART_ClockStructInit:
   \   00000000   0021               MOVS     R1,#+0
   \   00000002   0180               STRH     R1,[R0, #+0]
    334            USART_ClockInitStruct->USART_CPOL = USART_CPOL_Low;
   \   00000004   0021               MOVS     R1,#+0
   \   00000006   4180               STRH     R1,[R0, #+2]
    335            USART_ClockInitStruct->USART_CPHA = USART_CPHA_1Edge;
   \   00000008   0021               MOVS     R1,#+0
   \   0000000A   8180               STRH     R1,[R0, #+4]
    336            USART_ClockInitStruct->USART_LastBit = USART_LastBit_Disable;
   \   0000000C   0021               MOVS     R1,#+0
   \   0000000E   C180               STRH     R1,[R0, #+6]
    337          }
   \   00000010   7047               BX       LR               ;; return
    338          
    339          /**
    340            * @brief  Enables or disables the specified USART peripheral.
    341            * @param  USARTx: Select the USART or the UART peripheral. 
    342            *   This parameter can be one of the following values:
    343            *   USART1, USART2, USART3, UART4 or UART5.
    344            * @param  NewState: new state of the USARTx peripheral.
    345            *   This parameter can be: ENABLE or DISABLE.
    346            * @retval None
    347            */

   \                                 In section .text, align 2, keep-with-next
    348          void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState)
    349          {
    350            /* Check the parameters */
    351            assert_param(IS_USART_ALL_PERIPH(USARTx));
    352            assert_param(IS_FUNCTIONAL_STATE(NewState));
    353            
    354            if (NewState != DISABLE)
   \                     USART_Cmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??USART_Cmd_0
    355            {
    356              /* Enable the selected USART by setting the UE bit in the CR1 register */
    357              USARTx->CR1 |= CR1_UE_Set;
   \   00000006   8289               LDRH     R2,[R0, #+12]
   \   00000008   52F40052           ORRS     R2,R2,#0x2000
   \   0000000C   8281               STRH     R2,[R0, #+12]
   \   0000000E   04E0               B.N      ??USART_Cmd_1
    358            }
    359            else
    360            {
    361              /* Disable the selected USART by clearing the UE bit in the CR1 register */
    362              USARTx->CR1 &= CR1_UE_Reset;
   \                     ??USART_Cmd_0:
   \   00000010   8289               LDRH     R2,[R0, #+12]
   \   00000012   4DF6FF73           MOVW     R3,#+57343
   \   00000016   1A40               ANDS     R2,R3,R2
   \   00000018   8281               STRH     R2,[R0, #+12]
    363            }
    364          }
   \                     ??USART_Cmd_1:
   \   0000001A   7047               BX       LR               ;; return
    365          
    366          /**
    367            * @brief  Enables or disables the specified USART interrupts.
    368            * @param  USARTx: Select the USART or the UART peripheral. 
    369            *   This parameter can be one of the following values:
    370            *   USART1, USART2, USART3, UART4 or UART5.
    371            * @param  USART_IT: specifies the USART interrupt sources to be enabled or disabled.
    372            *   This parameter can be one of the following values:
    373            *     @arg USART_IT_CTS:  CTS change interrupt (not available for UART4 and UART5)
    374            *     @arg USART_IT_LBD:  LIN Break detection interrupt
    375            *     @arg USART_IT_TXE:  Tansmit Data Register empty interrupt
    376            *     @arg USART_IT_TC:   Transmission complete interrupt
    377            *     @arg USART_IT_RXNE: Receive Data register not empty interrupt
    378            *     @arg USART_IT_IDLE: Idle line detection interrupt
    379            *     @arg USART_IT_PE:   Parity Error interrupt
    380            *     @arg USART_IT_ERR:  Error interrupt(Frame error, noise error, overrun error)
    381            * @param  NewState: new state of the specified USARTx interrupts.
    382            *   This parameter can be: ENABLE or DISABLE.
    383            * @retval None
    384            */

   \                                 In section .text, align 2, keep-with-next
    385          void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState)
    386          {
   \                     USART_ITConfig:
   \   00000000   F0B4               PUSH     {R4-R7}
    387            uint32_t usartreg = 0x00, itpos = 0x00, itmask = 0x00;
   \   00000002   0023               MOVS     R3,#+0
   \   00000004   0024               MOVS     R4,#+0
   \   00000006   0025               MOVS     R5,#+0
    388            uint32_t usartxbase = 0x00;
   \   00000008   0026               MOVS     R6,#+0
    389            /* Check the parameters */
    390            assert_param(IS_USART_ALL_PERIPH(USARTx));
    391            assert_param(IS_USART_CONFIG_IT(USART_IT));
    392            assert_param(IS_FUNCTIONAL_STATE(NewState));
    393            /* The CTS interrupt is not available for UART4 and UART5 */
    394            if (USART_IT == USART_IT_CTS)
   \   0000000A   40F66A17           MOVW     R7,#+2410
   \   0000000E   89B2               UXTH     R1,R1            ;; ZeroExt  R1,R1,#+16,#+16
   \   00000010   B942               CMP      R1,R7
    395            {
    396              assert_param(IS_USART_123_PERIPH(USARTx));
    397            }   
    398            
    399            usartxbase = (uint32_t)USARTx;
   \                     ??USART_ITConfig_0:
   \   00000012   0600               MOVS     R6,R0
    400          
    401            /* Get the USART register index */
    402            usartreg = (((uint8_t)USART_IT) >> 0x05);
   \   00000014   0F00               MOVS     R7,R1
   \   00000016   FFB2               UXTB     R7,R7            ;; ZeroExt  R7,R7,#+24,#+24
   \   00000018   7F09               LSRS     R7,R7,#+5
   \   0000001A   FFB2               UXTB     R7,R7            ;; ZeroExt  R7,R7,#+24,#+24
   \   0000001C   3B00               MOVS     R3,R7
    403          
    404            /* Get the interrupt position */
    405            itpos = USART_IT & IT_Mask;
   \   0000001E   89B2               UXTH     R1,R1            ;; ZeroExt  R1,R1,#+16,#+16
   \   00000020   11F01F07           ANDS     R7,R1,#0x1F
   \   00000024   3C00               MOVS     R4,R7
    406            itmask = (((uint32_t)0x01) << itpos);
   \   00000026   0127               MOVS     R7,#+1
   \   00000028   A740               LSLS     R7,R7,R4
   \   0000002A   3D00               MOVS     R5,R7
    407              
    408            if (usartreg == 0x01) /* The IT is in CR1 register */
   \   0000002C   012B               CMP      R3,#+1
   \   0000002E   01D1               BNE.N    ??USART_ITConfig_1

⌨️ 快捷键说明

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