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

📄 stm32f10x_i2c.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000012   0149               LDR.N    R1,??I2C_StructInit_0  ;; 0x1388
   \   00000014   C160               STR      R1,[R0, #+12]
    279          }
   \   00000016   7047               BX       LR               ;; return
   \                     ??I2C_StructInit_0:
   \   00000018   88130000           DC32     0x1388
    280          
    281          /*******************************************************************************
    282          * Function Name  : I2C_Cmd
    283          * Description    : Enables or disables the specified I2C peripheral.
    284          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    285          *                  - NewState: new state of the I2Cx peripheral. This parameter
    286          *                    can be: ENABLE or DISABLE.
    287          * Output         : None
    288          * Return         : None
    289          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    290          void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    291          {
    292            /* Check the parameters */
    293            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    294            assert_param(IS_FUNCTIONAL_STATE(NewState));
    295          
    296            if (NewState != DISABLE)
   \                     I2C_Cmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   0188               LDRH     R1,[R0, #+0]
   \   00000004   03D0               BEQ.N    ??I2C_Cmd_0
    297            {
    298              /* Enable the selected I2C peripheral */
    299              I2Cx->CR1 |= CR1_PE_Set;
   \   00000006   51F00101           ORRS     R1,R1,#0x1
   \   0000000A   0180               STRH     R1,[R0, #+0]
   \   0000000C   7047               BX       LR
    300            }
    301            else
    302            {
    303              /* Disable the selected I2C peripheral */
    304              I2Cx->CR1 &= CR1_PE_Reset;
   \                     ??I2C_Cmd_0:
   \   0000000E   ....               LDR.N    R2,??DataTable6  ;; 0xfffe
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   0280               STRH     R2,[R0, #+0]
    305            }
    306          }
   \   00000014   7047               BX       LR               ;; return
    307          
    308          /*******************************************************************************
    309          * Function Name  : I2C_DMACmd
    310          * Description    : Enables or disables the specified I2C DMA requests.
    311          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    312          *                  - NewState: new state of the I2C DMA transfer.
    313          *                    This parameter can be: ENABLE or DISABLE.
    314          * Output         : None
    315          * Return         : None
    316          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    317          void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    318          {
    319            /* Check the parameters */
    320            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    321            assert_param(IS_FUNCTIONAL_STATE(NewState));
    322          
    323            if (NewState != DISABLE)
   \                     I2C_DMACmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   8188               LDRH     R1,[R0, #+4]
   \   00000004   03D0               BEQ.N    ??I2C_DMACmd_0
    324            {
    325              /* Enable the selected I2C DMA requests */
    326              I2Cx->CR2 |= CR2_DMAEN_Set;
   \   00000006   51F40061           ORRS     R1,R1,#0x800
   \   0000000A   8180               STRH     R1,[R0, #+4]
   \   0000000C   7047               BX       LR
    327            }
    328            else
    329            {
    330              /* Disable the selected I2C DMA requests */
    331              I2Cx->CR2 &= CR2_DMAEN_Reset;
   \                     ??I2C_DMACmd_0:
   \   0000000E   ....               LDR.N    R2,??DataTable8  ;; 0xf7ff
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   8280               STRH     R2,[R0, #+4]
    332            }
    333          }
   \   00000014   7047               BX       LR               ;; return
    334          
    335          /*******************************************************************************
    336          * Function Name  : I2C_DMALastTransferCmd
    337          * Description    : Specifies that the next DMA transfer is the last one.
    338          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    339          *                  - NewState: new state of the I2C DMA last transfer.
    340          *                    This parameter can be: ENABLE or DISABLE.
    341          * Output         : None
    342          * Return         : None
    343          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    344          void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
    345          {
    346            /* Check the parameters */
    347            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    348            assert_param(IS_FUNCTIONAL_STATE(NewState));
    349          
    350            if (NewState != DISABLE)
   \                     I2C_DMALastTransferCmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   8188               LDRH     R1,[R0, #+4]
   \   00000004   03D0               BEQ.N    ??I2C_DMALastTransferCmd_0
    351            {
    352              /* Next DMA transfer is the last transfer */
    353              I2Cx->CR2 |= CR2_LAST_Set;
   \   00000006   51F48051           ORRS     R1,R1,#0x1000
   \   0000000A   8180               STRH     R1,[R0, #+4]
   \   0000000C   7047               BX       LR
    354            }
    355            else
    356            {
    357              /* Next DMA transfer is not the last transfer */
    358              I2Cx->CR2 &= CR2_LAST_Reset;
   \                     ??I2C_DMALastTransferCmd_0:
   \   0000000E   ....               LDR.N    R2,??DataTable7  ;; 0xefff
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   8280               STRH     R2,[R0, #+4]
    359            }
    360          }
   \   00000014   7047               BX       LR               ;; return
    361          
    362          /*******************************************************************************
    363          * Function Name  : I2C_GenerateSTART
    364          * Description    : Generates I2Cx communication START condition.
    365          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    366          *                  - NewState: new state of the I2C START condition generation.
    367          *                    This parameter can be: ENABLE or DISABLE.
    368          * Output         : None
    369          * Return         : None.
    370          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    371          void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState)
    372          {
    373            /* Check the parameters */
    374            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    375            assert_param(IS_FUNCTIONAL_STATE(NewState));
    376          
    377            if (NewState != DISABLE)
   \                     I2C_GenerateSTART:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   0188               LDRH     R1,[R0, #+0]
   \   00000004   03D0               BEQ.N    ??I2C_GenerateSTART_0
    378            {
    379              /* Generate a START condition */
    380              I2Cx->CR1 |= CR1_START_Set;
   \   00000006   51F48071           ORRS     R1,R1,#0x100
   \   0000000A   0180               STRH     R1,[R0, #+0]
   \   0000000C   7047               BX       LR
    381            }
    382            else
    383            {
    384              /* Disable the START condition generation */
    385              I2Cx->CR1 &= CR1_START_Reset;
   \                     ??I2C_GenerateSTART_0:
   \   0000000E   024A               LDR.N    R2,??I2C_GenerateSTART_1  ;; 0xfeff
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   0280               STRH     R2,[R0, #+0]
    386            }
    387          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??I2C_GenerateSTART_1:
   \   00000018   FFFE0000           DC32     0xfeff
    388          
    389          /*******************************************************************************
    390          * Function Name  : I2C_GenerateSTOP
    391          * Description    : Generates I2Cx communication STOP condition.
    392          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    393          *                  - NewState: new state of the I2C STOP condition generation.
    394          *                    This parameter can be: ENABLE or DISABLE.
    395          * Output         : None
    396          * Return         : None.
    397          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    398          void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState)
    399          {
    400            /* Check the parameters */
    401            assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    402            assert_param(IS_FUNCTIONAL_STATE(NewState));
    403          
    404            if (NewState != DISABLE)
   \                     I2C_GenerateSTOP:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   0188               LDRH     R1,[R0, #+0]
   \   00000004   03D0               BEQ.N    ??I2C_GenerateSTOP_0
    405            {
    406              /* Generate a STOP condition */
    407              I2Cx->CR1 |= CR1_STOP_Set;
   \   00000006   51F40071           ORRS     R1,R1,#0x200
   \   0000000A   0180               STRH     R1,[R0, #+0]
   \   0000000C   7047               BX       LR
    408            }
    409            else
    410            {
    411              /* Disable the STOP condition generation */
    412              I2Cx->CR1 &= CR1_STOP_Reset;
   \                     ??I2C_GenerateSTOP_0:
   \   0000000E   024A               LDR.N    R2,??I2C_GenerateSTOP_1  ;; 0xfdff
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   0280               STRH     R2,[R0, #+0]
    413            }
    414          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??I2C_GenerateSTOP_1:
   \   00000018   FFFD0000           DC32     0xfdff
    415          
    416          /*******************************************************************************
    417          * Function Name  : I2C_AcknowledgeConfig
    418          * Description    : Enables or disables the specified I2C acknowledge feature.
    419          * Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
    420          *                  - NewState: new state of the I2C Acknowledgement.
    421          *                    This parameter can be: ENABLE or DISABLE.
    422          * Output         : None
    423          * Return         : None.
    424          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    425          void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState)
    426          {
    427            /* Check the parameters */
    428            assert_param(IS_I2C_ALL_PERIPH(I2Cx));

⌨️ 快捷键说明

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