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

📄 stm32f10x_usart.lst

📁 完成数据的采集
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \                                 In section .XML, align 4, keep-with-next
    246          void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState)
    247          {
    248            /* Check the parameters */
    249            assert_param(IS_FUNCTIONAL_STATE(NewState));
    250            
    251            if (NewState != DISABLE)
   \                     USART_Cmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??USART_Cmd_0
    252            {
    253              /* Enable the selected USART by setting the RUN bit in the CR1 register */
    254              USARTx->CR1 |= CR1_RUN_Set;
   \   00000006   8289               LDRH     R2,[R0, #+12]
   \   00000008   52F40052           ORRS     R2,R2,#0x2000
   \   0000000C   8281               STRH     R2,[R0, #+12]
   \   0000000E   03E0               B.N      ??USART_Cmd_1
    255            }
    256            else
    257            {
    258              /* Disable the selected USART by clearing the RUN bit in the CR1 register */
    259              USARTx->CR1 &= CR1_RUN_Reset;
   \                     ??USART_Cmd_0:
   \   00000010   8289               LDRH     R2,[R0, #+12]
   \   00000012   024B               LDR.N    R3,??USART_Cmd_2  ;; 0xdfff
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   8381               STRH     R3,[R0, #+12]
    260            }
    261          }
   \                     ??USART_Cmd_1:
   \   00000018   7047               BX       LR               ;; return
   \   0000001A   00BF               Nop      
   \                     ??USART_Cmd_2:
   \   0000001C   FFDF0000           DC32     0xdfff
    262          
    263          /*******************************************************************************
    264          * Function Name  : USART_ITConfig
    265          * Description    : Enables or disables the specified USART interrupts.
    266          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    267          *                    peripheral.
    268          *                  - USART_IT: specifies the USART interrupt sources to be
    269          *                    enabled or disabled.
    270          *                    This parameter can be one of the following values:
    271          *                       - USART_IT_PE
    272          *                       - USART_IT_TXE
    273          *                       - USART_IT_TC
    274          *                       - USART_IT_RXNE
    275          *                       - USART_IT_IDLE
    276          *                       - USART_IT_LBD
    277          *                       - USART_IT_CTS
    278          *                       - USART_IT_ERR
    279          *                  - NewState: new state of the specified USARTx interrupts.
    280          *                    This parameter can be: ENABLE or DISABLE.
    281          * Output         : None
    282          * Return         : None
    283          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    284          void USART_ITConfig(USART_TypeDef* USARTx, u16 USART_IT, FunctionalState NewState)
    285          {
   \                     USART_ITConfig:
   \   00000000   F0B4               PUSH     {R4-R7}
    286            u32 usartreg = 0x00, itpos = 0x00, itmask = 0x00;
   \   00000002   0027               MOVS     R7,#+0
   \   00000004   3B00               MOVS     R3,R7
   \   00000006   0027               MOVS     R7,#+0
   \   00000008   3C00               MOVS     R4,R7
   \   0000000A   0027               MOVS     R7,#+0
   \   0000000C   3D00               MOVS     R5,R7
    287            u32 address = 0x00;
   \   0000000E   0027               MOVS     R7,#+0
   \   00000010   3E00               MOVS     R6,R7
    288          
    289            /* Check the parameters */
    290            assert_param(IS_USART_CONFIG_IT(USART_IT));  
    291            assert_param(IS_FUNCTIONAL_STATE(NewState));
    292            
    293            /* Get the USART register index */
    294            usartreg = (((u8)USART_IT) >> 0x05);
   \   00000012   0F00               MOVS     R7,R1
   \   00000014   FFB2               UXTB     R7,R7            ;; ZeroExtS R7,R7,#+24,#+24
   \   00000016   7F09               LSRS     R7,R7,#+5
   \   00000018   FFB2               UXTB     R7,R7            ;; ZeroExtS R7,R7,#+24,#+24
   \   0000001A   3B00               MOVS     R3,R7
    295          
    296            /* Get the interrupt position */
    297            itpos = USART_IT & USART_IT_Mask;
   \   0000001C   89B2               UXTH     R1,R1            ;; ZeroExtS R1,R1,#+16,#+16
   \   0000001E   CF06               LSLS     R7,R1,#+27       ;; ZeroExtS R7,R1,#+27,#+27
   \   00000020   FF0E               LSRS     R7,R7,#+27
   \   00000022   3C00               MOVS     R4,R7
    298          
    299            itmask = (((u32)0x01) << itpos);
   \   00000024   0127               MOVS     R7,#+1
   \   00000026   A740               LSLS     R7,R7,R4
   \   00000028   3D00               MOVS     R5,R7
    300            address = *(u32*)&(USARTx);
   \   0000002A   0600               MOVS     R6,R0
    301          
    302            if (usartreg == 0x01) /* The IT  is in CR1 register */
   \   0000002C   012B               CMP      R3,#+1
   \   0000002E   01D1               BNE.N    ??USART_ITConfig_0
    303            {
    304              address += 0x0C;
   \   00000030   0C36               ADDS     R6,R6,#+12
   \   00000032   04E0               B.N      ??USART_ITConfig_1
    305            }
    306            else if (usartreg == 0x02) /* The IT  is in CR2 register */
   \                     ??USART_ITConfig_0:
   \   00000034   022B               CMP      R3,#+2
   \   00000036   01D1               BNE.N    ??USART_ITConfig_2
    307            {
    308              address += 0x10;
   \   00000038   1036               ADDS     R6,R6,#+16
   \   0000003A   00E0               B.N      ??USART_ITConfig_1
    309            }
    310            else /* The IT  is in CR3 register */
    311            {
    312              address += 0x14; 
   \                     ??USART_ITConfig_2:
   \   0000003C   1436               ADDS     R6,R6,#+20
    313            }
    314            if (NewState != DISABLE)
   \                     ??USART_ITConfig_1:
   \   0000003E   D2B2               UXTB     R2,R2            ;; ZeroExtS R2,R2,#+24,#+24
   \   00000040   002A               CMP      R2,#+0
   \   00000042   03D0               BEQ.N    ??USART_ITConfig_3
    315            {
    316              *(u32*)address  |= itmask;
   \   00000044   3768               LDR      R7,[R6, #+0]
   \   00000046   2F43               ORRS     R7,R7,R5
   \   00000048   3760               STR      R7,[R6, #+0]
   \   0000004A   02E0               B.N      ??USART_ITConfig_4
    317            }
    318            else
    319            {
    320              *(u32*)address &= ~itmask;
   \                     ??USART_ITConfig_3:
   \   0000004C   3768               LDR      R7,[R6, #+0]
   \   0000004E   AF43               BICS     R7,R7,R5
   \   00000050   3760               STR      R7,[R6, #+0]
    321            }
    322          }
   \                     ??USART_ITConfig_4:
   \   00000052   F0BC               POP      {R4-R7}
   \   00000054   7047               BX       LR               ;; return
    323          
    324          /*******************************************************************************
    325          * Function Name  : USART_DMACmd
    326          * Description    : Enables or disables the USART抯 DMA interface.
    327          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    328          *                    peripheral.
    329          *                  - USART_DMAReq: specifies the DMA request.
    330          *                    This parameter can be any combination of the following values:
    331          *                       - USART_DMAReq_Tx
    332          *                       - USART_DMAReq_Rx
    333          *                  - NewState: new state of the DMA Request sources.
    334          *                   This parameter can be: ENABLE or DISABLE.
    335          * Output         : None
    336          * Return         : None
    337          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    338          void USART_DMACmd(USART_TypeDef* USARTx, u16 USART_DMAReq, FunctionalState NewState)
    339          {
    340            /* Check the parameters */
    341            assert_param(IS_USART_DMAREQ(USART_DMAReq));  
    342            assert_param(IS_FUNCTIONAL_STATE(NewState)); 
    343            
    344            if (NewState != DISABLE)
   \                     USART_DMACmd:
   \   00000000   D2B2               UXTB     R2,R2            ;; ZeroExtS R2,R2,#+24,#+24
   \   00000002   002A               CMP      R2,#+0
   \   00000004   03D0               BEQ.N    ??USART_DMACmd_0
    345            {
    346              /* Enable the DMA transfer for selected requests by setting the DMAT and/or
    347              DMAR bits in the USART CR3 register */
    348              USARTx->CR3 |= USART_DMAReq;
   \   00000006   838A               LDRH     R3,[R0, #+20]
   \   00000008   0B43               ORRS     R3,R3,R1
   \   0000000A   8382               STRH     R3,[R0, #+20]
   \   0000000C   02E0               B.N      ??USART_DMACmd_1
    349            }
    350            else
    351            {
    352              /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
    353              DMAR bits in the USART CR3 register */
    354              USARTx->CR3 &= (u16)~USART_DMAReq;
   \                     ??USART_DMACmd_0:
   \   0000000E   838A               LDRH     R3,[R0, #+20]
   \   00000010   8B43               BICS     R3,R3,R1
   \   00000012   8382               STRH     R3,[R0, #+20]
    355            }
    356          }
   \                     ??USART_DMACmd_1:
   \   00000014   7047               BX       LR               ;; return
    357          
    358          /*******************************************************************************
    359          * Function Name  : USART_SetAddress
    360          * Description    : Sets the address of the USART node.
    361          * Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
    362          *                    peripheral.
    363          *                  - USART_Address: Indicates the address of the USART node.
    364          * Output         : None
    365          * Return         : None
    366          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    367          void USART_SetAddress(USART_TypeDef* USARTx, u8 USART_Address)
    368          {
    369            /* Check the parameters */
    370            assert_param(IS_USART_ADDRESS(USART_Address)); 
    371              
    372            /* Clear the USART address */
    373            USARTx->CR2 &= CR2_Address_Mask;
   \                     USART_SetAddress:
   \   00000000   028A               LDRH     R2,[R0, #+16]
   \   00000002   044B               LDR.N    R3,??USART_SetAddress_0  ;; 0xfff0
   \   00000004   1340               ANDS     R3,R3,R2
   \   00000006   0382               STRH     R3,[R0, #+16]
    374            /* Set the USART address node */
    375            USARTx->CR2 |= USART_Address;
   \   00000008   028A               LDRH     R2,[R0, #+16]
   \   0000000A   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24

⌨️ 快捷键说明

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