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

📄 stm32f10x_i2c.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 5 页
字号:
    315            * @brief  Enables or disables the specified I2C peripheral.
    316            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    317            * @param  NewState: new state of the I2Cx peripheral. 
    318            *   This parameter can be: ENABLE or DISABLE.
    319            * @retval None
    320            */

   \                                 In section .text, align 2, keep-with-next
    321          void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    322          {
    323            /* Check the parameters */
    324            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    325            assert_param(IS_FUNCTIONAL_STATE(NewState));
    326            if (NewState != DISABLE)
   \                     I2C_Cmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_Cmd_0
    327            {
    328              /* Enable the selected I2C peripheral */
    329              I2Cx->CR1 |= CR1_PE_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   52F00102           ORRS     R2,R2,#0x1
   \   0000000C   0280               STRH     R2,[R0, #+0]
   \   0000000E   04E0               B.N      ??I2C_Cmd_1
    330            }
    331            else
    332            {
    333              /* Disable the selected I2C peripheral */
    334              I2Cx->CR1 &= CR1_PE_Reset;
   \                     ??I2C_Cmd_0:
   \   00000010   0288               LDRH     R2,[R0, #+0]
   \   00000012   4FF6FE73           MOVW     R3,#+65534
   \   00000016   1A40               ANDS     R2,R3,R2
   \   00000018   0280               STRH     R2,[R0, #+0]
    335            }
    336          }
   \                     ??I2C_Cmd_1:
   \   0000001A   7047               BX       LR               ;; return
    337          
    338          /**
    339            * @brief  Enables or disables the specified I2C DMA requests.
    340            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    341            * @param  NewState: new state of the I2C DMA transfer.
    342            *   This parameter can be: ENABLE or DISABLE.
    343            * @retval None
    344            */

   \                                 In section .text, align 2, keep-with-next
    345          void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    346          {
    347            /* Check the parameters */
    348            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    349            assert_param(IS_FUNCTIONAL_STATE(NewState));
    350            if (NewState != DISABLE)
   \                     I2C_DMACmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_DMACmd_0
    351            {
    352              /* Enable the selected I2C DMA requests */
    353              I2Cx->CR2 |= CR2_DMAEN_Set;
   \   00000006   8288               LDRH     R2,[R0, #+4]
   \   00000008   52F40062           ORRS     R2,R2,#0x800
   \   0000000C   8280               STRH     R2,[R0, #+4]
   \   0000000E   04E0               B.N      ??I2C_DMACmd_1
    354            }
    355            else
    356            {
    357              /* Disable the selected I2C DMA requests */
    358              I2Cx->CR2 &= CR2_DMAEN_Reset;
   \                     ??I2C_DMACmd_0:
   \   00000010   8288               LDRH     R2,[R0, #+4]
   \   00000012   4FF2FF73           MOVW     R3,#+63487
   \   00000016   1A40               ANDS     R2,R3,R2
   \   00000018   8280               STRH     R2,[R0, #+4]
    359            }
    360          }
   \                     ??I2C_DMACmd_1:
   \   0000001A   7047               BX       LR               ;; return
    361          
    362          /**
    363            * @brief  Specifies if the next DMA transfer will be the last one.
    364            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    365            * @param  NewState: new state of the I2C DMA last transfer.
    366            *   This parameter can be: ENABLE or DISABLE.
    367            * @retval None
    368            */

   \                                 In section .text, align 2, keep-with-next
    369          void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    370          {
    371            /* Check the parameters */
    372            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    373            assert_param(IS_FUNCTIONAL_STATE(NewState));
    374            if (NewState != DISABLE)
   \                     I2C_DMALastTransferCmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_DMALastTransferCmd_0
    375            {
    376              /* Next DMA transfer is the last transfer */
    377              I2Cx->CR2 |= CR2_LAST_Set;
   \   00000006   8288               LDRH     R2,[R0, #+4]
   \   00000008   52F48052           ORRS     R2,R2,#0x1000
   \   0000000C   8280               STRH     R2,[R0, #+4]
   \   0000000E   04E0               B.N      ??I2C_DMALastTransferCmd_1
    378            }
    379            else
    380            {
    381              /* Next DMA transfer is not the last transfer */
    382              I2Cx->CR2 &= CR2_LAST_Reset;
   \                     ??I2C_DMALastTransferCmd_0:
   \   00000010   8288               LDRH     R2,[R0, #+4]
   \   00000012   4EF6FF73           MOVW     R3,#+61439
   \   00000016   1A40               ANDS     R2,R3,R2
   \   00000018   8280               STRH     R2,[R0, #+4]
    383            }
    384          }
   \                     ??I2C_DMALastTransferCmd_1:
   \   0000001A   7047               BX       LR               ;; return
    385          
    386          /**
    387            * @brief  Generates I2Cx communication START condition.
    388            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    389            * @param  NewState: new state of the I2C START condition generation.
    390            *   This parameter can be: ENABLE or DISABLE.
    391            * @retval None.
    392            */

   \                                 In section .text, align 2, keep-with-next
    393          void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState)
    394          {
    395            /* Check the parameters */
    396            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    397            assert_param(IS_FUNCTIONAL_STATE(NewState));
    398            if (NewState != DISABLE)
   \                     I2C_GenerateSTART:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   05D0               BEQ.N    ??I2C_GenerateSTART_0
    399            {
    400              /* Generate a START condition */
    401              I2Cx->CR1 |= CR1_START_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   4FF48073           MOV      R3,#+256
   \   0000000C   1A43               ORRS     R2,R3,R2
   \   0000000E   0280               STRH     R2,[R0, #+0]
   \   00000010   04E0               B.N      ??I2C_GenerateSTART_1
    402            }
    403            else
    404            {
    405              /* Disable the START condition generation */
    406              I2Cx->CR1 &= CR1_START_Reset;
   \                     ??I2C_GenerateSTART_0:
   \   00000012   0288               LDRH     R2,[R0, #+0]
   \   00000014   4FF6FF63           MOVW     R3,#+65279
   \   00000018   1A40               ANDS     R2,R3,R2
   \   0000001A   0280               STRH     R2,[R0, #+0]
    407            }
    408          }
   \                     ??I2C_GenerateSTART_1:
   \   0000001C   7047               BX       LR               ;; return
    409          
    410          /**
    411            * @brief  Generates I2Cx communication STOP condition.
    412            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    413            * @param  NewState: new state of the I2C STOP condition generation.
    414            *   This parameter can be: ENABLE or DISABLE.
    415            * @retval None.
    416            */

   \                                 In section .text, align 2, keep-with-next
    417          void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState)
    418          {
    419            /* Check the parameters */
    420            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    421            assert_param(IS_FUNCTIONAL_STATE(NewState));
    422            if (NewState != DISABLE)
   \                     I2C_GenerateSTOP:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   05D0               BEQ.N    ??I2C_GenerateSTOP_0
    423            {
    424              /* Generate a STOP condition */
    425              I2Cx->CR1 |= CR1_STOP_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   4FF40073           MOV      R3,#+512
   \   0000000C   1A43               ORRS     R2,R3,R2
   \   0000000E   0280               STRH     R2,[R0, #+0]
   \   00000010   04E0               B.N      ??I2C_GenerateSTOP_1
    426            }
    427            else
    428            {
    429              /* Disable the STOP condition generation */
    430              I2Cx->CR1 &= CR1_STOP_Reset;
   \                     ??I2C_GenerateSTOP_0:
   \   00000012   0288               LDRH     R2,[R0, #+0]
   \   00000014   4FF6FF53           MOVW     R3,#+65023
   \   00000018   1A40               ANDS     R2,R3,R2
   \   0000001A   0280               STRH     R2,[R0, #+0]
    431            }
    432          }
   \                     ??I2C_GenerateSTOP_1:
   \   0000001C   7047               BX       LR               ;; return
    433          
    434          /**
    435            * @brief  Enables or disables the specified I2C acknowledge feature.
    436            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    437            * @param  NewState: new state of the I2C Acknowledgement.
    438            *   This parameter can be: ENABLE or DISABLE.
    439            * @retval None.
    440            */

   \                                 In section .text, align 2, keep-with-next
    441          void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState)
    442          {
    443            /* Check the parameters */
    444            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    445            assert_param(IS_FUNCTIONAL_STATE(NewState));
    446            if (NewState != DISABLE)
   \                     I2C_AcknowledgeConfig:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??I2C_AcknowledgeConfig_0
    447            {
    448              /* Enable the acknowledgement */
    449              I2Cx->CR1 |= CR1_ACK_Set;
   \   00000006   0288               LDRH     R2,[R0, #+0]
   \   00000008   52F48062           ORRS     R2,R2,#0x400
   \   0000000C   0280               STRH     R2,[R0, #+0]
   \   0000000E   04E0               B.N      ??I2C_AcknowledgeConfig_1
    450            }
    451            else
    452            {
    453              /* Disable the acknowledgement */
    454              I2Cx->CR1 &= CR1_ACK_Reset;
   \                     ??I2C_AcknowledgeConfig_0:
   \   00000010   0288               LDRH     R2,[R0, #+0]
   \   00000012   4FF6FF33           MOVW     R3,#+64511
   \   00000016   1A40               ANDS     R2,R3,R2
   \   00000018   0280               STRH     R2,[R0, #+0]
    455            }
    456          }
   \                     ??I2C_AcknowledgeConfig_1:
   \   0000001A   7047               BX       LR               ;; return
    457          
    458          /**
    459            * @brief  Configures the specified I2C own address2.
    460            * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.

⌨️ 快捷键说明

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