; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\platform_gpio.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\platform_gpio.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\platform_gpio.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\platform_gpio.c]
                          THUMB

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

                  EXTI0_IRQHandler PROC
                  ||__tagsym$$used||
;;;520     ******************************************************/
;;;521    MICO_RTOS_DEFINE_ISR( EXTI0_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;522    {
;;;523      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;524    }
000006  bd10              POP      {r4,pc}
;;;525    
                          ENDP


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

                  EXTI15_10_IRQHandler PROC
                  |symbol_number.165|
;;;550    
;;;551    MICO_RTOS_DEFINE_ISR( EXTI15_10_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;552    {
;;;553      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;554    }
000006  bd10              POP      {r4,pc}
;;;555    
                          ENDP


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

                  EXTI1_IRQHandler PROC
                  |symbol_number.166|
;;;525    
;;;526    MICO_RTOS_DEFINE_ISR( EXTI1_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;527    {
;;;528      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;529    }
000006  bd10              POP      {r4,pc}
;;;530    
                          ENDP


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

                  EXTI2_IRQHandler PROC
                  |symbol_number.167|
;;;530    
;;;531    MICO_RTOS_DEFINE_ISR( EXTI2_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;532    {
;;;533      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;534    }
000006  bd10              POP      {r4,pc}
;;;535    
                          ENDP


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

                  EXTI3_IRQHandler PROC
                  |symbol_number.168|
;;;535    
;;;536    MICO_RTOS_DEFINE_ISR( EXTI3_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;537    {
;;;538      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;539    }
000006  bd10              POP      {r4,pc}
;;;540    
                          ENDP


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

                  EXTI4_IRQHandler PROC
                  |symbol_number.169|
;;;540    
;;;541    MICO_RTOS_DEFINE_ISR( EXTI4_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;542    {
;;;543      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;544    }
000006  bd10              POP      {r4,pc}
;;;545    
                          ENDP


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

                  EXTI9_5_IRQHandler PROC
                  |symbol_number.170|
;;;545    
;;;546    MICO_RTOS_DEFINE_ISR( EXTI9_5_IRQHandler )
000000  b510              PUSH     {r4,lr}
;;;547    {
;;;548      gpio_irq();
000002  f7fffffe          BL       gpio_irq
;;;549    }
000006  bd10              POP      {r4,pc}
;;;550    
                          ENDP


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

                  gpio_irq PROC
                  |symbol_number.171|
;;;460    /* Common IRQ handler for all GPIOs */
;;;461    MICO_RTOS_DEFINE_ISR( gpio_irq )
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;462    {
;;;463        uint32_t active_interrupt_vector = (uint32_t) ( ( SCB->ICSR & 0x3fU ) - 16 );
000004  482e              LDR      r0,|L8.192|
000006  6800              LDR      r0,[r0,#0]
000008  f000003f          AND      r0,r0,#0x3f
00000c  f1a00610          SUB      r6,r0,#0x10
;;;464        uint32_t gpio_number;
;;;465        uint32_t interrupt_line;
;;;466    
;;;467        switch ( active_interrupt_vector )
000010  2e09              CMP      r6,#9
000012  d017              BEQ      |L8.68|
000014  dc06              BGT      |L8.36|
000016  2e06              CMP      r6,#6
000018  d00b              BEQ      |L8.50|
00001a  2e07              CMP      r6,#7
00001c  d00c              BEQ      |L8.56|
00001e  2e08              CMP      r6,#8
000020  d131              BNE      |L8.134|
000022  e00c              B        |L8.62|
                  |L8.36|
000024  2e0a              CMP      r6,#0xa
000026  d010              BEQ      |L8.74|
000028  2e17              CMP      r6,#0x17
00002a  d011              BEQ      |L8.80|
00002c  2e28              CMP      r6,#0x28
00002e  d12a              BNE      |L8.134|
000030  e01b              B        |L8.106|
                  |L8.50|
;;;468        {
;;;469            case EXTI0_IRQn:
;;;470                interrupt_line = EXTI_Line0;
000032  2501              MOVS     r5,#1
;;;471                gpio_number = 0;
000034  2400              MOVS     r4,#0
;;;472                break;
000036  e028              B        |L8.138|
                  |L8.56|
;;;473            case EXTI1_IRQn:
;;;474                interrupt_line = EXTI_Line1;
000038  2502              MOVS     r5,#2
;;;475                gpio_number = 1;
00003a  2401              MOVS     r4,#1
;;;476                break;
00003c  e025              B        |L8.138|
                  |L8.62|
;;;477            case EXTI2_IRQn:
;;;478                interrupt_line = EXTI_Line2;
00003e  2504              MOVS     r5,#4
;;;479                gpio_number = 2;
000040  2402              MOVS     r4,#2
;;;480                break;
000042  e022              B        |L8.138|
                  |L8.68|
;;;481            case EXTI3_IRQn:
;;;482                interrupt_line = EXTI_Line3;
000044  2508              MOVS     r5,#8
;;;483                gpio_number = 3;
000046  2403              MOVS     r4,#3
;;;484                break;
000048  e01f              B        |L8.138|
                  |L8.74|
;;;485            case EXTI4_IRQn:
;;;486                interrupt_line = EXTI_Line4;
00004a  2510              MOVS     r5,#0x10
;;;487                gpio_number = 4;
00004c  2404              MOVS     r4,#4
;;;488                break;
00004e  e01c              B        |L8.138|
                  |L8.80|
;;;489            case EXTI9_5_IRQn:
;;;490                interrupt_line = EXTI_Line5;
000050  2520              MOVS     r5,#0x20
;;;491                for ( gpio_number = 5; gpio_number < 10 && ( EXTI->PR & interrupt_line ) == 0; gpio_number++ )
000052  2405              MOVS     r4,#5
000054  e001              B        |L8.90|
                  |L8.86|
;;;492                {
;;;493                    interrupt_line <<= 1;
000056  006d              LSLS     r5,r5,#1
000058  1c64              ADDS     r4,r4,#1              ;491
                  |L8.90|
00005a  2c0a              CMP      r4,#0xa               ;491
00005c  d204              BCS      |L8.104|
00005e  4819              LDR      r0,|L8.196|
000060  6800              LDR      r0,[r0,#0]            ;491
000062  4028              ANDS     r0,r0,r5              ;491
000064  2800              CMP      r0,#0                 ;491
000066  d0f6              BEQ      |L8.86|
                  |L8.104|
;;;494                }
;;;495                break;
000068  e00f              B        |L8.138|
                  |L8.106|
;;;496            case EXTI15_10_IRQn:
;;;497                interrupt_line = EXTI_Line10;
00006a  f44f6580          MOV      r5,#0x400
;;;498                for ( gpio_number = 10; gpio_number < 16 && ( EXTI->PR & interrupt_line ) == 0; gpio_number++ )
00006e  240a              MOVS     r4,#0xa
000070  e001              B        |L8.118|
                  |L8.114|
;;;499                {
;;;500                    interrupt_line <<= 1;
000072  006d              LSLS     r5,r5,#1
000074  1c64              ADDS     r4,r4,#1              ;498
                  |L8.118|
000076  2c10              CMP      r4,#0x10              ;498
000078  d204              BCS      |L8.132|
00007a  4812              LDR      r0,|L8.196|
00007c  6800              LDR      r0,[r0,#0]            ;498
00007e  4028              ANDS     r0,r0,r5              ;498
000080  2800              CMP      r0,#0                 ;498
000082  d0f6              BEQ      |L8.114|
                  |L8.132|
;;;501                }
;;;502                break;
000084  e001              B        |L8.138|
                  |L8.134|
;;;503            default:
;;;504                return;
;;;505        }
;;;506    
;;;507        /* Clear interrupt flag */
;;;508        EXTI->PR = interrupt_line;
;;;509    
;;;510        /* Call the respective GPIO interrupt handler/callback */
;;;511        if ( gpio_irq_data[gpio_number].handler != NULL )
;;;512        {
;;;513            void * arg = gpio_irq_data[gpio_number].arg; /* Avoids undefined order of access to volatiles */
;;;514            gpio_irq_data[gpio_number].handler( arg );
;;;515        }
;;;516    }
000086  e8bd81f0          POP      {r4-r8,pc}
                  |L8.138|
00008a  bf00              NOP                            ;472
00008c  480d              LDR      r0,|L8.196|
00008e  6005              STR      r5,[r0,#0]            ;508
000090  eb040044          ADD      r0,r4,r4,LSL #1       ;511
000094  490c              LDR      r1,|L8.200|
000096  eb010080          ADD      r0,r1,r0,LSL #2       ;511
00009a  6840              LDR      r0,[r0,#4]            ;511
00009c  b168              CBZ      r0,|L8.186|
00009e  eb040044          ADD      r0,r4,r4,LSL #1       ;513
0000a2  eb010080          ADD      r0,r1,r0,LSL #2       ;513
0000a6  6887              LDR      r7,[r0,#8]            ;513
0000a8  eb040044          ADD      r0,r4,r4,LSL #1       ;514
0000ac  460a              MOV      r2,r1                 ;514
0000ae  eb020080          ADD      r0,r2,r0,LSL #2       ;514
0000b2  6841              LDR      r1,[r0,#4]            ;514
0000b4  4638              MOV      r0,r7                 ;514
0000b6  4788              BLX      r1                    ;514
0000b8  bf00              NOP                            ;515
                  |L8.186|
0000ba  bf00              NOP      
0000bc  e7e3              B        |L8.134|
;;;517    
                          ENDP

0000be  0000              DCW      0x0000
                  |L8.192|
                          DCD      0xe000ed04
                  |L8.196|
                          DCD      0x40013c14
                  |L8.200|
                          DCD      gpio_irq_data

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

                  platform_gpio_deinit PROC
;;;126    
;;;127    OSStatus platform_gpio_deinit( const platform_gpio_t* gpio )
000000  b57c              PUSH     {r2-r6,lr}
;;;128    {
000002  4604              MOV      r4,r0
;;;129      GPIO_InitTypeDef  gpio_init_structure;
;;;130      OSStatus          err = kNoErr;
000004  2500              MOVS     r5,#0
;;;131    
;;;132      platform_mcu_powersave_disable();
000006  f7fffffe          BL       platform_mcu_powersave_disable
;;;133      require_action_quiet( gpio != NULL, exit, err = kParamErr);
00000a  bf00              NOP      
00000c  b90c              CBNZ     r4,|L9.18|
00000e  4d0d              LDR      r5,|L9.68|
000010  e013              B        |L9.58|
                  |L9.18|
000012  bf00              NOP      
;;;134    
;;;135      /* Set to Input high-impedance */
;;;136      gpio_init_structure.GPIO_Speed = GPIO_Speed_50MHz;
000014  2002              MOVS     r0,#2
000016  f88d0005          STRB     r0,[sp,#5]
;;;137      gpio_init_structure.GPIO_Mode  = GPIO_Mode_IN;
00001a  2000              MOVS     r0,#0
00001c  f88d0004          STRB     r0,[sp,#4]
;;;138      gpio_init_structure.GPIO_OType = GPIO_OType_PP; /* arbitrary. not applicable */
000020  f88d0006          STRB     r0,[sp,#6]
;;;139      gpio_init_structure.GPIO_PuPd  = GPIO_PuPd_NOPULL;
000024  f88d0007          STRB     r0,[sp,#7]
;;;140      gpio_init_structure.GPIO_Pin   = (uint32_t) ( 1 << gpio->pin_number );
000028  7921              LDRB     r1,[r4,#4]
00002a  2001              MOVS     r0,#1
00002c  4088              LSLS     r0,r0,r1
00002e  9000              STR      r0,[sp,#0]
;;;141    
;;;142      GPIO_Init( gpio->port, &gpio_init_structure );
000030  4669              MOV      r1,sp
000032  6820              LDR      r0,[r4,#0]
000034  f7fffffe          BL       GPIO_Init
;;;143    
;;;144    exit:
000038  bf00              NOP      
                  |L9.58|
;;;145      platform_mcu_powersave_enable();
00003a  f7fffffe          BL       platform_mcu_powersave_enable
;;;146      return err;
00003e  4628              MOV      r0,r5
;;;147    }
000040  bd7c              POP      {r2-r6,pc}
;;;148    
                          ENDP

000042  0000              DCW      0x0000
                  |L9.68|
                          DCD      0xffffe5cf

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

                  platform_gpio_enable_clock PROC
;;;412    
;;;413    OSStatus platform_gpio_enable_clock( const platform_gpio_t* gpio )
000000  b530              PUSH     {r4,r5,lr}
;;;414    {
000002  4604              MOV      r4,r0
;;;415      uint8_t     port_number;
;;;416      OSStatus    err = kNoErr;
000004  2500              MOVS     r5,#0
;;;417    
;;;418      require_action_quiet( gpio != NULL, exit, err = kParamErr);
000006  bf00              NOP      
000008  b90c              CBNZ     r4,|L10.14|
00000a  4d0c              LDR      r5,|L10.60|
00000c  e013              B        |L10.54|
                  |L10.14|
00000e  bf00              NOP      
;;;419      
;;;420      /* Enable peripheral clock for this port */
;;;421      port_number = platform_gpio_get_port_number( gpio->port );
000010  6820              LDR      r0,[r4,#0]
000012  f7fffffe          BL       platform_gpio_get_port_number
000016  4603              MOV      r3,r0
;;;422      require_action_quiet( port_number != 0xFF, exit, err = kParamErr);
000018  bf00              NOP      
00001a  2bff              CMP      r3,#0xff
00001c  d101              BNE      |L10.34|
00001e  4d07              LDR      r5,|L10.60|
000020  e009              B        |L10.54|
                  |L10.34|
000022  bf00              NOP      
;;;423    
;;;424      RCC->AHB1ENR |= gpio_peripheral_clocks[port_number];  
000024  4806              LDR      r0,|L10.64|
000026  6800              LDR      r0,[r0,#0]
000028  4906              LDR      r1,|L10.68|
00002a  f8511023          LDR      r1,[r1,r3,LSL #2]
00002e  4308              ORRS     r0,r0,r1
000030  4903              LDR      r1,|L10.64|
000032  6008              STR      r0,[r1,#0]
;;;425    
;;;426    exit:
000034  bf00              NOP      
                  |L10.54|
;;;427      return err;
000036  4628              MOV      r0,r5
;;;428    
;;;429    }
000038  bd30              POP      {r4,r5,pc}
;;;430    
                          ENDP

00003a  0000              DCW      0x0000
                  |L10.60|
                          DCD      0xffffe5cf
                  |L10.64|
                          DCD      0x40023830
                  |L10.68|
                          DCD      gpio_peripheral_clocks

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

                  platform_gpio_get_port_number PROC
;;;385    
;;;386    uint8_t platform_gpio_get_port_number( platform_gpio_port_t* gpio_port )
000000  4601              MOV      r1,r0
;;;387    {
;;;388        switch ( (uint32_t) gpio_port )
000002  f3c10009          UBFX     r0,r1,#0,#10
000006  b9f0              CBNZ     r0,|L11.70|
000008  1288              ASRS     r0,r1,#10
00000a  f5a01080          SUB      r0,r0,#0x100000
00000e  3880              SUBS     r0,r0,#0x80
000010  2809              CMP      r0,#9
000012  d218              BCS      |L11.70|
000014  e8dff000          TBB      [pc,r0]
000018  0507090b          DCB      0x05,0x07,0x09,0x0b
00001c  0d0f1113          DCB      0x0d,0x0f,0x11,0x13
000020  1500              DCB      0x15,0x00
;;;389        {
;;;390            case GPIOA_BASE:
;;;391                return EXTI_PortSourceGPIOA;
000022  2000              MOVS     r0,#0
                  |L11.36|
;;;392            case GPIOB_BASE:
;;;393                return EXTI_PortSourceGPIOB;
;;;394            case GPIOC_BASE:
;;;395                return EXTI_PortSourceGPIOC;
;;;396            case GPIOD_BASE:
;;;397                return EXTI_PortSourceGPIOD;
;;;398            case GPIOE_BASE:
;;;399                return EXTI_PortSourceGPIOE;
;;;400            case GPIOF_BASE:
;;;401                return EXTI_PortSourceGPIOF;
;;;402            case GPIOG_BASE:
;;;403                return EXTI_PortSourceGPIOG;
;;;404            case GPIOH_BASE:
;;;405                return EXTI_PortSourceGPIOH;
;;;406            case GPIOI_BASE:
;;;407                return EXTI_PortSourceGPIOI;
;;;408            default:
;;;409                return 0xFF;
;;;410        }
;;;411    }
000024  4770              BX       lr
000026  2001              MOVS     r0,#1                 ;393
000028  e7fc              B        |L11.36|
00002a  2002              MOVS     r0,#2                 ;395
00002c  e7fa              B        |L11.36|
00002e  2003              MOVS     r0,#3                 ;397
000030  e7f8              B        |L11.36|
000032  2004              MOVS     r0,#4                 ;399
000034  e7f6              B        |L11.36|
000036  2005              MOVS     r0,#5                 ;401
000038  e7f4              B        |L11.36|
00003a  2006              MOVS     r0,#6                 ;403
00003c  e7f2              B        |L11.36|
00003e  2007              MOVS     r0,#7                 ;405
000040  e7f0              B        |L11.36|
000042  2008              MOVS     r0,#8                 ;407
000044  e7ee              B        |L11.36|
                  |L11.70|
000046  20ff              MOVS     r0,#0xff              ;409
000048  e7ec              B        |L11.36|
;;;412    
                          ENDP


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

                  platform_gpio_init PROC
;;;86     
;;;87     OSStatus platform_gpio_init( const platform_gpio_t* gpio, platform_pin_config_t config )
000000  e92d41fc          PUSH     {r2-r8,lr}
;;;88     {
000004  4605              MOV      r5,r0
000006  460c              MOV      r4,r1
;;;89       GPIO_InitTypeDef  gpio_init_structure;
;;;90       uint8_t           port_number;
;;;91       OSStatus          err = kNoErr;
000008  2700              MOVS     r7,#0
;;;92     
;;;93       platform_mcu_powersave_disable();
00000a  f7fffffe          BL       platform_mcu_powersave_disable
;;;94       require_action_quiet( gpio != NULL, exit, err = kParamErr);
00000e  bf00              NOP      
000010  b90d              CBNZ     r5,|L12.22|
000012  4f20              LDR      r7,|L12.148|
000014  e039              B        |L12.138|
                  |L12.22|
000016  bf00              NOP      
;;;95       
;;;96       port_number = platform_gpio_get_port_number( gpio->port );
000018  6828              LDR      r0,[r5,#0]
00001a  f7fffffe          BL       platform_gpio_get_port_number
00001e  4606              MOV      r6,r0
;;;97     
;;;98       /* Enable peripheral clock for this port */
;;;99       RCC->AHB1ENR |= gpio_peripheral_clocks[port_number];
000020  481d              LDR      r0,|L12.152|
000022  6800              LDR      r0,[r0,#0]
000024  491d              LDR      r1,|L12.156|
000026  f8511026          LDR      r1,[r1,r6,LSL #2]
00002a  4308              ORRS     r0,r0,r1
00002c  491a              LDR      r1,|L12.152|
00002e  6008              STR      r0,[r1,#0]
;;;100    
;;;101      gpio_init_structure.GPIO_Speed = GPIO_Speed_50MHz;
000030  2002              MOVS     r0,#2
000032  f88d0005          STRB     r0,[sp,#5]
;;;102      gpio_init_structure.GPIO_Mode  = ( ( config == INPUT_PULL_UP ) || ( config == INPUT_PULL_DOWN ) || ( config == INPUT_HIGH_IMPEDANCE ) ) ? GPIO_Mode_IN : GPIO_Mode_OUT;
000036  b12c              CBZ      r4,|L12.68|
000038  2c01              CMP      r4,#1
00003a  d003              BEQ      |L12.68|
00003c  2c02              CMP      r4,#2
00003e  d001              BEQ      |L12.68|
000040  2001              MOVS     r0,#1
000042  e000              B        |L12.70|
                  |L12.68|
000044  2000              MOVS     r0,#0
                  |L12.70|
000046  f88d0004          STRB     r0,[sp,#4]
;;;103      gpio_init_structure.GPIO_OType = ( config == OUTPUT_PUSH_PULL ) ? GPIO_OType_PP : GPIO_OType_OD;
00004a  2c03              CMP      r4,#3
00004c  d001              BEQ      |L12.82|
00004e  2001              MOVS     r0,#1
000050  e000              B        |L12.84|
                  |L12.82|
000052  2000              MOVS     r0,#0
                  |L12.84|
000054  f88d0006          STRB     r0,[sp,#6]
;;;104    
;;;105      if ( ( config == INPUT_PULL_UP ) || ( config == OUTPUT_OPEN_DRAIN_PULL_UP ) )
000058  b10c              CBZ      r4,|L12.94|
00005a  2c05              CMP      r4,#5
00005c  d103              BNE      |L12.102|
                  |L12.94|
;;;106      {
;;;107        gpio_init_structure.GPIO_PuPd = GPIO_PuPd_UP;
00005e  2001              MOVS     r0,#1
000060  f88d0007          STRB     r0,[sp,#7]
000064  e008              B        |L12.120|
                  |L12.102|
;;;108      }
;;;109      else if ( config == INPUT_PULL_DOWN )
000066  2c01              CMP      r4,#1
000068  d103              BNE      |L12.114|
;;;110      {
;;;111        gpio_init_structure.GPIO_PuPd = GPIO_PuPd_DOWN;
00006a  2002              MOVS     r0,#2
00006c  f88d0007          STRB     r0,[sp,#7]
000070  e002              B        |L12.120|
                  |L12.114|
;;;112      }
;;;113      else
;;;114      {
;;;115        gpio_init_structure.GPIO_PuPd = GPIO_PuPd_NOPULL;
000072  2000              MOVS     r0,#0
000074  f88d0007          STRB     r0,[sp,#7]
                  |L12.120|
;;;116      }
;;;117    
;;;118      gpio_init_structure.GPIO_Pin = (uint32_t) ( 1 << gpio->pin_number );
000078  7929              LDRB     r1,[r5,#4]
00007a  2001              MOVS     r0,#1
00007c  4088              LSLS     r0,r0,r1
00007e  9000              STR      r0,[sp,#0]
;;;119    
;;;120      GPIO_Init( gpio->port, &gpio_init_structure );
000080  4669              MOV      r1,sp
000082  6828              LDR      r0,[r5,#0]
000084  f7fffffe          BL       GPIO_Init
;;;121      
;;;122    exit:
000088  bf00              NOP      
                  |L12.138|
;;;123      platform_mcu_powersave_enable();
00008a  f7fffffe          BL       platform_mcu_powersave_enable
;;;124      return err;
00008e  4638              MOV      r0,r7
;;;125    }
000090  e8bd81fc          POP      {r2-r8,pc}
;;;126    
                          ENDP

                  |L12.148|
                          DCD      0xffffe5cf
                  |L12.152|
                          DCD      0x40023830
                  |L12.156|
                          DCD      gpio_peripheral_clocks

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

                  platform_gpio_input_get PROC
;;;193    
;;;194    bool platform_gpio_input_get( const platform_gpio_t* gpio )
000000  b570              PUSH     {r4-r6,lr}
;;;195    {
000002  4604              MOV      r4,r0
;;;196      bool result = false;
000004  2500              MOVS     r5,#0
;;;197    
;;;198      platform_mcu_powersave_disable();
000006  f7fffffe          BL       platform_mcu_powersave_disable
;;;199    
;;;200      require_quiet( gpio != NULL, exit);
00000a  bf00              NOP      
00000c  b904              CBNZ     r4,|L13.16|
00000e  e00c              B        |L13.42|
                  |L13.16|
000010  bf00              NOP      
;;;201    
;;;202      result = ( ( gpio->port->IDR & (uint32_t) ( 1 << gpio->pin_number ) ) != 0 ) ? true : false;
000012  6820              LDR      r0,[r4,#0]
000014  6900              LDR      r0,[r0,#0x10]
000016  7922              LDRB     r2,[r4,#4]
000018  2101              MOVS     r1,#1
00001a  4091              LSLS     r1,r1,r2
00001c  4008              ANDS     r0,r0,r1
00001e  b108              CBZ      r0,|L13.36|
000020  2001              MOVS     r0,#1
000022  e000              B        |L13.38|
                  |L13.36|
000024  2000              MOVS     r0,#0
                  |L13.38|
000026  4605              MOV      r5,r0
;;;203      
;;;204    exit:
000028  bf00              NOP      
                  |L13.42|
;;;205      platform_mcu_powersave_enable();
00002a  f7fffffe          BL       platform_mcu_powersave_enable
;;;206      return result;
00002e  4628              MOV      r0,r5
;;;207    }
000030  bd70              POP      {r4-r6,pc}
;;;208    
                          ENDP


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

                  platform_gpio_irq_disable PROC
;;;310    
;;;311    OSStatus platform_gpio_irq_disable( const platform_gpio_t* gpio )
000000  e92d41fc          PUSH     {r2-r8,lr}
;;;312    {
000004  4604              MOV      r4,r0
;;;313      uint16_t interrupt_line;
;;;314      OSStatus err = kNoErr;
000006  2700              MOVS     r7,#0
;;;315    
;;;316      platform_mcu_powersave_disable();
000008  f7fffffe          BL       platform_mcu_powersave_disable
;;;317      require_action_quiet( gpio != NULL, exit, err = kParamErr);
00000c  bf00              NOP      
00000e  b90c              CBNZ     r4,|L14.20|
000010  4f39              LDR      r7,|L14.248|
000012  e06c              B        |L14.238|
                  |L14.20|
000014  bf00              NOP      
;;;318    
;;;319      interrupt_line = (uint16_t) ( 1 << gpio->pin_number );
000016  7921              LDRB     r1,[r4,#4]
000018  2001              MOVS     r0,#1
00001a  4088              LSLS     r0,r0,r1
00001c  b285              UXTH     r5,r0
;;;320    
;;;321      if ( ( EXTI->IMR & interrupt_line ) && gpio_irq_data[gpio->pin_number].owner_port == gpio->port )
00001e  4837              LDR      r0,|L14.252|
000020  6800              LDR      r0,[r0,#0]
000022  4028              ANDS     r0,r0,r5
000024  2800              CMP      r0,#0
000026  d061              BEQ      |L14.236|
000028  7920              LDRB     r0,[r4,#4]
00002a  eb000040          ADD      r0,r0,r0,LSL #1
00002e  4934              LDR      r1,|L14.256|
000030  f8510020          LDR      r0,[r1,r0,LSL #2]
000034  6821              LDR      r1,[r4,#0]
000036  4288              CMP      r0,r1
000038  d158              BNE      |L14.236|
;;;322      {
;;;323        bool             interrupt_line_used = 0;
00003a  f04f0800          MOV      r8,#0
;;;324        IRQn_Type        interrupt_vector    = (IRQn_Type)0;
00003e  2600              MOVS     r6,#0
;;;325        EXTI_InitTypeDef exti_init_structure;
;;;326    
;;;327        /* Disable EXTI interrupt line */
;;;328        exti_init_structure.EXTI_Line    = (uint32_t)interrupt_line;
000040  9500              STR      r5,[sp,#0]
;;;329        exti_init_structure.EXTI_LineCmd = DISABLE;
000042  2000              MOVS     r0,#0
000044  f88d0006          STRB     r0,[sp,#6]
;;;330        exti_init_structure.EXTI_Mode    = EXTI_Mode_Interrupt;
000048  f88d0004          STRB     r0,[sp,#4]
;;;331        exti_init_structure.EXTI_Trigger = EXTI_Trigger_Rising;
00004c  2008              MOVS     r0,#8
00004e  f88d0005          STRB     r0,[sp,#5]
;;;332        EXTI_Init( &exti_init_structure );
000052  4668              MOV      r0,sp
000054  f7fffffe          BL       EXTI_Init
;;;333        exti_init_structure.EXTI_Trigger = EXTI_Trigger_Falling;
000058  200c              MOVS     r0,#0xc
00005a  f88d0005          STRB     r0,[sp,#5]
;;;334        EXTI_Init( &exti_init_structure );
00005e  4668              MOV      r0,sp
000060  f7fffffe          BL       EXTI_Init
;;;335    
;;;336        /* Disable NVIC interrupt */
;;;337        if ( ( interrupt_line & 0x001F ) != 0 )
000064  f005001f          AND      r0,r5,#0x1f
000068  b118              CBZ      r0,|L14.114|
;;;338        {
;;;339          /* Line 0 to 4 */
;;;340          interrupt_vector = (IRQn_Type) ( EXTI0_IRQn + gpio->pin_number );
00006a  7920              LDRB     r0,[r4,#4]
00006c  1d80              ADDS     r0,r0,#6
00006e  b246              SXTB     r6,r0
;;;341          interrupt_line_used = false;
000070  e01a              B        |L14.168|
                  |L14.114|
;;;342        }
;;;343        else if ( ( interrupt_line & 0x03E0 ) != 0 )
000072  f4057078          AND      r0,r5,#0x3e0
000076  b150              CBZ      r0,|L14.142|
;;;344        {
;;;345          /* Line 5 to 9 */
;;;346          interrupt_vector = EXTI9_5_IRQn;
000078  2617              MOVS     r6,#0x17
;;;347          interrupt_line_used = ( ( EXTI->IMR & 0x3e0U ) != 0 ) ? true : false;
00007a  4820              LDR      r0,|L14.252|
00007c  6800              LDR      r0,[r0,#0]
00007e  f4007078          AND      r0,r0,#0x3e0
000082  b108              CBZ      r0,|L14.136|
000084  2001              MOVS     r0,#1
000086  e000              B        |L14.138|
                  |L14.136|
000088  2000              MOVS     r0,#0
                  |L14.138|
00008a  4680              MOV      r8,r0
00008c  e00c              B        |L14.168|
                  |L14.142|
;;;348        }
;;;349        else if ( ( interrupt_line & 0xFC00 ) != 0 )
00008e  f405407c          AND      r0,r5,#0xfc00
000092  b148              CBZ      r0,|L14.168|
;;;350        {
;;;351          /* Line 10 to 15 */
;;;352          interrupt_vector = EXTI15_10_IRQn;
000094  2628              MOVS     r6,#0x28
;;;353          interrupt_line_used = ( ( EXTI->IMR & 0xfc00U ) != 0 ) ? true : false;
000096  4819              LDR      r0,|L14.252|
000098  6800              LDR      r0,[r0,#0]
00009a  f400407c          AND      r0,r0,#0xfc00
00009e  b108              CBZ      r0,|L14.164|
0000a0  2001              MOVS     r0,#1
0000a2  e000              B        |L14.166|
                  |L14.164|
0000a4  2000              MOVS     r0,#0
                  |L14.166|
0000a6  4680              MOV      r8,r0
                  |L14.168|
;;;354        }
;;;355    
;;;356        /* Some IRQ lines share a vector. Disable vector only if not used */
;;;357        if ( interrupt_line_used == false )
0000a8  f1b80f00          CMP      r8,#0
0000ac  d10a              BNE      |L14.196|
;;;358        {
;;;359          NVIC_DisableIRQ( interrupt_vector );
0000ae  bf00              NOP      
0000b0  f006011f          AND      r1,r6,#0x1f
0000b4  2001              MOVS     r0,#1
0000b6  4088              LSLS     r0,r0,r1
0000b8  4912              LDR      r1,|L14.260|
0000ba  0972              LSRS     r2,r6,#5
0000bc  f8410022          STR      r0,[r1,r2,LSL #2]
0000c0  bf00              NOP      
0000c2  bf00              NOP      
                  |L14.196|
;;;360        }
;;;361    
;;;362        gpio_irq_data[gpio->pin_number].owner_port = 0;
0000c4  2000              MOVS     r0,#0
0000c6  7921              LDRB     r1,[r4,#4]
0000c8  eb010141          ADD      r1,r1,r1,LSL #1
0000cc  4a0c              LDR      r2,|L14.256|
0000ce  f8420021          STR      r0,[r2,r1,LSL #2]
;;;363        gpio_irq_data[gpio->pin_number].handler    = 0;
0000d2  7921              LDRB     r1,[r4,#4]
0000d4  eb010141          ADD      r1,r1,r1,LSL #1
0000d8  eb020181          ADD      r1,r2,r1,LSL #2
0000dc  6048              STR      r0,[r1,#4]
;;;364        gpio_irq_data[gpio->pin_number].arg        = 0;
0000de  7921              LDRB     r1,[r4,#4]
0000e0  eb010141          ADD      r1,r1,r1,LSL #1
0000e4  eb020181          ADD      r1,r2,r1,LSL #2
0000e8  6088              STR      r0,[r1,#8]
;;;365      }
0000ea  bf00              NOP      
                  |L14.236|
;;;366    
;;;367    exit:
0000ec  bf00              NOP      
                  |L14.238|
;;;368      platform_mcu_powersave_enable();
0000ee  f7fffffe          BL       platform_mcu_powersave_enable
;;;369      return err;
0000f2  4638              MOV      r0,r7
;;;370    }
0000f4  e8bd81fc          POP      {r2-r8,pc}
;;;371    
                          ENDP

                  |L14.248|
                          DCD      0xffffe5cf
                  |L14.252|
                          DCD      0x40013c00
                  |L14.256|
                          DCD      gpio_irq_data
                  |L14.260|
                          DCD      0xe000e180

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

                  platform_gpio_irq_enable PROC
;;;208    
;;;209    OSStatus platform_gpio_irq_enable( const platform_gpio_t* gpio, platform_gpio_irq_trigger_t trigger, platform_gpio_irq_callback_t handler, void* arg )
000000  e92d4ffe          PUSH     {r1-r11,lr}
;;;210    {
000004  4604              MOV      r4,r0
000006  4688              MOV      r8,r1
000008  4691              MOV      r9,r2
00000a  469a              MOV      r10,r3
;;;211      uint32_t interrupt_line = (uint32_t) ( 1 << gpio->pin_number );
00000c  7921              LDRB     r1,[r4,#4]
00000e  2001              MOVS     r0,#1
000010  fa00f601          LSL      r6,r0,r1
;;;212      EXTITrigger_TypeDef exti_trigger;
;;;213      OSStatus err = kNoErr;
000014  f04f0b00          MOV      r11,#0
;;;214      EXTI_InitTypeDef exti_init_structure;
;;;215      IRQn_Type        interrupt_vector = (IRQn_Type)0;
000018  2500              MOVS     r5,#0
;;;216    
;;;217      platform_mcu_powersave_disable();
00001a  f7fffffe          BL       platform_mcu_powersave_disable
;;;218      require_action_quiet( gpio != NULL, exit, err = kParamErr);
00001e  bf00              NOP      
000020  b914              CBNZ     r4,|L15.40|
000022  f8dfb104          LDR      r11,|L15.296|
000026  e07a              B        |L15.286|
                  |L15.40|
000028  bf00              NOP      
;;;219    
;;;220      switch ( trigger )
00002a  f1b80f01          CMP      r8,#1
00002e  d006              BEQ      |L15.62|
000030  f1b80f02          CMP      r8,#2
000034  d005              BEQ      |L15.66|
000036  f1b80f03          CMP      r8,#3
00003a  d106              BNE      |L15.74|
00003c  e003              B        |L15.70|
                  |L15.62|
;;;221      {
;;;222        case IRQ_TRIGGER_RISING_EDGE:
;;;223        {
;;;224          exti_trigger = EXTI_Trigger_Rising;
00003e  2708              MOVS     r7,#8
;;;225          break;
000040  e006              B        |L15.80|
                  |L15.66|
;;;226        }
;;;227        case IRQ_TRIGGER_FALLING_EDGE:
;;;228        {
;;;229          exti_trigger = EXTI_Trigger_Falling;
000042  270c              MOVS     r7,#0xc
;;;230          break;
000044  e004              B        |L15.80|
                  |L15.70|
;;;231        }
;;;232        case IRQ_TRIGGER_BOTH_EDGES:
;;;233        {
;;;234          exti_trigger = EXTI_Trigger_Rising_Falling;
000046  2710              MOVS     r7,#0x10
;;;235          break;
000048  e002              B        |L15.80|
                  |L15.74|
;;;236        }
;;;237        default:
;;;238        {
;;;239          err =  kParamErr;
00004a  f8dfb0dc          LDR      r11,|L15.296|
;;;240          goto exit;
00004e  e066              B        |L15.286|
                  |L15.80|
000050  bf00              NOP                            ;225
;;;241        }
;;;242      }
;;;243      
;;;244      if (gpio->pin_number == 10) {
000052  7920              LDRB     r0,[r4,#4]
000054  280a              CMP      r0,#0xa
000056  d110              BNE      |L15.122|
;;;245        /* This is STM32 Bug, please check at:
;;;246        * https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FGPIO%20Interrupt%20Issue&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=581#{B7C01461-8CEC-4711-B331-64F4AECF4786}
;;;247        * ERRATA sheet in section 2.1.8.
;;;248        Configuration of PH10 and PI10 as external interrupts is erroneous
;;;249        
;;;250        Description
;;;251        
;;;252        PH10 or PI10 is selected as the source for the EXTI10 external interrupt by setting bits
;;;253        EXTI10[3:0] of SYSCFG_EXTICR3 register to 0x0111 or 0x1000, respectively. However,
;;;254        this erroneous operation enables PH2 and PI2 as external interrupt inputs.
;;;255        
;;;256        As a result, it is not possible to use PH10/PI10 as interrupt sources if PH2/PI2 are not
;;;257        selected as the interrupt source, as well. This means that bits EXTI10[3:0] of
;;;258        
;;;259        SYSCFG_EXTICR3 register and bits EXTI2[3:0] of SYSCFG_EXTICR1 should be
;;;260        programmed to the same value:
;;;261        ¡ñ 0x0111 to select PH10/PH2
;;;262        ¡ñ 0x1000 to select PI10/PI2
;;;263        
;;;264        */
;;;265        if (gpio->port == GPIOH)
000058  4934              LDR      r1,|L15.300|
00005a  6820              LDR      r0,[r4,#0]
00005c  4288              CMP      r0,r1
00005e  d104              BNE      |L15.106|
;;;266          SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOH, EXTI_PinSource2); 
000060  2102              MOVS     r1,#2
000062  2007              MOVS     r0,#7
000064  f7fffffe          BL       SYSCFG_EXTILineConfig
000068  e007              B        |L15.122|
                  |L15.106|
;;;267        else if (gpio->port == GPIOI)
00006a  4931              LDR      r1,|L15.304|
00006c  6820              LDR      r0,[r4,#0]
00006e  4288              CMP      r0,r1
000070  d103              BNE      |L15.122|
;;;268          SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOI, EXTI_PinSource2);
000072  2102              MOVS     r1,#2
000074  2008              MOVS     r0,#8
000076  f7fffffe          BL       SYSCFG_EXTILineConfig
                  |L15.122|
;;;269      }
;;;270    
;;;271      SYSCFG_EXTILineConfig( platform_gpio_get_port_number( gpio->port ), gpio->pin_number );
00007a  6820              LDR      r0,[r4,#0]
00007c  f7fffffe          BL       platform_gpio_get_port_number
000080  9000              STR      r0,[sp,#0]
000082  7921              LDRB     r1,[r4,#4]
000084  f7fffffe          BL       SYSCFG_EXTILineConfig
;;;272      
;;;273      if ( ( interrupt_line & 0x001F ) != 0 )
000088  f006001f          AND      r0,r6,#0x1f
00008c  b118              CBZ      r0,|L15.150|
;;;274      {
;;;275        /* Line 0 to 4 */
;;;276        interrupt_vector = (IRQn_Type) ( EXTI0_IRQn + gpio->pin_number );
00008e  7920              LDRB     r0,[r4,#4]
000090  1d80              ADDS     r0,r0,#6
000092  b245              SXTB     r5,r0
000094  e008              B        |L15.168|
                  |L15.150|
;;;277      }
;;;278      else if ( ( interrupt_line & 0x03E0 ) != 0 )
000096  f4067078          AND      r0,r6,#0x3e0
00009a  b108              CBZ      r0,|L15.160|
;;;279      {
;;;280        /* Line 5 to 9 */
;;;281        interrupt_vector = EXTI9_5_IRQn;
00009c  2517              MOVS     r5,#0x17
00009e  e003              B        |L15.168|
                  |L15.160|
;;;282      }
;;;283      else if ( ( interrupt_line & 0xFC00 ) != 0 )
0000a0  f406407c          AND      r0,r6,#0xfc00
0000a4  b100              CBZ      r0,|L15.168|
;;;284      {
;;;285        /* Line 10 to 15 */
;;;286        interrupt_vector = EXTI15_10_IRQn;
0000a6  2528              MOVS     r5,#0x28
                  |L15.168|
;;;287      }
;;;288      
;;;289      /* Clear interrupt flag */
;;;290      EXTI->PR = interrupt_line;
0000a8  4822              LDR      r0,|L15.308|
0000aa  6006              STR      r6,[r0,#0]
;;;291      NVIC_ClearPendingIRQ( interrupt_vector ); 
0000ac  bf00              NOP      
0000ae  f005011f          AND      r1,r5,#0x1f
0000b2  2001              MOVS     r0,#1
0000b4  4088              LSLS     r0,r0,r1
0000b6  4920              LDR      r1,|L15.312|
0000b8  096a              LSRS     r2,r5,#5
0000ba  f8410022          STR      r0,[r1,r2,LSL #2]
0000be  bf00              NOP      
;;;292      
;;;293      exti_init_structure.EXTI_Trigger = exti_trigger;
0000c0  f88d7009          STRB     r7,[sp,#9]
;;;294      exti_init_structure.EXTI_Line    = interrupt_line;
0000c4  9601              STR      r6,[sp,#4]
;;;295      exti_init_structure.EXTI_Mode    = EXTI_Mode_Interrupt;
0000c6  2000              MOVS     r0,#0
0000c8  f88d0008          STRB     r0,[sp,#8]
;;;296      exti_init_structure.EXTI_LineCmd = ENABLE;
0000cc  2001              MOVS     r0,#1
0000ce  f88d000a          STRB     r0,[sp,#0xa]
;;;297      EXTI_Init( &exti_init_structure );
0000d2  a801              ADD      r0,sp,#4
0000d4  f7fffffe          BL       EXTI_Init
;;;298    
;;;299      NVIC_EnableIRQ( interrupt_vector );
0000d8  bf00              NOP      
0000da  f005011f          AND      r1,r5,#0x1f
0000de  2001              MOVS     r0,#1
0000e0  4088              LSLS     r0,r0,r1
0000e2  0969              LSRS     r1,r5,#5
0000e4  0089              LSLS     r1,r1,#2
0000e6  f10121e0          ADD      r1,r1,#0xe000e000
0000ea  f8c10100          STR      r0,[r1,#0x100]
0000ee  bf00              NOP      
;;;300      
;;;301      gpio_irq_data[gpio->pin_number].owner_port = gpio->port;
0000f0  7921              LDRB     r1,[r4,#4]
0000f2  eb010141          ADD      r1,r1,r1,LSL #1
0000f6  4a11              LDR      r2,|L15.316|
0000f8  6820              LDR      r0,[r4,#0]
0000fa  f8420021          STR      r0,[r2,r1,LSL #2]
;;;302      gpio_irq_data[gpio->pin_number].handler    = handler;
0000fe  7920              LDRB     r0,[r4,#4]
000100  eb000040          ADD      r0,r0,r0,LSL #1
000104  4611              MOV      r1,r2
000106  eb010080          ADD      r0,r1,r0,LSL #2
00010a  f8c09004          STR      r9,[r0,#4]
;;;303      gpio_irq_data[gpio->pin_number].arg        = arg;
00010e  7920              LDRB     r0,[r4,#4]
000110  eb000040          ADD      r0,r0,r0,LSL #1
000114  eb010080          ADD      r0,r1,r0,LSL #2
000118  f8c0a008          STR      r10,[r0,#8]
;;;304    
;;;305    exit:
00011c  bf00              NOP      
                  |L15.286|
;;;306      platform_mcu_powersave_enable();
00011e  f7fffffe          BL       platform_mcu_powersave_enable
;;;307      return err;
000122  4658              MOV      r0,r11
;;;308    }
000124  e8bd8ffe          POP      {r1-r11,pc}
;;;309    
                          ENDP

                  |L15.296|
                          DCD      0xffffe5cf
                  |L15.300|
                          DCD      0x40021c00
                  |L15.304|
                          DCD      0x40022000
                  |L15.308|
                          DCD      0x40013c14
                  |L15.312|
                          DCD      0xe000e280
                  |L15.316|
                          DCD      gpio_irq_data

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

                  platform_gpio_irq_manager_init PROC
;;;375     ******************************************************/
;;;376    OSStatus platform_gpio_irq_manager_init( void )
000000  b510              PUSH     {r4,lr}
;;;377    {
;;;378        memset( (void*)gpio_irq_data, 0, sizeof( gpio_irq_data ) );
000002  21c0              MOVS     r1,#0xc0
000004  4804              LDR      r0,|L16.24|
000006  f7fffffe          BL       __aeabi_memclr4
;;;379    
;;;380        /* Switch on SYSCFG peripheral clock to allow writing into SYSCFG registers */
;;;381        RCC_APB2PeriphClockCmd( RCC_APB2Periph_SYSCFG, ENABLE );
00000a  2101              MOVS     r1,#1
00000c  0388              LSLS     r0,r1,#14
00000e  f7fffffe          BL       RCC_APB2PeriphClockCmd
;;;382    
;;;383        return kNoErr;
000012  2000              MOVS     r0,#0
;;;384    }
000014  bd10              POP      {r4,pc}
;;;385    
                          ENDP

000016  0000              DCW      0x0000
                  |L16.24|
                          DCD      gpio_irq_data

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

                  platform_gpio_output_high PROC
;;;148    
;;;149    OSStatus platform_gpio_output_high( const platform_gpio_t* gpio )
000000  b570              PUSH     {r4-r6,lr}
;;;150    {
000002  4604              MOV      r4,r0
;;;151      OSStatus err = kNoErr;
000004  2500              MOVS     r5,#0
;;;152    
;;;153      platform_mcu_powersave_disable();
000006  f7fffffe          BL       platform_mcu_powersave_disable
;;;154    
;;;155      require_action_quiet( gpio != NULL, exit, err = kParamErr);
00000a  bf00              NOP      
00000c  b90c              CBNZ     r4,|L17.18|
00000e  4d06              LDR      r5,|L17.40|
000010  e006              B        |L17.32|
                  |L17.18|
000012  bf00              NOP      
;;;156    
;;;157      gpio->port->BSRRL = (uint16_t) ( 1 << gpio->pin_number );
000014  7921              LDRB     r1,[r4,#4]
000016  2001              MOVS     r0,#1
000018  4088              LSLS     r0,r0,r1
00001a  6821              LDR      r1,[r4,#0]
00001c  8308              STRH     r0,[r1,#0x18]
;;;158      
;;;159    exit:
00001e  bf00              NOP      
                  |L17.32|
;;;160      platform_mcu_powersave_enable();
000020  f7fffffe          BL       platform_mcu_powersave_enable
;;;161      return err;
000024  4628              MOV      r0,r5
;;;162    }
000026  bd70              POP      {r4-r6,pc}
;;;163    
                          ENDP

                  |L17.40|
                          DCD      0xffffe5cf

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

                  platform_gpio_output_low PROC
;;;163    
;;;164    OSStatus platform_gpio_output_low( const platform_gpio_t* gpio )
000000  b570              PUSH     {r4-r6,lr}
;;;165    {
000002  4604              MOV      r4,r0
;;;166      OSStatus err = kNoErr;
000004  2500              MOVS     r5,#0
;;;167    
;;;168      require_action_quiet( gpio != NULL, exit, err = kParamErr);
000006  bf00              NOP      
000008  b90c              CBNZ     r4,|L18.14|
00000a  4d07              LDR      r5,|L18.40|
00000c  e008              B        |L18.32|
                  |L18.14|
00000e  bf00              NOP      
;;;169    
;;;170      platform_mcu_powersave_disable();
000010  f7fffffe          BL       platform_mcu_powersave_disable
;;;171      
;;;172      gpio->port->BSRRH = (uint16_t) ( 1 << gpio->pin_number );
000014  7921              LDRB     r1,[r4,#4]
000016  2001              MOVS     r0,#1
000018  4088              LSLS     r0,r0,r1
00001a  6821              LDR      r1,[r4,#0]
00001c  8348              STRH     r0,[r1,#0x1a]
;;;173      
;;;174    exit:
00001e  bf00              NOP      
                  |L18.32|
;;;175      platform_mcu_powersave_enable();
000020  f7fffffe          BL       platform_mcu_powersave_enable
;;;176      return err;
000024  4628              MOV      r0,r5
;;;177    }
000026  bd70              POP      {r4-r6,pc}
;;;178    
                          ENDP

                  |L18.40|
                          DCD      0xffffe5cf

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

                  platform_gpio_output_trigger PROC
;;;178    
;;;179    OSStatus platform_gpio_output_trigger( const platform_gpio_t* gpio )
000000  b570              PUSH     {r4-r6,lr}
;;;180    {
000002  4604              MOV      r4,r0
;;;181      OSStatus err = kNoErr;
000004  2500              MOVS     r5,#0
;;;182    
;;;183      platform_mcu_powersave_disable();
000006  f7fffffe          BL       platform_mcu_powersave_disable
;;;184    
;;;185      require_action_quiet( gpio != NULL, exit, err = kParamErr);
00000a  bf00              NOP      
00000c  b90c              CBNZ     r4,|L19.18|
00000e  4d08              LDR      r5,|L19.48|
000010  e00a              B        |L19.40|
                  |L19.18|
000012  bf00              NOP      
;;;186    
;;;187      gpio->port->ODR ^= (uint16_t) ( 1 << gpio->pin_number );
000014  6820              LDR      r0,[r4,#0]
000016  6940              LDR      r0,[r0,#0x14]
000018  7922              LDRB     r2,[r4,#4]
00001a  2101              MOVS     r1,#1
00001c  4091              LSLS     r1,r1,r2
00001e  b289              UXTH     r1,r1
000020  4048              EORS     r0,r0,r1
000022  6821              LDR      r1,[r4,#0]
000024  6148              STR      r0,[r1,#0x14]
;;;188      
;;;189    exit:
000026  bf00              NOP      
                  |L19.40|
;;;190      platform_mcu_powersave_enable();
000028  f7fffffe          BL       platform_mcu_powersave_enable
;;;191      return err;
00002c  4628              MOV      r0,r5
;;;192    }
00002e  bd70              POP      {r4-r6,pc}
;;;193    
                          ENDP

                  |L19.48|
                          DCD      0xffffe5cf

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

                  platform_gpio_set_alternate_function PROC
;;;431    
;;;432    OSStatus platform_gpio_set_alternate_function( platform_gpio_port_t* gpio_port, uint8_t pin_number, GPIOOType_TypeDef output_type, GPIOPuPd_TypeDef pull_up_down_type, uint8_t alternation_function )
000000  e92d47fc          PUSH     {r2-r10,lr}
;;;433    {
000004  4607              MOV      r7,r0
000006  460c              MOV      r4,r1
000008  4615              MOV      r5,r2
00000a  461e              MOV      r6,r3
00000c  f8dd8028          LDR      r8,[sp,#0x28]
;;;434        GPIO_InitTypeDef  gpio_init_structure;
;;;435        uint8_t           port_number = platform_gpio_get_port_number( gpio_port );
000010  4638              MOV      r0,r7
000012  f7fffffe          BL       platform_gpio_get_port_number
000016  4681              MOV      r9,r0
;;;436    
;;;437        platform_mcu_powersave_disable();
000018  f7fffffe          BL       platform_mcu_powersave_disable
;;;438    
;;;439        /* Enable peripheral clock for this port */
;;;440        RCC->AHB1ENR |= gpio_peripheral_clocks[port_number];
00001c  4810              LDR      r0,|L20.96|
00001e  6800              LDR      r0,[r0,#0]
000020  4910              LDR      r1,|L20.100|
000022  f8511029          LDR      r1,[r1,r9,LSL #2]
000026  4308              ORRS     r0,r0,r1
000028  490d              LDR      r1,|L20.96|
00002a  6008              STR      r0,[r1,#0]
;;;441    
;;;442        gpio_init_structure.GPIO_Speed = GPIO_Speed_50MHz;
00002c  2002              MOVS     r0,#2
00002e  f88d0005          STRB     r0,[sp,#5]
;;;443        gpio_init_structure.GPIO_Mode  = GPIO_Mode_AF;
000032  f88d0004          STRB     r0,[sp,#4]
;;;444        gpio_init_structure.GPIO_OType = output_type;
000036  f88d5006          STRB     r5,[sp,#6]
;;;445        gpio_init_structure.GPIO_PuPd  = pull_up_down_type;
00003a  f88d6007          STRB     r6,[sp,#7]
;;;446        gpio_init_structure.GPIO_Pin   = (uint32_t) ( 1 << pin_number );
00003e  2001              MOVS     r0,#1
000040  40a0              LSLS     r0,r0,r4
000042  9000              STR      r0,[sp,#0]
;;;447    
;;;448        GPIO_Init( gpio_port, &gpio_init_structure );
000044  4669              MOV      r1,sp
000046  4638              MOV      r0,r7
000048  f7fffffe          BL       GPIO_Init
;;;449        GPIO_PinAFConfig( gpio_port, pin_number, alternation_function );
00004c  4642              MOV      r2,r8
00004e  4621              MOV      r1,r4
000050  4638              MOV      r0,r7
000052  f7fffffe          BL       GPIO_PinAFConfig
;;;450    
;;;451        platform_mcu_powersave_enable();
000056  f7fffffe          BL       platform_mcu_powersave_enable
;;;452    
;;;453        return kNoErr;
00005a  2000              MOVS     r0,#0
;;;454    }
00005c  e8bd87fc          POP      {r2-r10,pc}
;;;455    
                          ENDP

                  |L20.96|
                          DCD      0x40023830
                  |L20.100|
                          DCD      gpio_peripheral_clocks

                          AREA ||.bss||, DATA, NOINIT, ALIGN=2

                  gpio_irq_data
                          %        192

                          AREA ||.constdata||, DATA, READONLY, ALIGN=2

                  gpio_peripheral_clocks
                          DCD      0x00000001
                          DCD      0x00000002
                          DCD      0x00000004
                          DCD      0x00000008
                          DCD      0x00000010
                          DCD      0x00000020
                          DCD      0x00000040
                          DCD      0x00000080

;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\Platform\\MCU\\STM32F4xx\\peripherals\\platform_gpio.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___15_platform_gpio_c_7bcc0f42____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___15_platform_gpio_c_7bcc0f42____REV16| PROC
#line 115

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
