; generated by Component: ARM Compiler 5.06 update 7 (build 960) Tool: ArmCC [4d365d]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\output\sc32f1xxx_twi.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\sc32f1xxx_twi.d --cpu=Cortex-M0+ --apcs=interwork -O0 --diag_suppress=9931 -I..\FWLib\SC32F1XXX_Lib\inc -I..\User\HeadFiles -I..\User -I..\Drivers -I..\Apps -I..\CMSIS -IF:\Users\SOC\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\Device\ARM\ARMCM0plus\Include -D__UVISION_VERSION=536 -DARMCM0P -DSC32f15xx --omf_browse=..\output\sc32f1xxx_twi.crf ..\FWLib\SC32F1XXX_Lib\src\sc32f1xxx_twi.c]
                          THUMB

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

                  TWI_AcknowledgeConfig PROC
;;;298      */
;;;299    void TWI_AcknowledgeConfig ( TWI_TypeDef* TWIx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;300    {
;;;301        /* Check the parameters */
;;;302        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;303        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;304        if ( NewState != SC_DISABLE )
000002  d004              BEQ      |L1.14|
;;;305        {
;;;306            /* Enable the acknowledgement */
;;;307            TWIx->TWI_CON |= TWI_CON_AA;
000004  6802              LDR      r2,[r0,#0]
000006  2302              MOVS     r3,#2
000008  431a              ORRS     r2,r2,r3
00000a  6002              STR      r2,[r0,#0]
00000c  e003              B        |L1.22|
                  |L1.14|
;;;308        }
;;;309        else
;;;310        {
;;;311            /* Disable the acknowledgement */
;;;312            TWIx->TWI_CON &= ~TWI_CON_AA;
00000e  6802              LDR      r2,[r0,#0]
000010  2302              MOVS     r3,#2
000012  439a              BICS     r2,r2,r3
000014  6002              STR      r2,[r0,#0]
                  |L1.22|
;;;313        }
;;;314    }
000016  4770              BX       lr
;;;315    
                          ENDP


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

                  TWI_ClearFlag PROC
;;;733     */
;;;734    void TWI_ClearFlag ( TWI_TypeDef* TWIx, TWI_FLAG_TypeDef TWI_FLAG )
000000  6842              LDR      r2,[r0,#4]
;;;735    {
;;;736        /* Check the parameters */
;;;737        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;738        /* Clear the flags */
;;;739        TWIx->TWI_STS |= ( uint16_t ) TWI_FLAG;
000002  430a              ORRS     r2,r2,r1
000004  6042              STR      r2,[r0,#4]
;;;740    }
000006  4770              BX       lr
;;;741    
                          ENDP


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

                  TWI_Cmd PROC
;;;254     */
;;;255    void TWI_Cmd ( TWI_TypeDef* TWIx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;256    {
;;;257    #if (UARTOptSwitch)
;;;258    #if defined(SC32f12xx)
;;;259    		/* If it is TWI0 and mapped as TWI_PinRemap_E, disable the TWI */
;;;260    		if((TWIx == TWI0) && ((TWIx->TWI_CON & TWI_CON_SPOS) == TWI_PinRemap_E))
;;;261    		{
;;;262    				NewState = SC_DISABLE;
;;;263    		}
;;;264    		/* If it is TWI1 and mapped as TWI_PinRemap_Default, disable the TWI */
;;;265    		if((TWIx == TWI1) && ((TWIx->TWI_CON & TWI_CON_SPOS) == TWI_PinRemap_Default))
;;;266    		{
;;;267    				NewState = SC_DISABLE;
;;;268    		}
;;;269    #endif
;;;270    #endif
;;;271        /* Check the parameters */
;;;272        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;273        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;274        if ( NewState != SC_DISABLE )
000002  d004              BEQ      |L3.14|
;;;275        {
;;;276            /* Enable the TWI Function */
;;;277            TWIx->TWI_CON |= TWI_CON_TWEN;
000004  6802              LDR      r2,[r0,#0]
000006  2380              MOVS     r3,#0x80
000008  431a              ORRS     r2,r2,r3
00000a  6002              STR      r2,[r0,#0]
00000c  e003              B        |L3.22|
                  |L3.14|
;;;278        }
;;;279        else
;;;280        {
;;;281            /* Disable the TWI Function */
;;;282            TWIx->TWI_CON &= ~TWI_CON_TWEN;
00000e  6802              LDR      r2,[r0,#0]
000010  2380              MOVS     r3,#0x80
000012  439a              BICS     r2,r2,r3
000014  6002              STR      r2,[r0,#0]
                  |L3.22|
;;;283        }
;;;284    }
000016  4770              BX       lr
;;;285    
                          ENDP


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

                  TWI_DMACmd PROC
;;;787     */
;;;788    void TWI_DMACmd ( TWI_TypeDef* TWIx, uint32_t TWI_DMAReq, FunctionalState NewState )
000000  2a00              CMP      r2,#0
;;;789    {
;;;790        /* Check the parameters */
;;;791        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;792        assert_param ( IS_TWI_DMAREQ ( TWI_DMAReq ) );
;;;793        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;794        if ( NewState != SC_DISABLE )
000002  d003              BEQ      |L4.12|
;;;795        {
;;;796            /* Enable the selected TWI DMA requests */
;;;797            TWIx->TWI_IDE |= TWI_DMAReq;
000004  6903              LDR      r3,[r0,#0x10]
000006  430b              ORRS     r3,r3,r1
000008  6103              STR      r3,[r0,#0x10]
00000a  e002              B        |L4.18|
                  |L4.12|
;;;798        }
;;;799        else
;;;800        {
;;;801            /* Disable the selected TWI DMA requests */
;;;802            TWIx->TWI_IDE &= ~( uint32_t )TWI_DMAReq;
00000c  6903              LDR      r3,[r0,#0x10]
00000e  438b              BICS     r3,r3,r1
000010  6103              STR      r3,[r0,#0x10]
                  |L4.18|
;;;803        }
;;;804    }
000012  4770              BX       lr
;;;805    
                          ENDP


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

                  TWI_DeInit PROC
;;;49      */
;;;50     void TWI_DeInit ( TWI_TypeDef* TWIx )
000000  b510              PUSH     {r4,lr}
;;;51     {
000002  4604              MOV      r4,r0
;;;52         /* Check the parameters */
;;;53         assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;54         if ( TWIx == TWI0 )
000004  480b              LDR      r0,|L5.52|
000006  4284              CMP      r4,r0
000008  d108              BNE      |L5.28|
;;;55         {
;;;56             /* Enable TWI0 reset state */
;;;57             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_TWI0, SC_ENABLE );
00000a  2101              MOVS     r1,#1
00000c  2010              MOVS     r0,#0x10
00000e  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;58             /* Disable TWI0 reset state */
;;;59             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_TWI0, SC_DISABLE );
000012  2100              MOVS     r1,#0
000014  2010              MOVS     r0,#0x10
000016  f7fffffe          BL       RCC_APB0PeriphResetCmd
00001a  e00a              B        |L5.50|
                  |L5.28|
;;;60         }
;;;61         else if ( TWIx == TWI1 )
00001c  4806              LDR      r0,|L5.56|
00001e  4284              CMP      r4,r0
000020  d107              BNE      |L5.50|
;;;62         {
;;;63     #if !defined (SC32f15xx)
;;;64             /* Enable TWI1 reset state */
;;;65             RCC_APB1PeriphResetCmd ( RCC_APB1Periph_TWI1, SC_ENABLE );
;;;66             /* Disable TWI1 reset state */
;;;67             RCC_APB1PeriphResetCmd ( RCC_APB1Periph_TWI1, SC_DISABLE );
;;;68     #else
;;;69     			  /* Enable TWI1 reset state */
;;;70     				RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI1_TWI1, SC_ENABLE);
000022  2101              MOVS     r1,#1
000024  2010              MOVS     r0,#0x10
000026  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;71     				/* Release TWI1 from reset state */
;;;72     				RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI1_TWI1, SC_DISABLE);		
00002a  2100              MOVS     r1,#0
00002c  2010              MOVS     r0,#0x10
00002e  f7fffffe          BL       RCC_APB1PeriphResetCmd
                  |L5.50|
;;;73     #endif
;;;74     		}	
;;;75     }
000032  bd10              POP      {r4,pc}
;;;76     
                          ENDP

                  |L5.52|
                          DCD      0x40020060
                  |L5.56|
                          DCD      0x40021040

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

                  TWI_GeneralCallCmd PROC
;;;328      */
;;;329    void TWI_GeneralCallCmd ( TWI_TypeDef* TWIx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;330    {
;;;331        /* Check the parameters */
;;;332        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;333        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;334        if ( NewState != SC_DISABLE )
000002  d004              BEQ      |L6.14|
;;;335        {
;;;336            /* Enable general call */
;;;337            TWIx->TWI_ADD |= TWI_ADD_GC;
000004  6882              LDR      r2,[r0,#8]
000006  2301              MOVS     r3,#1
000008  431a              ORRS     r2,r2,r3
00000a  6082              STR      r2,[r0,#8]
00000c  e003              B        |L6.22|
                  |L6.14|
;;;338        }
;;;339        else
;;;340        {
;;;341            /* Disable general call */
;;;342            TWIx->TWI_ADD &= ( uint16_t ) ~TWI_ADD_GC;
00000e  6882              LDR      r2,[r0,#8]
000010  4b01              LDR      r3,|L6.24|
000012  401a              ANDS     r2,r2,r3
000014  6082              STR      r2,[r0,#8]
                  |L6.22|
;;;343        }
;;;344    }
000016  4770              BX       lr
;;;345    
                          ENDP

                  |L6.24|
                          DCD      0x0000fffe

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

                  TWI_GenerateSTART PROC
;;;442      */
;;;443    void TWI_GenerateSTART ( TWI_TypeDef* TWIx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;444    {
;;;445        /* Check the parameters */
;;;446        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;447        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;448        if ( NewState != SC_DISABLE )
000002  d004              BEQ      |L7.14|
;;;449        {
;;;450            /* Generate a START condition */
;;;451            TWIx->TWI_CON |= TWI_CON_STA;
000004  6802              LDR      r2,[r0,#0]
000006  2320              MOVS     r3,#0x20
000008  431a              ORRS     r2,r2,r3
00000a  6002              STR      r2,[r0,#0]
00000c  e003              B        |L7.22|
                  |L7.14|
;;;452        }
;;;453        else
;;;454        {
;;;455            /* Disable the START condition generation */
;;;456            TWIx->TWI_CON &= ~TWI_CON_STA;
00000e  6802              LDR      r2,[r0,#0]
000010  2320              MOVS     r3,#0x20
000012  439a              BICS     r2,r2,r3
000014  6002              STR      r2,[r0,#0]
                  |L7.22|
;;;457        }
;;;458    }
000016  4770              BX       lr
;;;459    
                          ENDP


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

                  TWI_GenerateSTOP PROC
;;;472      */
;;;473    void TWI_GenerateSTOP ( TWI_TypeDef* TWIx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;474    {
;;;475        /* Check the parameters */
;;;476        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;477        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;478        if ( NewState != SC_DISABLE )
000002  d004              BEQ      |L8.14|
;;;479        {
;;;480            /* Generate a STOP condition */
;;;481            TWIx->TWI_CON |= TWI_CON_STO;
000004  6802              LDR      r2,[r0,#0]
000006  2310              MOVS     r3,#0x10
000008  431a              ORRS     r2,r2,r3
00000a  6002              STR      r2,[r0,#0]
00000c  e003              B        |L8.22|
                  |L8.14|
;;;482        }
;;;483        else
;;;484        {
;;;485            /* Disable the STOP condition generation */
;;;486            TWIx->TWI_CON &= ~TWI_CON_STO;
00000e  6802              LDR      r2,[r0,#0]
000010  2310              MOVS     r3,#0x10
000012  439a              BICS     r2,r2,r3
000014  6002              STR      r2,[r0,#0]
                  |L8.22|
;;;487        }
;;;488    }
000016  4770              BX       lr
;;;489    
                          ENDP


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

                  TWI_GetFlagStatus PROC
;;;701     */
;;;702    FlagStatus TWI_GetFlagStatus ( TWI_TypeDef* TWIx, TWI_FLAG_TypeDef TWI_FLAG )
000000  4602              MOV      r2,r0
;;;703    {
;;;704        ITStatus bitstatus = SC_RESET;
000002  2000              MOVS     r0,#0
;;;705        /* Check the parameters */
;;;706        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;707        assert_param ( IS_TWI_FLAG ( TWI_FLAG ) );
;;;708        if ( ( TWIx->TWI_STS & TWI_FLAG ) != ( uint16_t ) SC_RESET )
000004  6853              LDR      r3,[r2,#4]
000006  400b              ANDS     r3,r3,r1
000008  2b00              CMP      r3,#0
00000a  d001              BEQ      |L9.16|
;;;709        {
;;;710            bitstatus = SC_SET;
00000c  2001              MOVS     r0,#1
00000e  e000              B        |L9.18|
                  |L9.16|
;;;711        }
;;;712        else
;;;713        {
;;;714            bitstatus = SC_RESET;
000010  2000              MOVS     r0,#0
                  |L9.18|
;;;715        }
;;;716        return bitstatus;
;;;717    }
000012  4770              BX       lr
;;;718    
                          ENDP


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

                  TWI_GetNbytes PROC
;;;405      */
;;;406    uint8_t TWI_GetNbytes ( TWI_TypeDef* TWIx )
000000  4601              MOV      r1,r0
;;;407    {
;;;408        uint8_t tmpnum = 0;
000002  2000              MOVS     r0,#0
;;;409    
;;;410        /* Check the parameters */
;;;411        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;412    
;;;413        tmpnum = ( uint8_t ) ( TWIx->TWI_STS >> TWI_STS_NBYTES_Pos );
000004  684a              LDR      r2,[r1,#4]
000006  0212              LSLS     r2,r2,#8
000008  0e10              LSRS     r0,r2,#24
;;;414    
;;;415        return tmpnum;
;;;416    }
00000a  4770              BX       lr
;;;417    
                          ENDP


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

                  TWI_GetStateMachine PROC
;;;763     */
;;;764    TWI_StateMachine_TypeDef TWI_GetStateMachine ( TWI_TypeDef* TWIx )
000000  4601              MOV      r1,r0
;;;765    {  
;;;766    		/* Check the parameters */
;;;767        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;768    
;;;769        return ( TWI_StateMachine_TypeDef ) ( TWIx->TWI_STS & TWI_STS_STATE );
000002  6848              LDR      r0,[r1,#4]
000004  2207              MOVS     r2,#7
000006  0212              LSLS     r2,r2,#8
000008  4010              ANDS     r0,r0,r2
;;;770    }
00000a  4770              BX       lr
;;;771    
                          ENDP


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

                  TWI_ITConfig PROC
;;;662     */
;;;663    void TWI_ITConfig ( TWI_TypeDef* TWIx, uint16_t TWI_IT, FunctionalState NewState )
000000  b510              PUSH     {r4,lr}
;;;664    {
;;;665        /* Check the parameters */
;;;666        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;667        assert_param ( IS_TWI_IT ( TWI_IT ) );
;;;668        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;669        if ( NewState != SC_DISABLE )
000002  2a00              CMP      r2,#0
000004  d003              BEQ      |L12.14|
;;;670        {
;;;671            /* Enable the Interrupt sources */
;;;672            TWIx->TWI_IDE |= TWI_IT;
000006  6903              LDR      r3,[r0,#0x10]
000008  430b              ORRS     r3,r3,r1
00000a  6103              STR      r3,[r0,#0x10]
00000c  e004              B        |L12.24|
                  |L12.14|
;;;673        }
;;;674        else
;;;675        {
;;;676            /* Disable the Interrupt sources */
;;;677            TWIx->TWI_IDE &= ( uint16_t ) ~TWI_IT;
00000e  6903              LDR      r3,[r0,#0x10]
000010  43cc              MVNS     r4,r1
000012  b2a4              UXTH     r4,r4
000014  4023              ANDS     r3,r3,r4
000016  6103              STR      r3,[r0,#0x10]
                  |L12.24|
;;;678        }
;;;679    }
000018  bd10              POP      {r4,pc}
;;;680    
                          ENDP


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

                  TWI_Init PROC
;;;103     */
;;;104    void TWI_Init ( TWI_TypeDef* TWIx, TWI_InitTypeDef* TWI_InitStruct )
000000  b530              PUSH     {r4,r5,lr}
;;;105    {
000002  4602              MOV      r2,r0
;;;106    #if defined (SC32f10xx) || defined(SC32f12xx)
;;;107        uint32_t tmpreg = 0;
;;;108        /* Check the parameters */
;;;109        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;110        assert_param ( IS_TWI_ACK ( TWI_InitStruct->TWI_Ack ) );
;;;111        assert_param ( IS_TWI_PRESCALER ( TWI_InitStruct->TWI_Prescaler ) );
;;;112        assert_param ( IS_TWI_STRETCH ( TWI_InitStruct->TWI_Stretch ) );
;;;113        assert_param ( IS_TWI_GENERALCALL ( TWI_InitStruct->TWI_GeneralCall ) );
;;;114        /*---------------------------- TWIx TWI_CON Configuration ------------------------*/
;;;115        /* Get the TWIx TWI_CON value */
;;;116        tmpreg = TWIx->TWI_CON;
;;;117        /* Clear AA, TWCK, STRETCH bits */
;;;118        tmpreg &= ( uint32_t ) ~ ( TWI_CON_AA | TWI_CON_SPOS | TWI_CON_STRETCH | TWI_CON_TWCK);
;;;119        /* Configure TWIx: Ack, Clock division and Slave Clock Stretch */
;;;120        /* Set AA bits to TWI_Ack value */
;;;121        /* Set TWCK bits according to TWI_DataSize value */
;;;122        /* Set STRETCH bit according to TWI_Stretch value */
;;;123        tmpreg |= ( uint32_t ) ( TWI_InitStruct->TWI_Ack | TWI_InitStruct->TWI_Prescaler |
;;;124                                 TWI_InitStruct->TWI_Stretch );
;;;125        /* Write to TWIx TWI_CON */
;;;126        TWIx->TWI_CON = tmpreg;
;;;127        /*---------------------------- TWIx TWI_ADD Configuration ------------------------*/
;;;128        /* Get the TWIx TWI_ADD value */
;;;129        tmpreg = TWIx->TWI_ADD;
;;;130        /* Clear GC, TWCK, STRETCH bits */
;;;131        tmpreg &= ( uint32_t ) ~ ( TWI_ADD_GC | TWI_ADD_TWA );
;;;132        /* Configure TWIx: General Call and Slave Slave Address */
;;;133        /* Set AA bits to TWI_GC value */
;;;134        /* Set TWA according to TWI_SlaveAdress value */
;;;135        tmpreg |= ( uint32_t ) ( TWI_InitStruct->TWI_GeneralCall | ( ( TWI_InitStruct->TWI_SlaveAdress << 1 ) & 0xFE ) );
;;;136    
;;;137        /* Write to TWIx TWI_ADD */
;;;138        TWIx->TWI_ADD = tmpreg;
;;;139        
;;;140    #elif defined (SC32f15xx)
;;;141      uint32_t tmpreg = 0;
000004  2000              MOVS     r0,#0
;;;142      /* Check the parameters */
;;;143      assert_param(IS_TWI_ALL_PERIPH(TWIx));
;;;144      assert_param(IS_TWI_ACK(TWI_InitStruct->TWI_Ack));
;;;145      assert_param(IS_TWI_PRESCALER(TWI_InitStruct->TWI_Prescaler));
;;;146      assert_param(IS_TWI_STRETCH(TWI_InitStruct->TWI_Stretch));
;;;147      assert_param(IS_TWI_GENERALCALL(TWI_InitStruct->TWI_GeneralCall));
;;;148    	/*---------------------------- TWIx TWI_CON Configuration ------------------------*/
;;;149    
;;;150    	/* Get the TWIx TWI_CON value */
;;;151      tmpreg = TWIx->TWI_CON;
000006  6810              LDR      r0,[r2,#0]
;;;152      /* Clear AA, TWCK, STRETCH bits */
;;;153      tmpreg &= (uint32_t) ~(TWI_CON_AA | TWI_CON_SPOS | TWI_CON_STRETCH |TWI_CON_TWCK);
000008  4b0c              LDR      r3,|L13.60|
00000a  4018              ANDS     r0,r0,r3
;;;154      /* Configure TWIx: Ack, Clock division and Slave Clock Stretch */
;;;155      /* Set AA bits to TWI_Ack value */
;;;156      /* Set TWCK bits according to TWI_DataSize value */
;;;157      /* Set STRETCH bit according to TWI_Stretch value */
;;;158      tmpreg |= (uint32_t)(TWI_InitStruct->TWI_Ack | TWI_InitStruct->TWI_Prescaler |
00000c  880b              LDRH     r3,[r1,#0]
00000e  884c              LDRH     r4,[r1,#2]
000010  4323              ORRS     r3,r3,r4
000012  888c              LDRH     r4,[r1,#4]
000014  4323              ORRS     r3,r3,r4
000016  4318              ORRS     r0,r0,r3
;;;159                           TWI_InitStruct->TWI_Stretch);
;;;160      if(TWIx == TWI1)
000018  4b09              LDR      r3,|L13.64|
00001a  429a              CMP      r2,r3
00001c  d100              BNE      |L13.32|
;;;161    	{
;;;162    		tmpreg &=~(uint32_t)(0x00<<SPI1_TWI1_CON_MODE_Pos);
00001e  bf00              NOP      
                  |L13.32|
;;;163    	}
;;;164      /* Write to TWIx TWI_CON */
;;;165      TWIx->TWI_CON = tmpreg;
000020  6010              STR      r0,[r2,#0]
;;;166      /*---------------------------- TWIx TWI_ADD Configuration ------------------------*/
;;;167      /* Get the TWIx TWI_ADD value */
;;;168      tmpreg = TWIx->TWI_ADD;
000022  6890              LDR      r0,[r2,#8]
;;;169      /* Clear GC, TWCK, STRETCH bits */
;;;170      tmpreg &= (uint32_t) ~(TWI_ADD_GC | TWI_ADD_TWA);
000024  0a00              LSRS     r0,r0,#8
000026  0200              LSLS     r0,r0,#8
;;;171      /* Configure TWIx: General Call and Slave Slave Address */
;;;172      /* Set AA bits to TWI_GC value */
;;;173      /* Set TWA according to TWI_SlaveAdress value */
;;;174      tmpreg |= (uint32_t)(TWI_InitStruct->TWI_GeneralCall |  ( ( TWI_InitStruct->TWI_SlaveAdress << 1 ) & 0xFE ) );
000028  88cb              LDRH     r3,[r1,#6]
00002a  688c              LDR      r4,[r1,#8]
00002c  0064              LSLS     r4,r4,#1
00002e  25fe              MOVS     r5,#0xfe
000030  402c              ANDS     r4,r4,r5
000032  4323              ORRS     r3,r3,r4
000034  4318              ORRS     r0,r0,r3
;;;175    
;;;176      /* Write to TWIx TWI_ADD */
;;;177      TWIx->TWI_ADD = tmpreg;
000036  6090              STR      r0,[r2,#8]
;;;178    #endif
;;;179    }
000038  bd30              POP      {r4,r5,pc}
;;;180    
                          ENDP

00003a  0000              DCW      0x0000
                  |L13.60|
                          DCD      0xffff90fc
                  |L13.64|
                          DCD      0x40021040

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

                  TWI_PinRemapConfig PROC
;;;592     */
;;;593    void TWI_PinRemapConfig ( TWI_TypeDef* TWIx, TWI_PinRemap_TypeDef TWI_Remap )
000000  b510              PUSH     {r4,lr}
;;;594    {
000002  460a              MOV      r2,r1
;;;595    #if defined (SC32f10xx) || defined(SC32f12xx)
;;;596        uint32_t tmpreg = 0;
;;;597        /* Check the parameters */
;;;598        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;599        if ( TWIx == TWI0 )
;;;600        {
;;;601            assert_param ( IS_TWI_LIST1_PINREMAP ( TWI_Remap ) );
;;;602        }
;;;603        else
;;;604        {
;;;605            assert_param ( IS_TWI_LIST2_PINREMAP ( TWI_Remap ) );
;;;606        }
;;;607    
;;;608        tmpreg = TWIx->TWI_CON;
;;;609    
;;;610        tmpreg &= ( uint32_t ) ( ~TWI_CON_SPOS );
;;;611    
;;;612        tmpreg |= TWI_Remap;
;;;613    
;;;614        TWIx->TWI_CON = tmpreg;
;;;615    #elif defined (SC32f15xx)
;;;616      uint32_t tmpreg = 0;
000004  2100              MOVS     r1,#0
;;;617      /* Check the parameters */
;;;618      assert_param(IS_TWI_ALL_PERIPH(TWIx));
;;;619      
;;;620    	
;;;621    
;;;622      tmpreg = TWIx->TWI_CON;
000006  6801              LDR      r1,[r0,#0]
;;;623    
;;;624      tmpreg &= (uint32_t)(~TWI_CON_SPOS);
000008  2403              MOVS     r4,#3
00000a  0364              LSLS     r4,r4,#13
00000c  460b              MOV      r3,r1
00000e  43a3              BICS     r3,r3,r4
000010  4619              MOV      r1,r3
;;;625    
;;;626      tmpreg |= TWI_Remap;
000012  460b              MOV      r3,r1
000014  4313              ORRS     r3,r3,r2
000016  4619              MOV      r1,r3
;;;627    
;;;628      TWIx->TWI_CON = tmpreg;
000018  6001              STR      r1,[r0,#0]
;;;629    #endif	
;;;630    }
00001a  bd10              POP      {r4,pc}
;;;631    
                          ENDP


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

                  TWI_ReceiveData PROC
;;;559     */
;;;560    uint8_t TWI_ReceiveData ( TWI_TypeDef* TWIx )
000000  4601              MOV      r1,r0
;;;561    {
;;;562        /* Check the parameters */
;;;563        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;564        /* Receive Data */
;;;565        return ( uint8_t ) TWIx->TWI_DATA;
000002  68c8              LDR      r0,[r1,#0xc]
000004  b2c0              UXTB     r0,r0
;;;566    }
000006  4770              BX       lr
;;;567    
                          ENDP


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

                  TWI_Send7bitAddress PROC
;;;503      */
;;;504    void TWI_Send7bitAddress ( TWI_TypeDef* TWIx, uint8_t Address, TWI_Command_TypeDef TWI_Command )
000000  064b              LSLS     r3,r1,#25
;;;505    {
;;;506        /* Check the parameters */
;;;507        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;508        assert_param ( IS_TWI_COMMAND ( TWI_Command ) );
;;;509        Address = (uint8_t)( Address << 1 );
000002  0e19              LSRS     r1,r3,#24
;;;510        /* Test on the direction to set/reset the read/write bit */
;;;511        if ( TWI_Command != TWI_Command_Write )
000004  2a00              CMP      r2,#0
000006  d002              BEQ      |L16.14|
;;;512        {
;;;513            /* Set the address bit0 for read */
;;;514            Address |= TWI_Command_Read;
000008  2301              MOVS     r3,#1
00000a  4319              ORRS     r1,r1,r3
00000c  e001              B        |L16.18|
                  |L16.14|
;;;515        }
;;;516        else
;;;517        {
;;;518            /* Reset the address bit0 for write */
;;;519            Address &= ( uint8_t ) ~ ( ( uint8_t ) TWI_Command_Read );
00000e  23fe              MOVS     r3,#0xfe
000010  4019              ANDS     r1,r1,r3
                  |L16.18|
;;;520        }
;;;521    
;;;522        /* Send the address */
;;;523        TWIx->TWI_DATA = Address;
000012  60c1              STR      r1,[r0,#0xc]
;;;524    }
000014  4770              BX       lr
;;;525    
                          ENDP


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

                  TWI_SendData PROC
;;;541     */
;;;542    void TWI_SendData ( TWI_TypeDef* TWIx, uint8_t Data )
000000  60c1              STR      r1,[r0,#0xc]
;;;543    {
;;;544        /* Check the parameters */
;;;545        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;546        /* Transmit Data */
;;;547        TWIx->TWI_DATA = Data;
;;;548    }
000002  4770              BX       lr
;;;549    
                          ENDP


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

                  TWI_SetNbytes PROC
;;;387      */
;;;388    void TWI_SetNbytes ( TWI_TypeDef* TWIx, uint8_t Nbytes )
000000  040a              LSLS     r2,r1,#16
;;;389    {
;;;390        /* Check the parameters */
;;;391        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;392    
;;;393        TWIx->TWI_STS = ( uint32_t ) ( Nbytes << TWI_STS_NBYTES_Pos );
000002  6042              STR      r2,[r0,#4]
;;;394    }
000004  4770              BX       lr
;;;395    
                          ENDP


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

                  TWI_SetPrescaler PROC
;;;190     */
;;;191    void TWI_SetPrescaler(TWI_TypeDef* TWIx, uint16_t Prescaler)
000000  b510              PUSH     {r4,lr}
;;;192    {
000002  460a              MOV      r2,r1
;;;193        uint32_t tmpreg = 0;
000004  2100              MOVS     r1,#0
;;;194    
;;;195        /* Check parameters */
;;;196        assert_param(IS_TWI_ALL_PERIPH(TWIx));
;;;197        assert_param(IS_TWI_PRESCALER(Prescaler));
;;;198    
;;;199        /* Read the current TWI_CON register */
;;;200        tmpreg = TWIx->TWI_CON;
000006  6801              LDR      r1,[r0,#0]
;;;201    
;;;202        /* Clear the prescaler bits for other chips */
;;;203        tmpreg &= ~TWI_CON_TWCK;
000008  240f              MOVS     r4,#0xf
00000a  0224              LSLS     r4,r4,#8
00000c  460b              MOV      r3,r1
00000e  43a3              BICS     r3,r3,r4
000010  4619              MOV      r1,r3
;;;204    
;;;205        /* Set the new prescaler value */
;;;206        tmpreg |= Prescaler;
000012  460b              MOV      r3,r1
000014  4313              ORRS     r3,r3,r2
000016  4619              MOV      r1,r3
;;;207    
;;;208        /* Write back to the TWI_CON register */
;;;209        TWIx->TWI_CON = tmpreg;
000018  6001              STR      r1,[r0,#0]
;;;210    }
00001a  bd10              POP      {r4,pc}
;;;211    
                          ENDP


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

                  TWI_SetSlaveAddress PROC
;;;220     */
;;;221    void TWI_SetSlaveAddress(TWI_TypeDef* TWIx, uint8_t Address)
000000  b510              PUSH     {r4,lr}
;;;222    {
000002  460a              MOV      r2,r1
;;;223        uint32_t tmpreg = 0;
000004  2100              MOVS     r1,#0
;;;224    
;;;225        /* Check parameters */
;;;226        assert_param(IS_TWI_ALL_PERIPH(TWIx));
;;;227        assert_param(IS_TWI_SLAVE_ADDRESS(Address));
;;;228    
;;;229        /* Read the current TWI_ADD register */
;;;230        tmpreg = TWIx->TWI_ADD;
000006  6881              LDR      r1,[r0,#8]
;;;231    
;;;232        /* Clear the slave address bits for other chips */
;;;233        tmpreg &= ~TWI_ADD_TWA;
000008  24fe              MOVS     r4,#0xfe
00000a  460b              MOV      r3,r1
00000c  43a3              BICS     r3,r3,r4
00000e  4619              MOV      r1,r3
;;;234    
;;;235        /* Set the new 7-bit slave address (shifted to align with TWI_ADD register) */
;;;236        tmpreg |= ((Address << 1) & 0xFE);
000010  0053              LSLS     r3,r2,#1
000012  4023              ANDS     r3,r3,r4
000014  4319              ORRS     r1,r1,r3
;;;237    
;;;238        /* Write back to the TWI_ADD register */
;;;239        TWIx->TWI_ADD = tmpreg;
000016  6081              STR      r1,[r0,#8]
;;;240    }
000018  bd10              POP      {r4,pc}
;;;241    
                          ENDP


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

                  TWI_StretchClockConfig PROC
;;;358      */
;;;359    void TWI_StretchClockConfig ( TWI_TypeDef* TWIx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;360    {
;;;361        /* Check the parameters */
;;;362        assert_param ( IS_TWI_ALL_PERIPH ( TWIx ) );
;;;363        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;364        if ( NewState != SC_DISABLE )
000002  d004              BEQ      |L21.14|
;;;365        {
;;;366            /* Enable the selected TWI Clock stretching */
;;;367            TWIx->TWI_CON |= TWI_CON_STRETCH;
000004  6802              LDR      r2,[r0,#0]
000006  2301              MOVS     r3,#1
000008  431a              ORRS     r2,r2,r3
00000a  6002              STR      r2,[r0,#0]
00000c  e003              B        |L21.22|
                  |L21.14|
;;;368        }
;;;369        else
;;;370        {
;;;371            /* Disable the selected TWI Clock stretching */
;;;372            TWIx->TWI_CON &= ~ TWI_CON_STRETCH;
00000e  6802              LDR      r2,[r0,#0]
000010  0852              LSRS     r2,r2,#1
000012  0052              LSLS     r2,r2,#1
000014  6002              STR      r2,[r0,#0]
                  |L21.22|
;;;373        }
;;;374    }
000016  4770              BX       lr
;;;375    
                          ENDP


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

                  TWI_StructInit PROC
;;;81       */
;;;82     void TWI_StructInit ( TWI_InitTypeDef* TWI_InitStruct )
000000  2100              MOVS     r1,#0
;;;83     {
;;;84         /* Set the default configuration */
;;;85         TWI_InitStruct->TWI_Ack = TWI_Ack_Disable;
000002  8001              STRH     r1,[r0,#0]
;;;86         TWI_InitStruct->TWI_Prescaler = 0x00;
000004  8041              STRH     r1,[r0,#2]
;;;87         TWI_InitStruct->TWI_Stretch = 0;
000006  8081              STRH     r1,[r0,#4]
;;;88     
;;;89         TWI_InitStruct->TWI_GeneralCall = TWI_GeneralCall_Disable;
000008  80c1              STRH     r1,[r0,#6]
;;;90         TWI_InitStruct->TWI_SlaveAdress = 0x00;
00000a  6081              STR      r1,[r0,#8]
;;;91     }
00000c  4770              BX       lr
;;;92     
                          ENDP


;*** Start embedded assembler ***

#line 1 "..\\FWLib\\SC32F1XXX_Lib\\src\\sc32f1xxx_twi.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___15_sc32f1xxx_twi_c_24100672____REV16|
#line 463 "..\\CMSIS\\cmsis_armcc.h"
|__asm___15_sc32f1xxx_twi_c_24100672____REV16| PROC
#line 464

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___15_sc32f1xxx_twi_c_24100672____REVSH|
#line 478
|__asm___15_sc32f1xxx_twi_c_24100672____REVSH| PROC
#line 479

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
