; 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\bootloader\mico-fire_f429\obj_rvmdk\platform_adc.o --asm_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\platform_adc.d --cpu=Cortex-M4.fp --apcs=interwork --diag_suppress=9931,1,1293 -I..\..\..\..\Bootloader -I..\..\..\..\Board\fire_F429 -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 -IG:\GIT_OSC\F429_OV2640_MICO_SDRAM\Projects\STM32F429\bootloader\RVMDK\RTE -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -ID:\work\keil5\ARM\CMSIS\Include -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__MICROLIB -D__UVISION_VERSION=516 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DBOOTLOADER -DNO_MICO_RTOS -DHSE_VALUE=25000000 --omf_browse=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\platform_adc.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\platform_adc.c]
                          THUMB

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

                  platform_adc_deinit PROC
;;;167    
;;;168    OSStatus platform_adc_deinit( const platform_adc_t* adc )
000000  4800              LDR      r0,|L1.4|
;;;169    {
;;;170        UNUSED_PARAMETER(adc);
;;;171        platform_log("unimplemented");
;;;172        return kNotPreparedErr;
;;;173    }
000002  4770              BX       lr
;;;174    
                          ENDP

                  |L1.4|
                          DCD      0xffffe5a7

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

                  platform_adc_init PROC
;;;76     
;;;77     OSStatus platform_adc_init( const platform_adc_t* adc, uint32_t sample_cycle )
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;78     {
000004  b08c              SUB      sp,sp,#0x30
000006  4688              MOV      r8,r1
000008  4604              MOV      r4,r0
;;;79         GPIO_InitTypeDef      gpio_init_structure;
;;;80         ADC_InitTypeDef       adc_init_structure;
;;;81         ADC_CommonInitTypeDef adc_common_init_structure;
;;;82         uint8_t     a;
;;;83         OSStatus    err = kNoErr;
;;;84     
;;;85         platform_mcu_powersave_disable();
00000a  f7fffffe          BL       platform_mcu_powersave_disable
;;;86     
;;;87         require_action_quiet( adc != NULL, exit, err = kParamErr);
00000e  b12c              CBZ      r4,|L2.28|
;;;88         
;;;89         /* Enable peripheral clock for this port */
;;;90         err = platform_gpio_enable_clock( adc->pin );
000010  6920              LDR      r0,[r4,#0x10]
000012  f7fffffe          BL       platform_gpio_enable_clock
000016  0006              MOVS     r6,r0
;;;91         require_noerr(err, exit);
000018  d149              BNE      |L2.174|
00001a  e001              B        |L2.32|
                  |L2.28|
00001c  4e27              LDR      r6,|L2.188|
00001e  e046              B        |L2.174|
                  |L2.32|
;;;92     
;;;93         /* Initialize the associated GPIO */
;;;94         gpio_init_structure.GPIO_Pin   = (uint32_t)( 1 << adc->pin->pin_number );;
000020  6920              LDR      r0,[r4,#0x10]
000022  2701              MOVS     r7,#1
;;;95         gpio_init_structure.GPIO_Speed = (GPIOSpeed_TypeDef) 0;
000024  2500              MOVS     r5,#0
000026  7900              LDRB     r0,[r0,#4]            ;94
000028  f88d502d          STRB     r5,[sp,#0x2d]
00002c  fa07f000          LSL      r0,r7,r0              ;94
000030  900a              STR      r0,[sp,#0x28]
;;;96         gpio_init_structure.GPIO_Mode  = GPIO_Mode_AN;
000032  2003              MOVS     r0,#3
000034  f88d002c          STRB     r0,[sp,#0x2c]
;;;97         gpio_init_structure.GPIO_PuPd  = GPIO_PuPd_NOPULL;
000038  f88d502f          STRB     r5,[sp,#0x2f]
;;;98         gpio_init_structure.GPIO_OType = GPIO_OType_OD;
00003c  f88d702e          STRB     r7,[sp,#0x2e]
;;;99         GPIO_Init( adc->pin->port, &gpio_init_structure );
000040  6920              LDR      r0,[r4,#0x10]
000042  a90a              ADD      r1,sp,#0x28
000044  6800              LDR      r0,[r0,#0]
000046  f7fffffe          BL       GPIO_Init
;;;100    
;;;101        RCC_APB2PeriphClockCmd( adc->adc_peripheral_clock, ENABLE );
00004a  2101              MOVS     r1,#1
00004c  68a0              LDR      r0,[r4,#8]
00004e  f7fffffe          BL       RCC_APB2PeriphClockCmd
;;;102    
;;;103        /* Initialize the ADC */
;;;104        ADC_StructInit( &adc_init_structure );
000052  4668              MOV      r0,sp
000054  f7fffffe          BL       ADC_StructInit
;;;105        adc_init_structure.ADC_Resolution         = ADC_Resolution_12b;
;;;106        adc_init_structure.ADC_ScanConvMode       = DISABLE;
000058  9500              STR      r5,[sp,#0]
00005a  f88d5004          STRB     r5,[sp,#4]
;;;107        adc_init_structure.ADC_ContinuousConvMode = DISABLE;
00005e  f88d5005          STRB     r5,[sp,#5]
;;;108        adc_init_structure.ADC_ExternalTrigConv   = ADC_ExternalTrigConvEdge_None;
;;;109        adc_init_structure.ADC_DataAlign          = ADC_DataAlign_Right;
000062  9503              STR      r5,[sp,#0xc]
;;;110        adc_init_structure.ADC_NbrOfConversion    = 1;
000064  9504              STR      r5,[sp,#0x10]
000066  f88d7014          STRB     r7,[sp,#0x14]
;;;111        ADC_Init( adc->port, &adc_init_structure );
00006a  4669              MOV      r1,sp
00006c  6820              LDR      r0,[r4,#0]
00006e  f7fffffe          BL       ADC_Init
;;;112    
;;;113        ADC_CommonStructInit( &adc_common_init_structure );
000072  a806              ADD      r0,sp,#0x18
000074  f7fffffe          BL       ADC_CommonStructInit
;;;114        adc_common_init_structure.ADC_Mode             = ADC_Mode_Independent;
;;;115        adc_common_init_structure.ADC_DMAAccessMode    = ADC_DMAAccessMode_Disabled;
000078  9506              STR      r5,[sp,#0x18]
;;;116        adc_common_init_structure.ADC_Prescaler        = ADC_Prescaler_Div2;
00007a  9508              STR      r5,[sp,#0x20]
;;;117        adc_common_init_structure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;
00007c  9507              STR      r5,[sp,#0x1c]
;;;118        ADC_CommonInit( &adc_common_init_structure );
00007e  a806              ADD      r0,sp,#0x18
000080  9509              STR      r5,[sp,#0x24]
000082  f7fffffe          BL       ADC_CommonInit
;;;119    
;;;120        ADC_Cmd( adc->port, ENABLE );
000086  2101              MOVS     r1,#1
000088  6820              LDR      r0,[r4,#0]
00008a  f7fffffe          BL       ADC_Cmd
;;;121    
;;;122        /* Find the closest supported sampling time by the MCU */
;;;123        for ( a = 0; ( a < sizeof( adc_sampling_cycle ) / sizeof(uint16_t) ) && adc_sampling_cycle[a] < sample_cycle; a++ )
00008e  2300              MOVS     r3,#0
000090  480b              LDR      r0,|L2.192|
000092  e003              B        |L2.156|
                  |L2.148|
000094  1c5b              ADDS     r3,r3,#1
000096  b2db              UXTB     r3,r3
000098  2b08              CMP      r3,#8
00009a  d203              BCS      |L2.164|
                  |L2.156|
00009c  f8302013          LDRH     r2,[r0,r3,LSL #1]
0000a0  4542              CMP      r2,r8
0000a2  d3f7              BCC      |L2.148|
                  |L2.164|
;;;124        {
;;;125        }
;;;126    
;;;127        /* Initialize the ADC channel */
;;;128        ADC_RegularChannelConfig( adc->port, adc->channel, adc->rank, a );
0000a4  7b22              LDRB     r2,[r4,#0xc]
0000a6  7921              LDRB     r1,[r4,#4]
0000a8  6820              LDR      r0,[r4,#0]
0000aa  f7fffffe          BL       ADC_RegularChannelConfig
                  |L2.174|
;;;129    
;;;130    exit:
;;;131        platform_mcu_powersave_enable();
0000ae  f7fffffe          BL       platform_mcu_powersave_enable
;;;132        return err;
;;;133    }
0000b2  b00c              ADD      sp,sp,#0x30
0000b4  4630              MOV      r0,r6                 ;132
0000b6  e8bd81f0          POP      {r4-r8,pc}
;;;134    
                          ENDP

0000ba  0000              DCW      0x0000
                  |L2.188|
                          DCD      0xffffe5cf
                  |L2.192|
                          DCD      ||.constdata||

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

                  platform_adc_take_sample PROC
;;;134    
;;;135    OSStatus platform_adc_take_sample( const platform_adc_t* adc, uint16_t* output )
000000  b570              PUSH     {r4-r6,lr}
;;;136    {
000002  460e              MOV      r6,r1
000004  4604              MOV      r4,r0
;;;137        OSStatus    err = kNoErr;
000006  2500              MOVS     r5,#0
;;;138    
;;;139        platform_mcu_powersave_disable();
000008  f7fffffe          BL       platform_mcu_powersave_disable
;;;140    
;;;141        require_action_quiet( adc != NULL, exit, err = kParamErr);
00000c  b184              CBZ      r4,|L3.48|
;;;142    
;;;143        /* Start conversion */
;;;144        ADC_SoftwareStartConv( adc->port );
00000e  6820              LDR      r0,[r4,#0]
000010  f7fffffe          BL       ADC_SoftwareStartConv
                  |L3.20|
;;;145    
;;;146        /* Wait until end of conversion */
;;;147        while ( ADC_GetFlagStatus( adc->port, ADC_FLAG_EOC ) == RESET )
000014  2102              MOVS     r1,#2
000016  6820              LDR      r0,[r4,#0]
000018  f7fffffe          BL       ADC_GetFlagStatus
00001c  2800              CMP      r0,#0
00001e  d0f9              BEQ      |L3.20|
;;;148        {
;;;149        }
;;;150    
;;;151        /* Read ADC conversion result */
;;;152        *output = ADC_GetConversionValue( adc->port );
000020  6820              LDR      r0,[r4,#0]
000022  f7fffffe          BL       ADC_GetConversionValue
000026  8030              STRH     r0,[r6,#0]
                  |L3.40|
;;;153    
;;;154    exit:
;;;155        platform_mcu_powersave_enable();
000028  f7fffffe          BL       platform_mcu_powersave_enable
;;;156        return err;
00002c  4628              MOV      r0,r5
;;;157    }
00002e  bd70              POP      {r4-r6,pc}
                  |L3.48|
000030  4d00              LDR      r5,|L3.52|
000032  e7f9              B        |L3.40|
;;;158    
                          ENDP

                  |L3.52|
                          DCD      0xffffe5cf

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

                  platform_adc_take_sample_stream PROC
;;;158    
;;;159    OSStatus platform_adc_take_sample_stream( const platform_adc_t* adc, void* buffer, uint16_t buffer_length )
000000  4800              LDR      r0,|L4.4|
;;;160    {
;;;161        UNUSED_PARAMETER(adc);
;;;162        UNUSED_PARAMETER(buffer);
;;;163        UNUSED_PARAMETER(buffer_length);
;;;164        platform_log("unimplemented");
;;;165        return kNotPreparedErr;
;;;166    }
000002  4770              BX       lr
;;;167    
                          ENDP

                  |L4.4|
                          DCD      0xffffe5a7

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

                  adc_sampling_cycle
000000  0003000f          DCW      0x0003,0x000f
000004  001c0038          DCW      0x001c,0x0038
000008  00540070          DCW      0x0054,0x0070
00000c  009001e0          DCW      0x0090,0x01e0

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
