; generated by Component: ARM Compiler 5.05 update 1 (build 106) Tool: ArmCC [4d0efa]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\output\sc32f1xxx_gpio.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\sc32f1xxx_gpio.d --cpu=Cortex-M0+ --apcs=interwork --diag_suppress=9931 -I..\FWLib\SC32F1XXX_Lib\inc -I..\User\HeadFiles -I..\User -I..\Drivers -I..\Apps -I..\CMSIS -ID:\Keil5\ARM\Pack\Keil\SC32F10xx_DFP\1.0.0\Device\SC32F10xx\FWLib\SC32_Lib\inc -ID:\Keil5\ARM\Pack\Keil\SC32F10xx_DFP\1.0.0\Device\SH32F2xx\Include -D__UVISION_VERSION=538 -DSC32F10xx --omf_browse=..\output\sc32f1xxx_gpio.crf ..\FWLib\SC32F1XXX_Lib\src\sc32f1xxx_gpio.c]
                          THUMB

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

                  GPIO_DeInit PROC
;;;45      */
;;;46     void GPIO_DeInit(GPIO_TypeDef* GPIOx)
000000  6a01              LDR      r1,[r0,#0x20]
;;;47     {
;;;48       /* Check the parameters */
;;;49       assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;50     
;;;51       /* Deinitializes the GPIOx PXCON register to their default reset values. */
;;;52       GPIOx->PXCON &= (uint32_t)(~GPIO_PIN_All);
000002  0c09              LSRS     r1,r1,#16
000004  0409              LSLS     r1,r1,#16
000006  6201              STR      r1,[r0,#0x20]
;;;53       /* Deinitializes the GPIOx PXPH register to their default reset values. */
;;;54       GPIOx->PXPH &= (uint32_t)(~GPIO_PIN_All);
000008  6c01              LDR      r1,[r0,#0x40]
00000a  0c09              LSRS     r1,r1,#16
00000c  0409              LSLS     r1,r1,#16
00000e  6401              STR      r1,[r0,#0x40]
;;;55       /* Deinitializes the GPIOx PIN register to their default reset values. */
;;;56       GPIOx->PIN &= (uint32_t)(~GPIO_PIN_All);
000010  6801              LDR      r1,[r0,#0]
000012  0c09              LSRS     r1,r1,#16
000014  0409              LSLS     r1,r1,#16
000016  6001              STR      r1,[r0,#0]
;;;57       /* Deinitializes the GPIOx PXLEV register to their default reset values. */
;;;58       GPIOx->PXLEV &= (uint32_t)0x00000000;
000018  6e01              LDR      r1,[r0,#0x60]
00001a  2100              MOVS     r1,#0
00001c  6601              STR      r1,[r0,#0x60]
;;;59     }
00001e  4770              BX       lr
;;;60     
                          ENDP


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

                  GPIO_Init PROC
;;;67      */
;;;68     void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
000000  b5f0              PUSH     {r4-r7,lr}
;;;69     {
;;;70       uint32_t tmppin, tmppos, tmpreg;
;;;71     
;;;72       /* Check the parameters */
;;;73       assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;74       assert_param(IS_GPIO_PIN(GPIO_InitStruct->GPIO_Pin));
;;;75       assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode));
;;;76     
;;;77       if(GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT_PP)
000002  884b              LDRH     r3,[r1,#2]
;;;78       {
;;;79         /* Configure Pins to High-resistance output mode */
;;;80         GPIOx->PXCON |= (uint32_t)GPIO_InitStruct->GPIO_Pin;
000004  880a              LDRH     r2,[r1,#0]
000006  2b02              CMP      r3,#2                 ;77
000008  d004              BEQ      |L2.20|
;;;81       }
;;;82       else if(GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IN_PU)
00000a  2b01              CMP      r3,#1
00000c  d006              BEQ      |L2.28|
;;;83       {
;;;84         /* Configure Pins to Pull-up input mode */
;;;85         GPIOx->PXCON &= (uint32_t)(~GPIO_InitStruct->GPIO_Pin);
;;;86     		GPIOx->PXPH |= (uint32_t)GPIO_InitStruct->GPIO_Pin;
;;;87       }
;;;88     	else if(GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IN_HI)
00000e  2b00              CMP      r3,#0
000010  d00b              BEQ      |L2.42|
000012  e011              B        |L2.56|
                  |L2.20|
000014  6a03              LDR      r3,[r0,#0x20]         ;80
000016  4313              ORRS     r3,r3,r2              ;80
000018  6203              STR      r3,[r0,#0x20]         ;80
00001a  e00d              B        |L2.56|
                  |L2.28|
00001c  6a03              LDR      r3,[r0,#0x20]         ;85
00001e  4393              BICS     r3,r3,r2              ;85
000020  6203              STR      r3,[r0,#0x20]         ;85
000022  6c02              LDR      r2,[r0,#0x40]         ;86
000024  880b              LDRH     r3,[r1,#0]            ;86
000026  431a              ORRS     r2,r2,r3              ;86
000028  e005              B        |L2.54|
                  |L2.42|
;;;89       {
;;;90         /* Configure Pin to High-resistance intput mode */
;;;91         GPIOx->PXCON &= (uint32_t)(~GPIO_InitStruct->GPIO_Pin);
00002a  6a03              LDR      r3,[r0,#0x20]
00002c  4393              BICS     r3,r3,r2
00002e  6203              STR      r3,[r0,#0x20]
;;;92     		GPIOx->PXPH &= (uint32_t)(~GPIO_InitStruct->GPIO_Pin);
000030  6c02              LDR      r2,[r0,#0x40]
000032  880b              LDRH     r3,[r1,#0]
000034  439a              BICS     r2,r2,r3
                  |L2.54|
000036  6402              STR      r2,[r0,#0x40]
                  |L2.56|
;;;93       }
;;;94     
;;;95       /* Get GPIOx PXLEV value */
;;;96       tmpreg = GPIOx->PXLEV;
000038  6e03              LDR      r3,[r0,#0x60]
;;;97       /* Query the Pins that needs to be manipulated */
;;;98       for(tmppos = 0; tmppos < 16; tmppos++)
00003a  2200              MOVS     r2,#0
00003c  880e              LDRH     r6,[r1,#0]            ;80
;;;99       {
;;;100        tmppin = (uint32_t)(0x01 << tmppos);
;;;101        if((tmppin & GPIO_InitStruct->GPIO_Pin) != RESET)
;;;102        {
;;;103          /* Clear the LEVx bits */
;;;104          tmpreg &= (uint32_t)~(GPIO_DriveLevel_3 << (tmppos * 2));
00003e  2703              MOVS     r7,#3
                  |L2.64|
000040  2401              MOVS     r4,#1                 ;100
000042  4094              LSLS     r4,r4,r2              ;100
000044  4226              TST      r6,r4                 ;101
000046  d006              BEQ      |L2.86|
000048  0054              LSLS     r4,r2,#1
00004a  463d              MOV      r5,r7
00004c  40a5              LSLS     r5,r5,r4
00004e  43ab              BICS     r3,r3,r5
;;;105          /* Set LEVx bits according to Drive Level value */
;;;106          tmpreg |= (uint32_t)(GPIO_InitStruct->GPIO_DriveLevel << (tmppos * 2));
000050  888d              LDRH     r5,[r1,#4]
000052  40a5              LSLS     r5,r5,r4
000054  432b              ORRS     r3,r3,r5
                  |L2.86|
000056  1c52              ADDS     r2,r2,#1
000058  2a10              CMP      r2,#0x10              ;98
00005a  d3f1              BCC      |L2.64|
;;;107        }
;;;108      }
;;;109      /* Store GPIOx PXLEV the new value */
;;;110      GPIOx->PXLEV = tmpreg;
00005c  6603              STR      r3,[r0,#0x60]
;;;111    }
00005e  bdf0              POP      {r4-r7,pc}
;;;112    
                          ENDP


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

                  GPIO_ReadData PROC
;;;165     */
;;;166    uint16_t GPIO_ReadData(GPIO_TypeDef* GPIOx)
000000  6800              LDR      r0,[r0,#0]
;;;167    {
;;;168      /* Check the parameters */
;;;169      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;170    
;;;171      return (uint16_t)(GPIOx->PIN);
000002  b280              UXTH     r0,r0
;;;172    }
000004  4770              BX       lr
;;;173    
                          ENDP


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

                  GPIO_ReadDataBit PROC
;;;180     */
;;;181    BitAction GPIO_ReadDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000  6800              LDR      r0,[r0,#0]
;;;182    {
;;;183      BitAction bitstatus;
;;;184      /* Check the parameters */
;;;185      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;186      assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;187    
;;;188      if(GPIOx->PIN & GPIO_Pin)
000002  4008              ANDS     r0,r0,r1
000004  d000              BEQ      |L4.8|
;;;189      {
;;;190        bitstatus = Bit_SET;
000006  2001              MOVS     r0,#1
                  |L4.8|
;;;191      }
;;;192      else
;;;193      {
;;;194        bitstatus = Bit_RESET;
;;;195      }
;;;196    
;;;197      return bitstatus;
;;;198    }
000008  4770              BX       lr
;;;199    
                          ENDP


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

                  GPIO_ResetBits PROC
;;;221     */
;;;222    void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000  6802              LDR      r2,[r0,#0]
;;;223    {
;;;224      /* Check the parameters */
;;;225      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;226      assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;227    
;;;228      GPIOx->PIN  &= ~GPIO_Pin;
000002  438a              BICS     r2,r2,r1
000004  6002              STR      r2,[r0,#0]
;;;229    }
000006  4770              BX       lr
;;;230    
                          ENDP


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

                  GPIO_SetBits PROC
;;;206     */
;;;207    void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000  6802              LDR      r2,[r0,#0]
;;;208    {
;;;209      /* Check the parameters */
;;;210      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;211      assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;212    
;;;213      GPIOx->PIN |= GPIO_Pin;
000002  430a              ORRS     r2,r2,r1
000004  6002              STR      r2,[r0,#0]
;;;214    }
000006  4770              BX       lr
;;;215    
                          ENDP


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

                  GPIO_SetDriveLevel PROC
;;;121     */
;;;122    void GPIO_SetDriveLevel(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_DriveLevel_TypeDef GPIO_DriveLevel)
000000  b5f0              PUSH     {r4-r7,lr}
;;;123    {
;;;124    	uint32_t tmppin, tmppos, tmpreg;
;;;125      /* Get GPIOx PXLEV value */
;;;126      tmpreg = GPIOx->PXLEV;
000002  6e04              LDR      r4,[r0,#0x60]
;;;127      /* Query the Pins that needs to be manipulated */
;;;128      for(tmppos = 0; tmppos < 16; tmppos++)
000004  2300              MOVS     r3,#0
;;;129      {
;;;130        tmppin = (uint32_t)(0x01 << tmppos);
000006  2701              MOVS     r7,#1
                  |L7.8|
000008  463d              MOV      r5,r7
00000a  409d              LSLS     r5,r5,r3
;;;131        if((tmppin & GPIO_Pin) != RESET)
00000c  420d              TST      r5,r1
00000e  d006              BEQ      |L7.30|
;;;132        {
;;;133          /* Clear the LEVx bits */
;;;134          tmpreg &= (uint32_t)~(GPIO_DriveLevel_3 << (tmppos * 2));
000010  005d              LSLS     r5,r3,#1
000012  2603              MOVS     r6,#3
000014  40ae              LSLS     r6,r6,r5
000016  43b4              BICS     r4,r4,r6
000018  4616              MOV      r6,r2
;;;135          /* Set LEVx bits according to Drive Level value */
;;;136          tmpreg |= (uint32_t)(GPIO_DriveLevel << (tmppos * 2));
00001a  40ae              LSLS     r6,r6,r5
00001c  4334              ORRS     r4,r4,r6
                  |L7.30|
00001e  1c5b              ADDS     r3,r3,#1
000020  2b10              CMP      r3,#0x10              ;128
000022  d3f1              BCC      |L7.8|
;;;137        }
;;;138      }
;;;139      /* Store GPIOx PXLEV the new value */
;;;140      GPIOx->PXLEV = tmpreg;
000024  6604              STR      r4,[r0,#0x60]
;;;141    
;;;142    }
000026  bdf0              POP      {r4-r7,pc}
;;;143    
                          ENDP


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

                  GPIO_TogglePins PROC
;;;280     */
;;;281    void GPIO_TogglePins(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000  6802              LDR      r2,[r0,#0]
;;;282    {
;;;283    
;;;284      uint32_t tmpreg1, tmpreg2;
;;;285    
;;;286      /* Check the parameters */
;;;287      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;288      assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;289    
;;;290      /* Get the GPIOx PIN value */
;;;291      tmpreg1 = tmpreg2 = GPIOx->PIN;
;;;292      /* Invert the Pins of the operation */
;;;293      tmpreg1 = ~tmpreg1;
000002  43d3              MVNS     r3,r2
;;;294      /* Gets the Pins to be operated */
;;;295      tmpreg1 &= GPIO_Pin;
000004  400b              ANDS     r3,r3,r1
;;;296      /* Gets the Pins that does not require action */
;;;297      tmpreg2 &= ~GPIO_Pin;
000006  438a              BICS     r2,r2,r1
;;;298      /* Combine all the Pins */
;;;299      tmpreg1 |= tmpreg2;
000008  4313              ORRS     r3,r3,r2
;;;300      /* Set the GPIOx PIN value  */
;;;301      GPIOx->PIN = tmpreg1;
00000a  6003              STR      r3,[r0,#0]
;;;302    }
00000c  4770              BX       lr
;;;303    
                          ENDP


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

                  GPIO_Write PROC
;;;237     */
;;;238    void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal)
000000  6001              STR      r1,[r0,#0]
;;;239    {
;;;240      /* Check the parameters */
;;;241      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;242    
;;;243      /*  */
;;;244      GPIOx->PIN = PortVal;
;;;245    }
000002  4770              BX       lr
;;;246    
                          ENDP


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

                  GPIO_WriteBit PROC
;;;257      */
;;;258    void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
000000  2a00              CMP      r2,#0
;;;259    {
;;;260      /* Check the parameters */
;;;261      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;262      assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
;;;263      assert_param(IS_GPIO_BITACTION(BitVal));
;;;264    
;;;265      if(BitVal != Bit_RESET)
;;;266      {
;;;267        GPIOx->PIN |= GPIO_Pin;
;;;268      }
;;;269      else
;;;270      {
;;;271        GPIOx->PIN &= (~GPIO_Pin) ;
000002  6802              LDR      r2,[r0,#0]
000004  d001              BEQ      |L10.10|
000006  430a              ORRS     r2,r2,r1              ;267
000008  e000              B        |L10.12|
                  |L10.10|
00000a  438a              BICS     r2,r2,r1
                  |L10.12|
00000c  6002              STR      r2,[r0,#0]            ;267
;;;272      }
;;;273    }
00000e  4770              BX       lr
;;;274    
                          ENDP


;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
