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

📄 stm32f10x_i2c.lst

📁 完成数据的采集
💻 LST
📖 第 1 页 / 共 5 页
字号:
    272            I2C_InitStruct->I2C_ClockSpeed = 5000;
   \   00000016   0149               LDR.N    R1,??I2C_StructInit_0  ;; 0x1388
   \   00000018   C160               STR      R1,[R0, #+12]
    273          }
   \   0000001A   7047               BX       LR               ;; return
   \                     ??I2C_StructInit_0:
   \   0000001C   88130000           DC32     0x1388
    274          
    275          /*******************************************************************************
    276          * Function Name  : I2C_Cmd
    277          * Description    : Enables or disables the specified I2C peripheral.
    278          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    279          *                  - NewState: new state of the I2Cx peripheral. This parameter
    280          *                    can be: ENABLE or DISABLE.
    281          * Output         : None
    282          * Return         : None
    283          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    284          void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    285          {
    286            /* Check the parameters */
    287            assert_param(IS_FUNCTIONAL_STATE(NewState));
    288          
    289            if (NewState != DISABLE)
   \                     I2C_Cmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_Cmd_0
    290            {
    291              /* Enable the selected I2C peripheral */
    292              I2Cx->CR1 |= CR1_PE_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   52F00102           ORRS     R2,R2,#0x1
   \   0000000C   0280               STRH     R2,[R0, #+0]
   \   0000000E   03E0               B.N      ??I2C_Cmd_1
    293            }
    294            else
    295            {
    296              /* Disable the selected I2C peripheral */
    297              I2Cx->CR1 &= CR1_PE_Reset;
   \                     ??I2C_Cmd_0:
   \   00000010   0288               LDRH     R2,[R0, #+0]
   \   00000012   ....               LDR.N    R3,??DataTable5  ;; 0xfffe
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   0380               STRH     R3,[R0, #+0]
    298            }
    299          }
   \                     ??I2C_Cmd_1:
   \   00000018   7047               BX       LR               ;; return
    300          
    301          /*******************************************************************************
    302          * Function Name  : I2C_DMACmd
    303          * Description    : Enables or disables the specified I2C DMA requests.
    304          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    305          *                  - NewState: new state of the I2C DMA transfer.
    306          *                    This parameter can be: ENABLE or DISABLE.
    307          * Output         : None
    308          * Return         : None
    309          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    310          void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    311          {
    312            /* Check the parameters */
    313            assert_param(IS_FUNCTIONAL_STATE(NewState));
    314          
    315            if (NewState != DISABLE)
   \                     I2C_DMACmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_DMACmd_0
    316            {
    317              /* Enable the selected I2C DMA requests */
    318              I2Cx->CR2 |= CR2_DMAEN_Set;
   \   00000006   8288               LDRH     R2,[R0, #+4]
   \   00000008   52F40062           ORRS     R2,R2,#0x800
   \   0000000C   8280               STRH     R2,[R0, #+4]
   \   0000000E   03E0               B.N      ??I2C_DMACmd_1
    319            }
    320            else
    321            {
    322              /* Disable the selected I2C DMA requests */
    323              I2Cx->CR2 &= CR2_DMAEN_Reset;
   \                     ??I2C_DMACmd_0:
   \   00000010   8288               LDRH     R2,[R0, #+4]
   \   00000012   ....               LDR.N    R3,??DataTable7  ;; 0xf7ff
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   8380               STRH     R3,[R0, #+4]
    324            }
    325          }
   \                     ??I2C_DMACmd_1:
   \   00000018   7047               BX       LR               ;; return
    326          
    327          /*******************************************************************************
    328          * Function Name  : I2C_DMALastTransferCmd
    329          * Description    : Specifies that the next DMA transfer is the last one.
    330          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    331          *                  - NewState: new state of the I2C DMA last transfer.
    332          *                    This parameter can be: ENABLE or DISABLE.
    333          * Output         : None
    334          * Return         : None
    335          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    336          void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    337          {
    338            /* Check the parameters */
    339            assert_param(IS_FUNCTIONAL_STATE(NewState));
    340          
    341            if (NewState != DISABLE)
   \                     I2C_DMALastTransferCmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_DMALastTransferCmd_0
    342            {
    343              /* Next DMA end of transfer is the last transfer */
    344              I2Cx->CR2 |= CR2_LAST_Set;
   \   00000006   8288               LDRH     R2,[R0, #+4]
   \   00000008   52F48052           ORRS     R2,R2,#0x1000
   \   0000000C   8280               STRH     R2,[R0, #+4]
   \   0000000E   03E0               B.N      ??I2C_DMALastTransferCmd_1
    345            }
    346            else
    347            {
    348              /* Next DMA end of transfer is not the last transfer */
    349              I2Cx->CR2 &= CR2_LAST_Reset;
   \                     ??I2C_DMALastTransferCmd_0:
   \   00000010   8288               LDRH     R2,[R0, #+4]
   \   00000012   ....               LDR.N    R3,??DataTable6  ;; 0xefff
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   8380               STRH     R3,[R0, #+4]
    350            }
    351          }
   \                     ??I2C_DMALastTransferCmd_1:
   \   00000018   7047               BX       LR               ;; return
    352          
    353          /*******************************************************************************
    354          * Function Name  : I2C_GenerateSTART
    355          * Description    : Generates I2Cx communication START condition.
    356          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    357          *                  - NewState: new state of the I2C START condition generation.
    358          *                    This parameter can be: ENABLE or DISABLE.
    359          * Output         : None
    360          * Return         : None.
    361          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    362          void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState)
    363          {
    364            /* Check the parameters */
    365            assert_param(IS_FUNCTIONAL_STATE(NewState));
    366          
    367            if (NewState != DISABLE)
   \                     I2C_GenerateSTART:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_GenerateSTART_0
    368            {
    369              /* Generate a START condition */
    370              I2Cx->CR1 |= CR1_START_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   52F48072           ORRS     R2,R2,#0x100
   \   0000000C   0280               STRH     R2,[R0, #+0]
   \   0000000E   03E0               B.N      ??I2C_GenerateSTART_1
    371            }
    372            else
    373            {
    374              /* Disable the START condition generation */
    375              I2Cx->CR1 &= CR1_START_Reset;
   \                     ??I2C_GenerateSTART_0:
   \   00000010   0288               LDRH     R2,[R0, #+0]
   \   00000012   024B               LDR.N    R3,??I2C_GenerateSTART_2  ;; 0xfeff
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   0380               STRH     R3,[R0, #+0]
    376            }
    377          }
   \                     ??I2C_GenerateSTART_1:
   \   00000018   7047               BX       LR               ;; return
   \   0000001A   00BF               Nop      
   \                     ??I2C_GenerateSTART_2:
   \   0000001C   FFFE0000           DC32     0xfeff
    378          
    379          /*******************************************************************************
    380          * Function Name  : I2C_GenerateSTOP
    381          * Description    : Generates I2Cx communication STOP condition.
    382          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    383          *                  - NewState: new state of the I2C STOP condition generation.
    384          *                    This parameter can be: ENABLE or DISABLE.
    385          * Output         : None
    386          * Return         : None.
    387          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    388          void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState)
    389          {
    390            /* Check the parameters */
    391            assert_param(IS_FUNCTIONAL_STATE(NewState));
    392          
    393            if (NewState != DISABLE)
   \                     I2C_GenerateSTOP:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_GenerateSTOP_0
    394            {
    395              /* Generate a STOP condition */
    396              I2Cx->CR1 |= CR1_STOP_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   52F40072           ORRS     R2,R2,#0x200
   \   0000000C   0280               STRH     R2,[R0, #+0]
   \   0000000E   03E0               B.N      ??I2C_GenerateSTOP_1
    397            }
    398            else
    399            {
    400              /* Disable the STOP condition generation */
    401              I2Cx->CR1 &= CR1_STOP_Reset;
   \                     ??I2C_GenerateSTOP_0:
   \   00000010   0288               LDRH     R2,[R0, #+0]
   \   00000012   024B               LDR.N    R3,??I2C_GenerateSTOP_2  ;; 0xfdff
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   0380               STRH     R3,[R0, #+0]
    402            }
    403          }
   \                     ??I2C_GenerateSTOP_1:
   \   00000018   7047               BX       LR               ;; return
   \   0000001A   00BF               Nop      
   \                     ??I2C_GenerateSTOP_2:
   \   0000001C   FFFD0000           DC32     0xfdff
    404          
    405          /*******************************************************************************
    406          * Function Name  : I2C_AcknowledgeConfig
    407          * Description    : Enables or disables the specified I2C acknowledge feature.
    408          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.

⌨️ 快捷键说明

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