; generated by ARM C/C++ Compiler, 4.1 [Build 894]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o.\STM324xG_EVAL\stm32f4xx_i2c.o --asm_dir=.\STM324xG_EVAL\ --list_dir=.\STM324xG_EVAL\ --depend=.\STM324xG_EVAL\stm32f4xx_i2c.d --cpu=Cortex-M4.fp --apcs=interwork -O0 -Otime -I..\ -I..\..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\Utilities\STM32_EVAL\Common -I..\..\..\Utilities\STM32_EVAL\STM3240_41_G_EVAL -IC:\Keil\ARM\RV31\Inc -IC:\Keil\ARM\CMSIS\Include -IC:\Keil\ARM\Inc\ST\STM32F4xx -D__MICROLIB -DUSE_STM324xG_EVAL -DSTM32F4XX -DUSE_STDPERIPH_DRIVER --omf_browse=.\STM324xG_EVAL\stm32f4xx_i2c.crf ..\..\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.c]
                          THUMB

                          AREA ||i.I2C_ARPCmd||, CODE, READONLY, ALIGN=1

                  I2C_ARPCmd PROC
;;;650      */
;;;651    void I2C_ARPCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L1.12|
;;;652    {
;;;653      /* Check the parameters */
;;;654      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;655      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;656      if (NewState != DISABLE)
;;;657      {
;;;658        /* Enable the selected I2C ARP */
;;;659        I2Cx->CR1 |= I2C_CR1_ENARP;
000002  8802              LDRH     r2,[r0,#0]
000004  f0420210          ORR      r2,r2,#0x10
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L1.22|
                  |L1.12|
;;;660      }
;;;661      else
;;;662      {
;;;663        /* Disable the selected I2C ARP */
;;;664        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ENARP);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f73ef          MOV      r3,#0xffef
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L1.22|
;;;665      }
;;;666    }
000016  4770              BX       lr
;;;667    /**
                          ENDP


                          AREA ||i.I2C_AcknowledgeConfig||, CODE, READONLY, ALIGN=1

                  I2C_AcknowledgeConfig PROC
;;;410      */
;;;411    void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L2.12|
;;;412    {
;;;413      /* Check the parameters */
;;;414      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;415      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;416      if (NewState != DISABLE)
;;;417      {
;;;418        /* Enable the acknowledgement */
;;;419        I2Cx->CR1 |= I2C_CR1_ACK;
000002  8802              LDRH     r2,[r0,#0]
000004  f4426280          ORR      r2,r2,#0x400
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L2.22|
                  |L2.12|
;;;420      }
;;;421      else
;;;422      {
;;;423        /* Disable the acknowledgement */
;;;424        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ACK);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f33ff          MOV      r3,#0xfbff
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L2.22|
;;;425      }
;;;426    }
000016  4770              BX       lr
;;;427    
                          ENDP


                          AREA ||i.I2C_CalculatePEC||, CODE, READONLY, ALIGN=1

                  I2C_CalculatePEC PROC
;;;787      */
;;;788    void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L3.12|
;;;789    {
;;;790      /* Check the parameters */
;;;791      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;792      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;793      if (NewState != DISABLE)
;;;794      {
;;;795        /* Enable the selected I2C PEC calculation */
;;;796        I2Cx->CR1 |= I2C_CR1_ENPEC;
000002  8802              LDRH     r2,[r0,#0]
000004  f0420220          ORR      r2,r2,#0x20
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L3.22|
                  |L3.12|
;;;797      }
;;;798      else
;;;799      {
;;;800        /* Disable the selected I2C PEC calculation */
;;;801        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ENPEC);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f73df          MOV      r3,#0xffdf
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L3.22|
;;;802      }
;;;803    }
000016  4770              BX       lr
;;;804    
                          ENDP


                          AREA ||i.I2C_CheckEvent||, CODE, READONLY, ALIGN=1

                  I2C_CheckEvent PROC
;;;1090     */
;;;1091   ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, uint32_t I2C_EVENT)
000000  b530              PUSH     {r4,r5,lr}
;;;1092   {
000002  4602              MOV      r2,r0
;;;1093     uint32_t lastevent = 0;
000004  2400              MOVS     r4,#0
;;;1094     uint32_t flag1 = 0, flag2 = 0;
000006  46a4              MOV      r12,r4
000008  2300              MOVS     r3,#0
;;;1095     ErrorStatus status = ERROR;
00000a  2000              MOVS     r0,#0
;;;1096   
;;;1097     /* Check the parameters */
;;;1098     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1099     assert_param(IS_I2C_EVENT(I2C_EVENT));
;;;1100   
;;;1101     /* Read the I2Cx status register */
;;;1102     flag1 = I2Cx->SR1;
00000c  f8b2c014          LDRH     r12,[r2,#0x14]
;;;1103     flag2 = I2Cx->SR2;
000010  8b13              LDRH     r3,[r2,#0x18]
;;;1104     flag2 = flag2 << 16;
000012  041b              LSLS     r3,r3,#16
;;;1105   
;;;1106     /* Get the last event value from I2C status register */
;;;1107     lastevent = (flag1 | flag2) & FLAG_MASK;
000014  ea4c0503          ORR      r5,r12,r3
000018  f025447f          BIC      r4,r5,#0xff000000
;;;1108   
;;;1109     /* Check whether the last event contains the I2C_EVENT */
;;;1110     if ((lastevent & I2C_EVENT) == I2C_EVENT)
00001c  ea040501          AND      r5,r4,r1
000020  428d              CMP      r5,r1
000022  d101              BNE      |L4.40|
;;;1111     {
;;;1112       /* SUCCESS: last event is equal to I2C_EVENT */
;;;1113       status = SUCCESS;
000024  2001              MOVS     r0,#1
000026  e000              B        |L4.42|
                  |L4.40|
;;;1114     }
;;;1115     else
;;;1116     {
;;;1117       /* ERROR: last event is different from I2C_EVENT */
;;;1118       status = ERROR;
000028  2000              MOVS     r0,#0
                  |L4.42|
;;;1119     }
;;;1120     /* Return status */
;;;1121     return status;
;;;1122   }
00002a  bd30              POP      {r4,r5,pc}
;;;1123   
                          ENDP


                          AREA ||i.I2C_ClearFlag||, CODE, READONLY, ALIGN=1

                  I2C_ClearFlag PROC
;;;1270     */
;;;1271   void I2C_ClearFlag(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG)
000000  2200              MOVS     r2,#0
;;;1272   {
;;;1273     uint32_t flagpos = 0;
;;;1274     /* Check the parameters */
;;;1275     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1276     assert_param(IS_I2C_CLEAR_FLAG(I2C_FLAG));
;;;1277     /* Get the I2C flag position */
;;;1278     flagpos = I2C_FLAG & FLAG_MASK;
000002  f021427f          BIC      r2,r1,#0xff000000
;;;1279     /* Clear the selected I2C flag */
;;;1280     I2Cx->SR1 = (uint16_t)~flagpos;
000006  43d3              MVNS     r3,r2
000008  8283              STRH     r3,[r0,#0x14]
;;;1281   }
00000a  4770              BX       lr
;;;1282   
                          ENDP


                          AREA ||i.I2C_ClearITPendingBit||, CODE, READONLY, ALIGN=1

                  I2C_ClearITPendingBit PROC
;;;1364     */
;;;1365   void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT)
000000  2200              MOVS     r2,#0
;;;1366   {
;;;1367     uint32_t flagpos = 0;
;;;1368     /* Check the parameters */
;;;1369     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1370     assert_param(IS_I2C_CLEAR_IT(I2C_IT));
;;;1371   
;;;1372     /* Get the I2C flag position */
;;;1373     flagpos = I2C_IT & FLAG_MASK;
000002  f021427f          BIC      r2,r1,#0xff000000
;;;1374   
;;;1375     /* Clear the selected I2C flag */
;;;1376     I2Cx->SR1 = (uint16_t)~flagpos;
000006  43d3              MVNS     r3,r2
000008  8283              STRH     r3,[r0,#0x14]
;;;1377   }
00000a  4770              BX       lr
;;;1378   
                          ENDP


                          AREA ||i.I2C_Cmd||, CODE, READONLY, ALIGN=1

                  I2C_Cmd PROC
;;;307      */
;;;308    void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L7.12|
;;;309    {
;;;310      /* Check the parameters */
;;;311      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;312      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;313      if (NewState != DISABLE)
;;;314      {
;;;315        /* Enable the selected I2C peripheral */
;;;316        I2Cx->CR1 |= I2C_CR1_PE;
000002  8802              LDRH     r2,[r0,#0]
000004  f0420201          ORR      r2,r2,#1
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L7.22|
                  |L7.12|
;;;317      }
;;;318      else
;;;319      {
;;;320        /* Disable the selected I2C peripheral */
;;;321        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_PE);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f73fe          MOV      r3,#0xfffe
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L7.22|
;;;322      }
;;;323    }
000016  4770              BX       lr
;;;324    
                          ENDP


                          AREA ||i.I2C_DMACmd||, CODE, READONLY, ALIGN=1

                  I2C_DMACmd PROC
;;;842      */
;;;843    void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L8.12|
;;;844    {
;;;845      /* Check the parameters */
;;;846      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;847      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;848      if (NewState != DISABLE)
;;;849      {
;;;850        /* Enable the selected I2C DMA requests */
;;;851        I2Cx->CR2 |= I2C_CR2_DMAEN;
000002  8882              LDRH     r2,[r0,#4]
000004  f4426200          ORR      r2,r2,#0x800
000008  8082              STRH     r2,[r0,#4]
00000a  e004              B        |L8.22|
                  |L8.12|
;;;852      }
;;;853      else
;;;854      {
;;;855        /* Disable the selected I2C DMA requests */
;;;856        I2Cx->CR2 &= (uint16_t)~((uint16_t)I2C_CR2_DMAEN);
00000c  8882              LDRH     r2,[r0,#4]
00000e  f24f73ff          MOV      r3,#0xf7ff
000012  401a              ANDS     r2,r2,r3
000014  8082              STRH     r2,[r0,#4]
                  |L8.22|
;;;857      }
;;;858    }
000016  4770              BX       lr
;;;859    
                          ENDP


                          AREA ||i.I2C_DMALastTransferCmd||, CODE, READONLY, ALIGN=1

                  I2C_DMALastTransferCmd PROC
;;;866      */
;;;867    void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L9.12|
;;;868    {
;;;869      /* Check the parameters */
;;;870      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;871      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;872      if (NewState != DISABLE)
;;;873      {
;;;874        /* Next DMA transfer is the last transfer */
;;;875        I2Cx->CR2 |= I2C_CR2_LAST;
000002  8882              LDRH     r2,[r0,#4]
000004  f4425280          ORR      r2,r2,#0x1000
000008  8082              STRH     r2,[r0,#4]
00000a  e004              B        |L9.22|
                  |L9.12|
;;;876      }
;;;877      else
;;;878      {
;;;879        /* Next DMA transfer is not the last transfer */
;;;880        I2Cx->CR2 &= (uint16_t)~((uint16_t)I2C_CR2_LAST);
00000c  8882              LDRH     r2,[r0,#4]
00000e  f64e73ff          MOV      r3,#0xefff
000012  401a              ANDS     r2,r2,r3
000014  8082              STRH     r2,[r0,#4]
                  |L9.22|
;;;881      }
;;;882    }
000016  4770              BX       lr
;;;883    
                          ENDP


                          AREA ||i.I2C_DeInit||, CODE, READONLY, ALIGN=2

                  I2C_DeInit PROC
;;;131      */
;;;132    void I2C_DeInit(I2C_TypeDef* I2Cx)
000000  b510              PUSH     {r4,lr}
;;;133    {
000002  4604              MOV      r4,r0
;;;134      /* Check the parameters */
;;;135      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;136    
;;;137      if (I2Cx == I2C1)
000004  4813              LDR      r0,|L10.84|
000006  4284              CMP      r4,r0
000008  d109              BNE      |L10.30|
;;;138      {
;;;139        /* Enable I2C1 reset state */
;;;140        RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C1, ENABLE);
00000a  2101              MOVS     r1,#1
00000c  0548              LSLS     r0,r1,#21
00000e  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;141        /* Release I2C1 from reset state */
;;;142        RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C1, DISABLE);    
000012  2100              MOVS     r1,#0
000014  f44f1000          MOV      r0,#0x200000
000018  f7fffffe          BL       RCC_APB1PeriphResetCmd
00001c  e018              B        |L10.80|
                  |L10.30|
;;;143      }
;;;144      else if (I2Cx == I2C2)
00001e  480e              LDR      r0,|L10.88|
000020  4284              CMP      r4,r0
000022  d109              BNE      |L10.56|
;;;145      {
;;;146        /* Enable I2C2 reset state */
;;;147        RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C2, ENABLE);
000024  2101              MOVS     r1,#1
000026  0588              LSLS     r0,r1,#22
000028  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;148        /* Release I2C2 from reset state */
;;;149        RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C2, DISABLE);      
00002c  2100              MOVS     r1,#0
00002e  f44f0080          MOV      r0,#0x400000
000032  f7fffffe          BL       RCC_APB1PeriphResetCmd
000036  e00b              B        |L10.80|
                  |L10.56|
;;;150      }
;;;151      else 
;;;152      {
;;;153        if (I2Cx == I2C3)
000038  4808              LDR      r0,|L10.92|
00003a  4284              CMP      r4,r0
00003c  d108              BNE      |L10.80|
;;;154        {
;;;155          /* Enable I2C3 reset state */
;;;156          RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C3, ENABLE);
00003e  2101              MOVS     r1,#1
000040  05c8              LSLS     r0,r1,#23
000042  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;157          /* Release I2C3 from reset state */
;;;158          RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C3, DISABLE);     
000046  2100              MOVS     r1,#0
000048  f44f0000          MOV      r0,#0x800000
00004c  f7fffffe          BL       RCC_APB1PeriphResetCmd
                  |L10.80|
;;;159        }
;;;160      }
;;;161    }
000050  bd10              POP      {r4,pc}
;;;162    
                          ENDP

000052  0000              DCW      0x0000
                  |L10.84|
                          DCD      0x40005400
                  |L10.88|
                          DCD      0x40005800
                  |L10.92|
                          DCD      0x40005c00

                          AREA ||i.I2C_DualAddressCmd||, CODE, READONLY, ALIGN=1

                  I2C_DualAddressCmd PROC
;;;460      */
;;;461    void I2C_DualAddressCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L11.12|
;;;462    {
;;;463      /* Check the parameters */
;;;464      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;465      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;466      if (NewState != DISABLE)
;;;467      {
;;;468        /* Enable dual addressing mode */
;;;469        I2Cx->OAR2 |= I2C_OAR2_ENDUAL;
000002  8982              LDRH     r2,[r0,#0xc]
000004  f0420201          ORR      r2,r2,#1
000008  8182              STRH     r2,[r0,#0xc]
00000a  e004              B        |L11.22|
                  |L11.12|
;;;470      }
;;;471      else
;;;472      {
;;;473        /* Disable dual addressing mode */
;;;474        I2Cx->OAR2 &= (uint16_t)~((uint16_t)I2C_OAR2_ENDUAL);
00000c  8982              LDRH     r2,[r0,#0xc]
00000e  f64f73fe          MOV      r3,#0xfffe
000012  401a              ANDS     r2,r2,r3
000014  8182              STRH     r2,[r0,#0xc]
                  |L11.22|
;;;475      }
;;;476    }
000016  4770              BX       lr
;;;477    
                          ENDP


                          AREA ||i.I2C_FastModeDutyCycleConfig||, CODE, READONLY, ALIGN=1

                  I2C_FastModeDutyCycleConfig PROC
;;;560      */
;;;561    void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, uint16_t I2C_DutyCycle)
000000  f5b14f80          CMP      r1,#0x4000
;;;562    {
;;;563      /* Check the parameters */
;;;564      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;565      assert_param(IS_I2C_DUTY_CYCLE(I2C_DutyCycle));
;;;566      if (I2C_DutyCycle != I2C_DutyCycle_16_9)
000004  d005              BEQ      |L12.18|
;;;567      {
;;;568        /* I2C fast mode Tlow/Thigh=2 */
;;;569        I2Cx->CCR &= I2C_DutyCycle_2;
000006  8b82              LDRH     r2,[r0,#0x1c]
000008  f64b73ff          MOV      r3,#0xbfff
00000c  401a              ANDS     r2,r2,r3
00000e  8382              STRH     r2,[r0,#0x1c]
000010  e003              B        |L12.26|
                  |L12.18|
;;;570      }
;;;571      else
;;;572      {
;;;573        /* I2C fast mode Tlow/Thigh=16/9 */
;;;574        I2Cx->CCR |= I2C_DutyCycle_16_9;
000012  8b82              LDRH     r2,[r0,#0x1c]
000014  f4424280          ORR      r2,r2,#0x4000
000018  8382              STRH     r2,[r0,#0x1c]
                  |L12.26|
;;;575      }
;;;576    }
00001a  4770              BX       lr
;;;577    
                          ENDP


                          AREA ||i.I2C_GeneralCallCmd||, CODE, READONLY, ALIGN=1

                  I2C_GeneralCallCmd PROC
;;;484      */
;;;485    void I2C_GeneralCallCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L13.12|
;;;486    {
;;;487      /* Check the parameters */
;;;488      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;489      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;490      if (NewState != DISABLE)
;;;491      {
;;;492        /* Enable generall call */
;;;493        I2Cx->CR1 |= I2C_CR1_ENGC;
000002  8802              LDRH     r2,[r0,#0]
000004  f0420240          ORR      r2,r2,#0x40
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L13.22|
                  |L13.12|
;;;494      }
;;;495      else
;;;496      {
;;;497        /* Disable generall call */
;;;498        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ENGC);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f73bf          MOV      r3,#0xffbf
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L13.22|
;;;499      }
;;;500    }
000016  4770              BX       lr
;;;501    
                          ENDP


                          AREA ||i.I2C_GenerateSTART||, CODE, READONLY, ALIGN=1

                  I2C_GenerateSTART PROC
;;;331      */
;;;332    void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L14.12|
;;;333    {
;;;334      /* Check the parameters */
;;;335      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;336      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;337      if (NewState != DISABLE)
;;;338      {
;;;339        /* Generate a START condition */
;;;340        I2Cx->CR1 |= I2C_CR1_START;
000002  8802              LDRH     r2,[r0,#0]
000004  f4427280          ORR      r2,r2,#0x100
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L14.22|
                  |L14.12|
;;;341      }
;;;342      else
;;;343      {
;;;344        /* Disable the START condition generation */
;;;345        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_START);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f63ff          MOV      r3,#0xfeff
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L14.22|
;;;346      }
;;;347    }
000016  4770              BX       lr
;;;348    
                          ENDP


                          AREA ||i.I2C_GenerateSTOP||, CODE, READONLY, ALIGN=1

                  I2C_GenerateSTOP PROC
;;;355      */
;;;356    void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L15.12|
;;;357    {
;;;358      /* Check the parameters */
;;;359      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;360      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;361      if (NewState != DISABLE)
;;;362      {
;;;363        /* Generate a STOP condition */
;;;364        I2Cx->CR1 |= I2C_CR1_STOP;
000002  8802              LDRH     r2,[r0,#0]
000004  f4427200          ORR      r2,r2,#0x200
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L15.22|
                  |L15.12|
;;;365      }
;;;366      else
;;;367      {
;;;368        /* Disable the STOP condition generation */
;;;369        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_STOP);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f53ff          MOV      r3,#0xfdff
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L15.22|
;;;370      }
;;;371    }
000016  4770              BX       lr
;;;372    
                          ENDP


                          AREA ||i.I2C_GetFlagStatus||, CODE, READONLY, ALIGN=1

                  I2C_GetFlagStatus PROC
;;;1193     */
;;;1194   FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG)
000000  b510              PUSH     {r4,lr}
;;;1195   {
000002  4603              MOV      r3,r0
;;;1196     FlagStatus bitstatus = RESET;
000004  2000              MOVS     r0,#0
;;;1197     __IO uint32_t i2creg = 0, i2cxbase = 0;
000006  4684              MOV      r12,r0
000008  2200              MOVS     r2,#0
;;;1198   
;;;1199     /* Check the parameters */
;;;1200     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1201     assert_param(IS_I2C_GET_FLAG(I2C_FLAG));
;;;1202   
;;;1203     /* Get the I2Cx peripheral base address */
;;;1204     i2cxbase = (uint32_t)I2Cx;
00000a  461a              MOV      r2,r3
;;;1205     
;;;1206     /* Read flag register index */
;;;1207     i2creg = I2C_FLAG >> 28;
00000c  ea4f7c11          LSR      r12,r1,#28
;;;1208     
;;;1209     /* Get bit[23:0] of the flag */
;;;1210     I2C_FLAG &= FLAG_MASK;
000010  f021417f          BIC      r1,r1,#0xff000000
;;;1211     
;;;1212     if(i2creg != 0)
000014  f1bc0f00          CMP      r12,#0
000018  d001              BEQ      |L16.30|
;;;1213     {
;;;1214       /* Get the I2Cx SR1 register address */
;;;1215       i2cxbase += 0x14;
00001a  3214              ADDS     r2,r2,#0x14
00001c  e001              B        |L16.34|
                  |L16.30|
;;;1216     }
;;;1217     else
;;;1218     {
;;;1219       /* Flag in I2Cx SR2 Register */
;;;1220       I2C_FLAG = (uint32_t)(I2C_FLAG >> 16);
00001e  0c09              LSRS     r1,r1,#16
;;;1221       /* Get the I2Cx SR2 register address */
;;;1222       i2cxbase += 0x18;
000020  3218              ADDS     r2,r2,#0x18
                  |L16.34|
;;;1223     }
;;;1224     
;;;1225     if(((*(__IO uint32_t *)i2cxbase) & I2C_FLAG) != (uint32_t)RESET)
000022  6814              LDR      r4,[r2,#0]
000024  420c              TST      r4,r1
000026  d001              BEQ      |L16.44|
;;;1226     {
;;;1227       /* I2C_FLAG is set */
;;;1228       bitstatus = SET;
000028  2001              MOVS     r0,#1
00002a  e000              B        |L16.46|
                  |L16.44|
;;;1229     }
;;;1230     else
;;;1231     {
;;;1232       /* I2C_FLAG is reset */
;;;1233       bitstatus = RESET;
00002c  2000              MOVS     r0,#0
                  |L16.46|
;;;1234     }
;;;1235     
;;;1236     /* Return the I2C_FLAG status */
;;;1237     return  bitstatus;
;;;1238   }
00002e  bd10              POP      {r4,pc}
;;;1239   
                          ENDP


                          AREA ||i.I2C_GetITStatus||, CODE, READONLY, ALIGN=1

                  I2C_GetITStatus PROC
;;;1304     */
;;;1305   ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, uint32_t I2C_IT)
000000  b530              PUSH     {r4,r5,lr}
;;;1306   {
000002  4602              MOV      r2,r0
;;;1307     ITStatus bitstatus = RESET;
000004  2000              MOVS     r0,#0
;;;1308     uint32_t enablestatus = 0;
000006  2300              MOVS     r3,#0
;;;1309   
;;;1310     /* Check the parameters */
;;;1311     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1312     assert_param(IS_I2C_GET_IT(I2C_IT));
;;;1313   
;;;1314     /* Check if the interrupt source is enabled or not */
;;;1315     enablestatus = (uint32_t)(((I2C_IT & ITEN_MASK) >> 16) & (I2Cx->CR2)) ;
000008  8894              LDRH     r4,[r2,#4]
00000a  f00165e0          AND      r5,r1,#0x7000000
00000e  ea044315          AND      r3,r4,r5,LSR #16
;;;1316     
;;;1317     /* Get bit[23:0] of the flag */
;;;1318     I2C_IT &= FLAG_MASK;
000012  f021417f          BIC      r1,r1,#0xff000000
;;;1319   
;;;1320     /* Check the status of the specified I2C flag */
;;;1321     if (((I2Cx->SR1 & I2C_IT) != (uint32_t)RESET) && enablestatus)
000016  8a94              LDRH     r4,[r2,#0x14]
000018  420c              TST      r4,r1
00001a  d002              BEQ      |L17.34|
00001c  b10b              CBZ      r3,|L17.34|
;;;1322     {
;;;1323       /* I2C_IT is set */
;;;1324       bitstatus = SET;
00001e  2001              MOVS     r0,#1
000020  e000              B        |L17.36|
                  |L17.34|
;;;1325     }
;;;1326     else
;;;1327     {
;;;1328       /* I2C_IT is reset */
;;;1329       bitstatus = RESET;
000022  2000              MOVS     r0,#0
                  |L17.36|
;;;1330     }
;;;1331     /* Return the I2C_IT status */
;;;1332     return  bitstatus;
;;;1333   }
000024  bd30              POP      {r4,r5,pc}
;;;1334   
                          ENDP


                          AREA ||i.I2C_GetLastEvent||, CODE, READONLY, ALIGN=1

                  I2C_GetLastEvent PROC
;;;1138     */
;;;1139   uint32_t I2C_GetLastEvent(I2C_TypeDef* I2Cx)
000000  b510              PUSH     {r4,lr}
;;;1140   {
000002  4601              MOV      r1,r0
;;;1141     uint32_t lastevent = 0;
000004  2000              MOVS     r0,#0
;;;1142     uint32_t flag1 = 0, flag2 = 0;
000006  2300              MOVS     r3,#0
000008  2200              MOVS     r2,#0
;;;1143   
;;;1144     /* Check the parameters */
;;;1145     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1146   
;;;1147     /* Read the I2Cx status register */
;;;1148     flag1 = I2Cx->SR1;
00000a  8a8b              LDRH     r3,[r1,#0x14]
;;;1149     flag2 = I2Cx->SR2;
00000c  8b0a              LDRH     r2,[r1,#0x18]
;;;1150     flag2 = flag2 << 16;
00000e  0412              LSLS     r2,r2,#16
;;;1151   
;;;1152     /* Get the last event value from I2C status register */
;;;1153     lastevent = (flag1 | flag2) & FLAG_MASK;
000010  ea430402          ORR      r4,r3,r2
000014  f024407f          BIC      r0,r4,#0xff000000
;;;1154   
;;;1155     /* Return status */
;;;1156     return lastevent;
;;;1157   }
000018  bd10              POP      {r4,pc}
;;;1158   
                          ENDP


                          AREA ||i.I2C_GetPEC||, CODE, READONLY, ALIGN=1

                  I2C_GetPEC PROC
;;;809      */
;;;810    uint8_t I2C_GetPEC(I2C_TypeDef* I2Cx)
000000  4601              MOV      r1,r0
;;;811    {
;;;812      /* Check the parameters */
;;;813      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;814      /* Return the selected I2C PEC value */
;;;815      return ((I2Cx->SR2) >> 8);
000002  8b08              LDRH     r0,[r1,#0x18]
000004  1200              ASRS     r0,r0,#8
;;;816    }
000006  4770              BX       lr
;;;817    
                          ENDP


                          AREA ||i.I2C_ITConfig||, CODE, READONLY, ALIGN=1

                  I2C_ITConfig PROC
;;;1031     */
;;;1032   void I2C_ITConfig(I2C_TypeDef* I2Cx, uint16_t I2C_IT, FunctionalState NewState)
000000  b510              PUSH     {r4,lr}
;;;1033   {
;;;1034     /* Check the parameters */
;;;1035     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1036     assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;1037     assert_param(IS_I2C_CONFIG_IT(I2C_IT));
;;;1038     
;;;1039     if (NewState != DISABLE)
000002  b11a              CBZ      r2,|L20.12|
;;;1040     {
;;;1041       /* Enable the selected I2C interrupts */
;;;1042       I2Cx->CR2 |= I2C_IT;
000004  8883              LDRH     r3,[r0,#4]
000006  430b              ORRS     r3,r3,r1
000008  8083              STRH     r3,[r0,#4]
00000a  e004              B        |L20.22|
                  |L20.12|
;;;1043     }
;;;1044     else
;;;1045     {
;;;1046       /* Disable the selected I2C interrupts */
;;;1047       I2Cx->CR2 &= (uint16_t)~I2C_IT;
00000c  8883              LDRH     r3,[r0,#4]
00000e  43cc              MVNS     r4,r1
000010  b2a4              UXTH     r4,r4
000012  4023              ANDS     r3,r3,r4
000014  8083              STRH     r3,[r0,#4]
                  |L20.22|
;;;1048     }
;;;1049   }
000016  bd10              POP      {r4,pc}
;;;1050   
                          ENDP


                          AREA ||i.I2C_Init||, CODE, READONLY, ALIGN=2

                  I2C_Init PROC
;;;174      */
;;;175    void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct)
000000  e92d47ff          PUSH     {r0-r10,lr}
;;;176    {
000004  4604              MOV      r4,r0
000006  460d              MOV      r5,r1
;;;177      uint16_t tmpreg = 0, freqrange = 0;
000008  2600              MOVS     r6,#0
00000a  46b1              MOV      r9,r6
;;;178      uint16_t result = 0x04;
00000c  2704              MOVS     r7,#4
;;;179      uint32_t pclk1 = 8000000;
00000e  f8df80cc          LDR      r8,|L21.220|
;;;180      RCC_ClocksTypeDef  rcc_clocks;
;;;181      /* Check the parameters */
;;;182      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;183      assert_param(IS_I2C_CLOCK_SPEED(I2C_InitStruct->I2C_ClockSpeed));
;;;184      assert_param(IS_I2C_MODE(I2C_InitStruct->I2C_Mode));
;;;185      assert_param(IS_I2C_DUTY_CYCLE(I2C_InitStruct->I2C_DutyCycle));
;;;186      assert_param(IS_I2C_OWN_ADDRESS1(I2C_InitStruct->I2C_OwnAddress1));
;;;187      assert_param(IS_I2C_ACK_STATE(I2C_InitStruct->I2C_Ack));
;;;188      assert_param(IS_I2C_ACKNOWLEDGE_ADDRESS(I2C_InitStruct->I2C_AcknowledgedAddress));
;;;189    
;;;190    /*---------------------------- I2Cx CR2 Configuration ------------------------*/
;;;191      /* Get the I2Cx CR2 value */
;;;192      tmpreg = I2Cx->CR2;
000012  88a6              LDRH     r6,[r4,#4]
;;;193      /* Clear frequency FREQ[5:0] bits */
;;;194      tmpreg &= (uint16_t)~((uint16_t)I2C_CR2_FREQ);
000014  f64f70c0          MOV      r0,#0xffc0
000018  4006              ANDS     r6,r6,r0
;;;195      /* Get pclk1 frequency value */
;;;196      RCC_GetClocksFreq(&rcc_clocks);
00001a  4668              MOV      r0,sp
00001c  f7fffffe          BL       RCC_GetClocksFreq
;;;197      pclk1 = rcc_clocks.PCLK1_Frequency;
000020  f8dd8008          LDR      r8,[sp,#8]
;;;198      /* Set frequency bits depending on pclk1 value */
;;;199      freqrange = (uint16_t)(pclk1 / 1000000);
000024  482e              LDR      r0,|L21.224|
000026  fbb8f0f0          UDIV     r0,r8,r0
00002a  fa1ff980          UXTH     r9,r0
;;;200      tmpreg |= freqrange;
00002e  ea460609          ORR      r6,r6,r9
;;;201      /* Write to I2Cx CR2 */
;;;202      I2Cx->CR2 = tmpreg;
000032  80a6              STRH     r6,[r4,#4]
;;;203    
;;;204    /*---------------------------- I2Cx CCR Configuration ------------------------*/
;;;205      /* Disable the selected I2C peripheral to configure TRISE */
;;;206      I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_PE);
000034  8820              LDRH     r0,[r4,#0]
000036  f64f71fe          MOV      r1,#0xfffe
00003a  4008              ANDS     r0,r0,r1
00003c  8020              STRH     r0,[r4,#0]
;;;207      /* Reset tmpreg value */
;;;208      /* Clear F/S, DUTY and CCR[11:0] bits */
;;;209      tmpreg = 0;
00003e  2600              MOVS     r6,#0
;;;210    
;;;211      /* Configure speed in standard mode */
;;;212      if (I2C_InitStruct->I2C_ClockSpeed <= 100000)
000040  4928              LDR      r1,|L21.228|
000042  6828              LDR      r0,[r5,#0]
000044  4288              CMP      r0,r1
000046  d80c              BHI      |L21.98|
;;;213      {
;;;214        /* Standard mode speed calculate */
;;;215        result = (uint16_t)(pclk1 / (I2C_InitStruct->I2C_ClockSpeed << 1));
000048  6828              LDR      r0,[r5,#0]
00004a  0040              LSLS     r0,r0,#1
00004c  fbb8f0f0          UDIV     r0,r8,r0
000050  b287              UXTH     r7,r0
;;;216        /* Test if CCR value is under 0x4*/
;;;217        if (result < 0x04)
000052  2f04              CMP      r7,#4
000054  da00              BGE      |L21.88|
;;;218        {
;;;219          /* Set minimum allowed value */
;;;220          result = 0x04;  
000056  2704              MOVS     r7,#4
                  |L21.88|
;;;221        }
;;;222        /* Set speed value for standard mode */
;;;223        tmpreg |= result;	  
000058  433e              ORRS     r6,r6,r7
;;;224        /* Set Maximum Rise Time for standard mode */
;;;225        I2Cx->TRISE = freqrange + 1; 
00005a  f1090001          ADD      r0,r9,#1
00005e  8420              STRH     r0,[r4,#0x20]
000060  e027              B        |L21.178|
                  |L21.98|
;;;226      }
;;;227      /* Configure speed in fast mode */
;;;228      /* To use the I2C at 400 KHz (in fast mode), the PCLK1 frequency (I2C peripheral
;;;229         input clock) must be a multiple of 10 MHz */
;;;230      else /*(I2C_InitStruct->I2C_ClockSpeed <= 400000)*/
;;;231      {
;;;232        if (I2C_InitStruct->I2C_DutyCycle == I2C_DutyCycle_2)
000062  88e8              LDRH     r0,[r5,#6]
000064  f5a0413f          SUB      r1,r0,#0xbf00
000068  39ff              SUBS     r1,r1,#0xff
00006a  d106              BNE      |L21.122|
;;;233        {
;;;234          /* Fast mode speed calculate: Tlow/Thigh = 2 */
;;;235          result = (uint16_t)(pclk1 / (I2C_InitStruct->I2C_ClockSpeed * 3));
00006c  6828              LDR      r0,[r5,#0]
00006e  eb000040          ADD      r0,r0,r0,LSL #1
000072  fbb8f0f0          UDIV     r0,r8,r0
000076  b287              UXTH     r7,r0
000078  e009              B        |L21.142|
                  |L21.122|
;;;236        }
;;;237        else /*I2C_InitStruct->I2C_DutyCycle == I2C_DutyCycle_16_9*/
;;;238        {
;;;239          /* Fast mode speed calculate: Tlow/Thigh = 16/9 */
;;;240          result = (uint16_t)(pclk1 / (I2C_InitStruct->I2C_ClockSpeed * 25));
00007a  6828              LDR      r0,[r5,#0]
00007c  eb0001c0          ADD      r1,r0,r0,LSL #3
000080  eb011000          ADD      r0,r1,r0,LSL #4
000084  fbb8f0f0          UDIV     r0,r8,r0
000088  b287              UXTH     r7,r0
;;;241          /* Set DUTY bit */
;;;242          result |= I2C_DutyCycle_16_9;
00008a  f4474780          ORR      r7,r7,#0x4000
                  |L21.142|
;;;243        }
;;;244    
;;;245        /* Test if CCR value is under 0x1*/
;;;246        if ((result & I2C_CCR_CCR) == 0)
00008e  0538              LSLS     r0,r7,#20
000090  0d00              LSRS     r0,r0,#20
000092  d101              BNE      |L21.152|
;;;247        {
;;;248          /* Set minimum allowed value */
;;;249          result |= (uint16_t)0x0001;  
000094  f0470701          ORR      r7,r7,#1
                  |L21.152|
;;;250        }
;;;251        /* Set speed value and set F/S bit for fast mode */
;;;252        tmpreg |= (uint16_t)(result | I2C_CCR_FS);
000098  f4474000          ORR      r0,r7,#0x8000
00009c  4306              ORRS     r6,r6,r0
;;;253        /* Set Maximum Rise Time for fast mode */
;;;254        I2Cx->TRISE = (uint16_t)(((freqrange * (uint16_t)300) / (uint16_t)1000) + (uint16_t)1);  
00009e  f44f7096          MOV      r0,#0x12c
0000a2  fb09f000          MUL      r0,r9,r0
0000a6  f44f717a          MOV      r1,#0x3e8
0000aa  fb90f0f1          SDIV     r0,r0,r1
0000ae  1c40              ADDS     r0,r0,#1
0000b0  8420              STRH     r0,[r4,#0x20]
                  |L21.178|
;;;255      }
;;;256    
;;;257      /* Write to I2Cx CCR */
;;;258      I2Cx->CCR = tmpreg;
0000b2  83a6              STRH     r6,[r4,#0x1c]
;;;259      /* Enable the selected I2C peripheral */
;;;260      I2Cx->CR1 |= I2C_CR1_PE;
0000b4  8820              LDRH     r0,[r4,#0]
0000b6  f0400001          ORR      r0,r0,#1
0000ba  8020              STRH     r0,[r4,#0]
;;;261    
;;;262    /*---------------------------- I2Cx CR1 Configuration ------------------------*/
;;;263      /* Get the I2Cx CR1 value */
;;;264      tmpreg = I2Cx->CR1;
0000bc  8826              LDRH     r6,[r4,#0]
;;;265      /* Clear ACK, SMBTYPE and  SMBUS bits */
;;;266      tmpreg &= CR1_CLEAR_MASK;
0000be  f64f30f5          MOV      r0,#0xfbf5
0000c2  4006              ANDS     r6,r6,r0
;;;267      /* Configure I2Cx: mode and acknowledgement */
;;;268      /* Set SMBTYPE and SMBUS bits according to I2C_Mode value */
;;;269      /* Set ACK bit according to I2C_Ack value */
;;;270      tmpreg |= (uint16_t)((uint32_t)I2C_InitStruct->I2C_Mode | I2C_InitStruct->I2C_Ack);
0000c4  88a8              LDRH     r0,[r5,#4]
0000c6  8969              LDRH     r1,[r5,#0xa]
0000c8  4308              ORRS     r0,r0,r1
0000ca  4306              ORRS     r6,r6,r0
;;;271      /* Write to I2Cx CR1 */
;;;272      I2Cx->CR1 = tmpreg;
0000cc  8026              STRH     r6,[r4,#0]
;;;273    
;;;274    /*---------------------------- I2Cx OAR1 Configuration -----------------------*/
;;;275      /* Set I2Cx Own Address1 and acknowledged address */
;;;276      I2Cx->OAR1 = (I2C_InitStruct->I2C_AcknowledgedAddress | I2C_InitStruct->I2C_OwnAddress1);
0000ce  89a8              LDRH     r0,[r5,#0xc]
0000d0  8929              LDRH     r1,[r5,#8]
0000d2  4308              ORRS     r0,r0,r1
0000d4  8120              STRH     r0,[r4,#8]
;;;277    }
0000d6  e8bd87ff          POP      {r0-r10,pc}
;;;278    
                          ENDP

0000da  0000              DCW      0x0000
                  |L21.220|
                          DCD      0x007a1200
                  |L21.224|
                          DCD      0x000f4240
                  |L21.228|
                          DCD      0x000186a0

                          AREA ||i.I2C_NACKPositionConfig||, CODE, READONLY, ALIGN=1

                  I2C_NACKPositionConfig PROC
;;;598      */
;;;599    void I2C_NACKPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_NACKPosition)
000000  f5b16f00          CMP      r1,#0x800
;;;600    {
;;;601      /* Check the parameters */
;;;602      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;603      assert_param(IS_I2C_NACK_POSITION(I2C_NACKPosition));
;;;604      
;;;605      /* Check the input parameter */
;;;606      if (I2C_NACKPosition == I2C_NACKPosition_Next)
000004  d104              BNE      |L22.16|
;;;607      {
;;;608        /* Next byte in shift register is the last received byte */
;;;609        I2Cx->CR1 |= I2C_NACKPosition_Next;
000006  8802              LDRH     r2,[r0,#0]
000008  f4426200          ORR      r2,r2,#0x800
00000c  8002              STRH     r2,[r0,#0]
00000e  e004              B        |L22.26|
                  |L22.16|
;;;610      }
;;;611      else
;;;612      {
;;;613        /* Current byte in shift register is the last received byte */
;;;614        I2Cx->CR1 &= I2C_NACKPosition_Current;
000010  8802              LDRH     r2,[r0,#0]
000012  f24f73ff          MOV      r3,#0xf7ff
000016  401a              ANDS     r2,r2,r3
000018  8002              STRH     r2,[r0,#0]
                  |L22.26|
;;;615      }
;;;616    }
00001a  4770              BX       lr
;;;617    
                          ENDP


                          AREA ||i.I2C_OwnAddress2Config||, CODE, READONLY, ALIGN=1

                  I2C_OwnAddress2Config PROC
;;;433      */
;;;434    void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address)
000000  460a              MOV      r2,r1
;;;435    {
;;;436      uint16_t tmpreg = 0;
000002  2100              MOVS     r1,#0
;;;437    
;;;438      /* Check the parameters */
;;;439      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;440    
;;;441      /* Get the old register value */
;;;442      tmpreg = I2Cx->OAR2;
000004  8981              LDRH     r1,[r0,#0xc]
;;;443    
;;;444      /* Reset I2Cx Own address2 bit [7:1] */
;;;445      tmpreg &= (uint16_t)~((uint16_t)I2C_OAR2_ADD2);
000006  f64f7301          MOV      r3,#0xff01
00000a  4019              ANDS     r1,r1,r3
;;;446    
;;;447      /* Set I2Cx Own address2 */
;;;448      tmpreg |= (uint16_t)((uint16_t)Address & (uint16_t)0x00FE);
00000c  f00203fe          AND      r3,r2,#0xfe
000010  4319              ORRS     r1,r1,r3
;;;449    
;;;450      /* Store the new register value */
;;;451      I2Cx->OAR2 = tmpreg;
000012  8181              STRH     r1,[r0,#0xc]
;;;452    }
000014  4770              BX       lr
;;;453    
                          ENDP


                          AREA ||i.I2C_PECPositionConfig||, CODE, READONLY, ALIGN=1

                  I2C_PECPositionConfig PROC
;;;763      */
;;;764    void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_PECPosition)
000000  f5b16f00          CMP      r1,#0x800
;;;765    {
;;;766      /* Check the parameters */
;;;767      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;768      assert_param(IS_I2C_PEC_POSITION(I2C_PECPosition));
;;;769      if (I2C_PECPosition == I2C_PECPosition_Next)
000004  d104              BNE      |L24.16|
;;;770      {
;;;771        /* Next byte in shift register is PEC */
;;;772        I2Cx->CR1 |= I2C_PECPosition_Next;
000006  8802              LDRH     r2,[r0,#0]
000008  f4426200          ORR      r2,r2,#0x800
00000c  8002              STRH     r2,[r0,#0]
00000e  e004              B        |L24.26|
                  |L24.16|
;;;773      }
;;;774      else
;;;775      {
;;;776        /* Current byte in shift register is PEC */
;;;777        I2Cx->CR1 &= I2C_PECPosition_Current;
000010  8802              LDRH     r2,[r0,#0]
000012  f24f73ff          MOV      r3,#0xf7ff
000016  401a              ANDS     r2,r2,r3
000018  8002              STRH     r2,[r0,#0]
                  |L24.26|
;;;778      }
;;;779    }
00001a  4770              BX       lr
;;;780    
                          ENDP


                          AREA ||i.I2C_ReadRegister||, CODE, READONLY, ALIGN=1

                  I2C_ReadRegister PROC
;;;1004     */
;;;1005   uint16_t I2C_ReadRegister(I2C_TypeDef* I2Cx, uint8_t I2C_Register)
000000  4602              MOV      r2,r0
;;;1006   {
;;;1007     __IO uint32_t tmp = 0;
000002  2300              MOVS     r3,#0
;;;1008   
;;;1009     /* Check the parameters */
;;;1010     assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;1011     assert_param(IS_I2C_REGISTER(I2C_Register));
;;;1012   
;;;1013     tmp = (uint32_t) I2Cx;
000004  4613              MOV      r3,r2
;;;1014     tmp += I2C_Register;
000006  440b              ADD      r3,r3,r1
;;;1015   
;;;1016     /* Return the selected register value */
;;;1017     return (*(__IO uint16_t *) tmp);
000008  8818              LDRH     r0,[r3,#0]
;;;1018   }
00000a  4770              BX       lr
;;;1019   
                          ENDP


                          AREA ||i.I2C_ReceiveData||, CODE, READONLY, ALIGN=1

                  I2C_ReceiveData PROC
;;;701      */
;;;702    uint8_t I2C_ReceiveData(I2C_TypeDef* I2Cx)
000000  4601              MOV      r1,r0
;;;703    {
;;;704      /* Check the parameters */
;;;705      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;706      /* Return the data in the DR register */
;;;707      return (uint8_t)I2Cx->DR;
000002  8a08              LDRH     r0,[r1,#0x10]
000004  b2c0              UXTB     r0,r0
;;;708    }
000006  4770              BX       lr
;;;709    
                          ENDP


                          AREA ||i.I2C_SMBusAlertConfig||, CODE, READONLY, ALIGN=1

                  I2C_SMBusAlertConfig PROC
;;;626      */
;;;627    void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, uint16_t I2C_SMBusAlert)
000000  f5b15f00          CMP      r1,#0x2000
;;;628    {
;;;629      /* Check the parameters */
;;;630      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;631      assert_param(IS_I2C_SMBUS_ALERT(I2C_SMBusAlert));
;;;632      if (I2C_SMBusAlert == I2C_SMBusAlert_Low)
000004  d104              BNE      |L27.16|
;;;633      {
;;;634        /* Drive the SMBusAlert pin Low */
;;;635        I2Cx->CR1 |= I2C_SMBusAlert_Low;
000006  8802              LDRH     r2,[r0,#0]
000008  f4425200          ORR      r2,r2,#0x2000
00000c  8002              STRH     r2,[r0,#0]
00000e  e004              B        |L27.26|
                  |L27.16|
;;;636      }
;;;637      else
;;;638      {
;;;639        /* Drive the SMBusAlert pin High  */
;;;640        I2Cx->CR1 &= I2C_SMBusAlert_High;
000010  8802              LDRH     r2,[r0,#0]
000012  f64d73ff          MOV      r3,#0xdfff
000016  401a              ANDS     r2,r2,r3
000018  8002              STRH     r2,[r0,#0]
                  |L27.26|
;;;641      }
;;;642    }
00001a  4770              BX       lr
;;;643    
                          ENDP


                          AREA ||i.I2C_Send7bitAddress||, CODE, READONLY, ALIGN=1

                  I2C_Send7bitAddress PROC
;;;383      */
;;;384    void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, uint8_t Address, uint8_t I2C_Direction)
000000  b112              CBZ      r2,|L28.8|
;;;385    {
;;;386      /* Check the parameters */
;;;387      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;388      assert_param(IS_I2C_DIRECTION(I2C_Direction));
;;;389      /* Test on the direction to set/reset the read/write bit */
;;;390      if (I2C_Direction != I2C_Direction_Transmitter)
;;;391      {
;;;392        /* Set the address bit0 for read */
;;;393        Address |= I2C_OAR1_ADD0;
000002  f0410101          ORR      r1,r1,#1
000006  e001              B        |L28.12|
                  |L28.8|
;;;394      }
;;;395      else
;;;396      {
;;;397        /* Reset the address bit0 for write */
;;;398        Address &= (uint8_t)~((uint8_t)I2C_OAR1_ADD0);
000008  f00101fe          AND      r1,r1,#0xfe
                  |L28.12|
;;;399      }
;;;400      /* Send the address */
;;;401      I2Cx->DR = Address;
00000c  8201              STRH     r1,[r0,#0x10]
;;;402    }
00000e  4770              BX       lr
;;;403    
                          ENDP


                          AREA ||i.I2C_SendData||, CODE, READONLY, ALIGN=1

                  I2C_SendData PROC
;;;688      */
;;;689    void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data)
000000  8201              STRH     r1,[r0,#0x10]
;;;690    {
;;;691      /* Check the parameters */
;;;692      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;693      /* Write in the DR register the data to be sent */
;;;694      I2Cx->DR = Data;
;;;695    }
000002  4770              BX       lr
;;;696    
                          ENDP


                          AREA ||i.I2C_SoftwareResetCmd||, CODE, READONLY, ALIGN=1

                  I2C_SoftwareResetCmd PROC
;;;510      */
;;;511    void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L30.12|
;;;512    {
;;;513      /* Check the parameters */
;;;514      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;515      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;516      if (NewState != DISABLE)
;;;517      {
;;;518        /* Peripheral under reset */
;;;519        I2Cx->CR1 |= I2C_CR1_SWRST;
000002  8802              LDRH     r2,[r0,#0]
000004  f4424200          ORR      r2,r2,#0x8000
000008  8002              STRH     r2,[r0,#0]
00000a  e003              B        |L30.20|
                  |L30.12|
;;;520      }
;;;521      else
;;;522      {
;;;523        /* Peripheral not under reset */
;;;524        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_SWRST);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f3c2020e          UBFX     r2,r2,#0,#15
000012  8002              STRH     r2,[r0,#0]
                  |L30.20|
;;;525      }
;;;526    }
000014  4770              BX       lr
;;;527    
                          ENDP


                          AREA ||i.I2C_StretchClockCmd||, CODE, READONLY, ALIGN=1

                  I2C_StretchClockCmd PROC
;;;534      */
;;;535    void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b921              CBNZ     r1,|L31.12|
;;;536    {
;;;537      /* Check the parameters */
;;;538      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;539      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;540      if (NewState == DISABLE)
;;;541      {
;;;542        /* Enable the selected I2C Clock stretching */
;;;543        I2Cx->CR1 |= I2C_CR1_NOSTRETCH;
000002  8802              LDRH     r2,[r0,#0]
000004  f0420280          ORR      r2,r2,#0x80
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L31.22|
                  |L31.12|
;;;544      }
;;;545      else
;;;546      {
;;;547        /* Disable the selected I2C Clock stretching */
;;;548        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_NOSTRETCH);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f737f          MOV      r3,#0xff7f
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L31.22|
;;;549      }
;;;550    }
000016  4770              BX       lr
;;;551    
                          ENDP


                          AREA ||i.I2C_StructInit||, CODE, READONLY, ALIGN=1

                  I2C_StructInit PROC
;;;283      */
;;;284    void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct)
000000  f2413188          MOV      r1,#0x1388
;;;285    {
;;;286    /*---------------- Reset I2C init structure parameters values ----------------*/
;;;287      /* initialize the I2C_ClockSpeed member */
;;;288      I2C_InitStruct->I2C_ClockSpeed = 5000;
000004  6001              STR      r1,[r0,#0]
;;;289      /* Initialize the I2C_Mode member */
;;;290      I2C_InitStruct->I2C_Mode = I2C_Mode_I2C;
000006  2100              MOVS     r1,#0
000008  8081              STRH     r1,[r0,#4]
;;;291      /* Initialize the I2C_DutyCycle member */
;;;292      I2C_InitStruct->I2C_DutyCycle = I2C_DutyCycle_2;
00000a  f64b71ff          MOV      r1,#0xbfff
00000e  80c1              STRH     r1,[r0,#6]
;;;293      /* Initialize the I2C_OwnAddress1 member */
;;;294      I2C_InitStruct->I2C_OwnAddress1 = 0;
000010  2100              MOVS     r1,#0
000012  8101              STRH     r1,[r0,#8]
;;;295      /* Initialize the I2C_Ack member */
;;;296      I2C_InitStruct->I2C_Ack = I2C_Ack_Disable;
000014  8141              STRH     r1,[r0,#0xa]
;;;297      /* Initialize the I2C_AcknowledgedAddress member */
;;;298      I2C_InitStruct->I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
000016  f44f4180          MOV      r1,#0x4000
00001a  8181              STRH     r1,[r0,#0xc]
;;;299    }
00001c  4770              BX       lr
;;;300    
                          ENDP


                          AREA ||i.I2C_TransmitPEC||, CODE, READONLY, ALIGN=1

                  I2C_TransmitPEC PROC
;;;732      */
;;;733    void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState)
000000  b121              CBZ      r1,|L33.12|
;;;734    {
;;;735      /* Check the parameters */
;;;736      assert_param(IS_I2C_ALL_PERIPH(I2Cx));
;;;737      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;738      if (NewState != DISABLE)
;;;739      {
;;;740        /* Enable the selected I2C PEC transmission */
;;;741        I2Cx->CR1 |= I2C_CR1_PEC;
000002  8802              LDRH     r2,[r0,#0]
000004  f4425280          ORR      r2,r2,#0x1000
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L33.22|
                  |L33.12|
;;;742      }
;;;743      else
;;;744      {
;;;745        /* Disable the selected I2C PEC transmission */
;;;746        I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_PEC);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64e73ff          MOV      r3,#0xefff
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L33.22|
;;;747      }
;;;748    }
000016  4770              BX       lr
;;;749    
                          ENDP


;*** Start embedded assembler ***

#line 1 "..\\..\\..\\Libraries\\STM32F4xx_StdPeriph_Driver\\src\\stm32f4xx_i2c.c"
	AREA ||.rev16_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___15_stm32f4xx_i2c_c_7174d409____REV16|
#line 114 "C:\\Keil\\ARM\\CMSIS\\Include\\core_cmInstr.h"
|__asm___15_stm32f4xx_i2c_c_7174d409____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___15_stm32f4xx_i2c_c_7174d409____REVSH|
#line 128
|__asm___15_stm32f4xx_i2c_c_7174d409____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
