; 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\op_amplifiesvoltage.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\op_amplifiesvoltage.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\op_amplifiesvoltage.crf ..\Apps\OP_AmplifiesVoltage.c]
                          THUMB

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

                          REQUIRE _printf_percent
                          REQUIRE _printf_x
                          REQUIRE _printf_longlong_hex
                  OP_AmplifiesVoltage_Function PROC
;;;18     
;;;19     void OP_AmplifiesVoltage_Function(void)
000000  b08e              SUB      sp,sp,#0x38
;;;20     {
;;;21     #if defined(SC32f12xx)
;;;22     #if (OP_MODE == 0)
;;;23       GPIO_InitTypeDef GPIO_InitStruct; //GPIOʼṹ
;;;24       /* PA3Ϊ */
;;;25       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3;
;;;26       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_HI;
;;;27       GPIO_Init(GPIOA, &GPIO_InitStruct);
;;;28     #endif
;;;29     #if (OP_MODE == 1)
;;;30       GPIO_InitTypeDef GPIO_InitStruct; //GPIOʼṹ
;;;31       /* PA4Ϊ */
;;;32       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4;
;;;33       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_HI;
;;;34       GPIO_Init(GPIOA, &GPIO_InitStruct);
;;;35     #endif
;;;36       //ADCʼ
;;;37       volatile uint16_t ADC_Value = 0;
;;;38       RCC_APB2Cmd(ENABLE);                                //ADCPGAAPB2ʱ
;;;39       
;;;40       ADC_InitTypeDef ADC_InitStruct;                     //ADCʼṹ
;;;41       
;;;42       ADC_StructInit(&ADC_InitStruct);
;;;43       ADC_InitStruct.ADC_ConvMode = ADC_ConvMode_Single;  //ADCתģʽ
;;;44       ADC_InitStruct.ADC_Prescaler = ADC_Prescaler_3CLOCK;//תʱΪ3
;;;45       ADC_InitStruct.ADC_VREF = ADC_VREF_VDD;             //οѹΪVDD
;;;46       
;;;47       ADC_Init(ADC, &ADC_InitStruct);                     //ݽṹ־λADC
;;;48       ADC_SetChannel(ADC,ADC_Channel_OP);                //ѡPGAͨ
;;;49       
;;;50       ADC_ITConfig(ADC,ADC_IT_ADCIF,ENABLE);              //ʹADCж
;;;51       NVIC_EnableIRQ(ADC_IRQn);
;;;52       ADC_Cmd(ADC,ENABLE);	                              //ʹADC
;;;53       
;;;54      #if (OP_MODE == 0)
;;;55       //PGAʼ,ͬŴ
;;;56       OP_InitTypeDef OP_InitStruct;                      //PGAʼṹ
;;;57       OP_InitStruct.OP_ShortCircuit = OP_ShortCircuit_OFF;//PGAͬ෴಻̽
;;;58       OP_InitStruct.OP_FDBResisrance = OP_FDBResisrance_VSS; //VSS
;;;59       OP_InitStruct.OP_PGAGain = OP_PGAGain_NonInvert8_Invert7;//ͬ87
;;;60       OP_InitStruct.OP_Posittive = OP_Posittive_OPP0;     //ͬOP_0
;;;61       OP_InitStruct.OP_Negative = OP_Negative_PGA;        //˽ڲ
;;;62       OP_InitStruct.OP_Output = OP_Output_ON;           //OP_O˿
;;;63     
;;;64       OP_Init(OP,&OP_InitStruct);                             //OPгʼ
;;;65      #endif
;;;66      #if (OP_MODE == 1)
;;;67       //PGAʼ,Ŵ
;;;68       OP_InitTypeDef OP_InitStruct;                            //PGAʼṹ
;;;69       OP_InitStruct.OP_ShortCircuit = OP_ShortCircuit_OFF;      //PGAͬ෴಻̽
;;;70       OP_InitStruct.OP_FDBResisrance = OP_FDBResisrance_OPN;          //OP_N
;;;71       OP_InitStruct.OP_PGAGain = OP_PGAGain_NonInvert8_Invert7; //ͬ87
;;;72       OP_InitStruct.OP_Posittive = OP_Posittive_VSS;            //ͬ˽ӵ
;;;73       OP_InitStruct.OP_Negative = OP_Negative_PGA;             //˽ڲ
;;;74       OP_InitStruct.OP_Output = OP_Output_ON;           //OP_O˿
;;;75       
;;;76       OP_Init(OP,&OP_InitStruct);                        //OPгʼ
;;;77     #endif
;;;78       OP_Cmd(OP,ENABLE);                                 //OPʹ
;;;79       
;;;80       while(1)
;;;81       {
;;;82     		if(offset_flag==0)
;;;83     		{
;;;84     			printf("\r\n OPУֵдóɹ \r\n");
;;;85     		}
;;;86     		else
;;;87     		{
;;;88     				printf("\r\n OPУֵдʧ \r\n");
;;;89     		}
;;;90         ADC_SoftwareStartConv(ADC); //ת
;;;91         while(ADC_Flag == RESET); //ȴADCת
;;;92         ADC_Value = ADC_GetConversionValue(ADC);  //ȡADCתֵ
;;;93         printf("\r\n ADC Conversion Value is 0x%x \r\n",ADC_Value);
;;;94         for (int i=0;i<5000;i++);
;;;95       }
;;;96       
;;;97     #elif defined(SC32f15xx)
;;;98         uint8_t OP_Flag = 0;
000002  2400              MOVS     r4,#0
;;;99         uint32_t ADC_OPValue = 0;
000004  2500              MOVS     r5,#0
;;;100        RCC_APB2Cmd(ENABLE);                                //ADCOPAPB2ʱ
000006  2001              MOVS     r0,#1
000008  f7fffffe          BL       RCC_APB2Cmd
;;;101        RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC,ENABLE);  //ADCʱ
00000c  2101              MOVS     r1,#1
00000e  2040              MOVS     r0,#0x40
000010  f7fffffe          BL       RCC_APB2PeriphClockCmd
;;;102        
;;;103        GPIO_InitTypeDef GPIO_InitStruct; //GPIOʼṹ
;;;104        /*ʹǰOP0/1˿Ϊģʽ*/
;;;105        GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5;
000014  213f              MOVS     r1,#0x3f
000016  4668              MOV      r0,sp
000018  8601              STRH     r1,[r0,#0x30]
;;;106        GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_HI;
00001a  2100              MOVS     r1,#0
00001c  8641              STRH     r1,[r0,#0x32]
;;;107        GPIO_Init(GPIOB, &GPIO_InitStruct);
00001e  a90c              ADD      r1,sp,#0x30
000020  4849              LDR      r0,|L1.328|
000022  f7fffffe          BL       GPIO_Init
;;;108        
;;;109        
;;;110        /*OPʼ*/
;;;111        //OP0ʼ,Ŵ
;;;112        OP_InitTypeDef OP0_InitStruct;                           //OP0ʼṹ
;;;113        OP_StructInit(&OP0_InitStruct);
000026  a808              ADD      r0,sp,#0x20
000028  f7fffffe          BL       OP_StructInit
;;;114        
;;;115        OP0_InitStruct.OP_FDBR = OP_FDBR_OPxN;                   //˷ŷӷ
00002c  2001              MOVS     r0,#1
00002e  0780              LSLS     r0,r0,#30
000030  900b              STR      r0,[sp,#0x2c]
;;;116        OP0_InitStruct.OP_PGAGain = OP_PGAGain_NonInvert8_Invert7;                  //7
000032  1581              ASRS     r1,r0,#22
000034  4668              MOV      r0,sp
000036  84c1              STRH     r1,[r0,#0x26]
;;;117        OP0_InitStruct.OP_InvertInput = OP_InvertInput_Res;      //˷ŷ˽ӷ
000038  210c              MOVS     r1,#0xc
00003a  a808              ADD      r0,sp,#0x20
00003c  7101              STRB     r1,[r0,#4]
;;;118        OP0_InitStruct.OP_NonInvertInput= OP_NonInvertInput_OPxP; //˷ͬ˽ӵ
00003e  2130              MOVS     r1,#0x30
000040  7141              STRB     r1,[r0,#5]
;;;119        OP0_InitStruct.OP_OutputPin= OP_OutputPin_Enable;        //OP0˿ʹ
000042  2101              MOVS     r1,#1
000044  70c1              STRB     r1,[r0,#3]
;;;120        OP_Init(OP_0,&OP0_InitStruct);                            //OP0гʼ
000046  a908              ADD      r1,sp,#0x20
000048  4840              LDR      r0,|L1.332|
00004a  f7fffffe          BL       OP_Init
;;;121        
;;;122        //OP1ʼ,ͬŴ
;;;123        OP_InitTypeDef OP1_InitStruct;                           //OP1ʼṹ
;;;124        OP_StructInit(&OP1_InitStruct);
00004e  a804              ADD      r0,sp,#0x10
000050  f7fffffe          BL       OP_StructInit
;;;125        
;;;126        OP1_InitStruct.OP_FDBR = OP_FDBR_VSS;                    //˷ŷӵ
000054  2000              MOVS     r0,#0
000056  9007              STR      r0,[sp,#0x1c]
;;;127        OP1_InitStruct.OP_PGAGain = OP_PGAGain_NonInvert8_Invert7;               //ͬ8
000058  21ff              MOVS     r1,#0xff
00005a  3101              ADDS     r1,#1
00005c  4668              MOV      r0,sp
00005e  82c1              STRH     r1,[r0,#0x16]
;;;128        OP1_InitStruct.OP_InvertInput = OP_InvertInput_Res;      //˷ŷ˽ӷ
000060  210c              MOVS     r1,#0xc
000062  7501              STRB     r1,[r0,#0x14]
;;;129        OP1_InitStruct.OP_NonInvertInput= OP_NonInvertInput_OPxP;//˷ͬ˽OP1P
000064  2130              MOVS     r1,#0x30
000066  7541              STRB     r1,[r0,#0x15]
;;;130        OP1_InitStruct.OP_OutputPin= OP_OutputPin_Enable;        //OP1˿ʹ
000068  2101              MOVS     r1,#1
00006a  74c1              STRB     r1,[r0,#0x13]
;;;131        OP_Init(OP_1,&OP1_InitStruct);                           //OP1гʼ
00006c  a904              ADD      r1,sp,#0x10
00006e  4837              LDR      r0,|L1.332|
000070  1c40              ADDS     r0,r0,#1
000072  f7fffffe          BL       OP_Init
;;;132       
;;;133        OP_Cmd(OP_0,ENABLE); //ʹOP0
000076  2101              MOVS     r1,#1
000078  4834              LDR      r0,|L1.332|
00007a  f7fffffe          BL       OP_Cmd
;;;134        OP_Cmd(OP_1,ENABLE); //ʹOP1
00007e  2101              MOVS     r1,#1
000080  4832              LDR      r0,|L1.332|
000082  1c40              ADDS     r0,r0,#1
000084  f7fffffe          BL       OP_Cmd
;;;135        
;;;136        /*ADCɼOP0/OP1ʼ*/
;;;137        ADC_DeInit(ADC);                                      //ADCĴλ
000088  4830              LDR      r0,|L1.332|
00008a  38b0              SUBS     r0,r0,#0xb0
00008c  f7fffffe          BL       ADC_DeInit
;;;138        ADC_InitTypeDef ADC_InitStruct;
;;;139        ADC_StructInit(&ADC_InitStruct);    
000090  4668              MOV      r0,sp
000092  f7fffffe          BL       ADC_StructInit
;;;140        ADC_InitStruct.ADC_ConvMode = ADC_ConvMode_Single;    //ADCΪתģʽ
000096  2100              MOVS     r1,#0
000098  4668              MOV      r0,sp
00009a  8181              STRH     r1,[r0,#0xc]
;;;141        ADC_InitStruct.ADC_EAIN = ADC_EAIN_0|ADC_EAIN_1;      //ʹADCͨAIN0/AIN1ɼOP0/OP1ź
00009c  2003              MOVS     r0,#3
00009e  9001              STR      r0,[sp,#4]
;;;142        ADC_InitStruct.ADC_Prescaler = ADC_Prescaler_9CLOCK;  //ADCΪ9ʱ
0000a0  2001              MOVS     r0,#1
0000a2  0240              LSLS     r0,r0,#9
0000a4  9000              STR      r0,[sp,#0]
;;;143        ADC_InitStruct.ADC_VREF = ADC_RefSource_VDD;          //ADCοѹѡ׼Դѹ
0000a6  2000              MOVS     r0,#0
0000a8  9002              STR      r0,[sp,#8]
;;;144        ADC_Init(ADC,&ADC_InitStruct);
0000aa  4669              MOV      r1,sp
0000ac  4827              LDR      r0,|L1.332|
0000ae  38b0              SUBS     r0,r0,#0xb0
0000b0  f7fffffe          BL       ADC_Init
;;;145        
;;;146        ADC_SetChannel(ADC,ADC_Channel_0);      //лOP0ͨ
0000b4  2100              MOVS     r1,#0
0000b6  4825              LDR      r0,|L1.332|
0000b8  38b0              SUBS     r0,r0,#0xb0
0000ba  f7fffffe          BL       ADC_SetChannel
;;;147        ADC_Cmd(ADC,ENABLE);        //ʹADC
0000be  2101              MOVS     r1,#1
0000c0  4822              LDR      r0,|L1.332|
0000c2  38b0              SUBS     r0,r0,#0xb0
0000c4  f7fffffe          BL       ADC_Cmd
;;;148        ADC_SoftwareStartConv(ADC); //ADCת
0000c8  4820              LDR      r0,|L1.332|
0000ca  38b0              SUBS     r0,r0,#0xb0
0000cc  f7fffffe          BL       ADC_SoftwareStartConv
;;;149        
;;;150        while(1)
0000d0  e038              B        |L1.324|
                  |L1.210|
;;;151        {
;;;152          if(ADC_GetFlagStatus(ADC,ADC_Flag_ADCIF) == SET)
0000d2  2101              MOVS     r1,#1
0000d4  481d              LDR      r0,|L1.332|
0000d6  38b0              SUBS     r0,r0,#0xb0
0000d8  f7fffffe          BL       ADC_GetFlagStatus
0000dc  2801              CMP      r0,#1
0000de  d124              BNE      |L1.298|
;;;153          {
;;;154              ADC_ClearFlag(ADC,ADC_Flag_ADCIF);
0000e0  2101              MOVS     r1,#1
0000e2  481a              LDR      r0,|L1.332|
0000e4  38b0              SUBS     r0,r0,#0xb0
0000e6  f7fffffe          BL       ADC_ClearFlag
;;;155              ADC_OPValue = ADC_GetConversionValue(ADC);
0000ea  4818              LDR      r0,|L1.332|
0000ec  38b0              SUBS     r0,r0,#0xb0
0000ee  f7fffffe          BL       ADC_GetConversionValue
0000f2  4605              MOV      r5,r0
;;;156              if(0 == OP_Flag)
0000f4  2c00              CMP      r4,#0
0000f6  d10a              BNE      |L1.270|
;;;157              {
;;;158                  OP_Flag = 1;
0000f8  2401              MOVS     r4,#1
;;;159                  printf("OP0ŴźŲֵΪ0x%x\r\n",ADC_OPValue);
0000fa  4629              MOV      r1,r5
0000fc  a014              ADR      r0,|L1.336|
0000fe  f7fffffe          BL       __2printf
;;;160                  ADC_SetChannel(ADC,ADC_Channel_1);      //лOP1ͨ
000102  2101              MOVS     r1,#1
000104  4811              LDR      r0,|L1.332|
000106  38b0              SUBS     r0,r0,#0xb0
000108  f7fffffe          BL       ADC_SetChannel
00010c  e009              B        |L1.290|
                  |L1.270|
;;;161              }
;;;162              else
;;;163              {
;;;164                  OP_Flag = 0;
00010e  2400              MOVS     r4,#0
;;;165                  printf("OP1ŴźŲֵΪ0x%x\r\n",ADC_OPValue);
000110  4629              MOV      r1,r5
000112  a016              ADR      r0,|L1.364|
000114  f7fffffe          BL       __2printf
;;;166                  ADC_SetChannel(ADC,ADC_Channel_0);      //лOP0ͨ
000118  2100              MOVS     r1,#0
00011a  480c              LDR      r0,|L1.332|
00011c  38b0              SUBS     r0,r0,#0xb0
00011e  f7fffffe          BL       ADC_SetChannel
                  |L1.290|
;;;167              }
;;;168              
;;;169              ADC_SoftwareStartConv(ADC); //ADCת
000122  480a              LDR      r0,|L1.332|
000124  38b0              SUBS     r0,r0,#0xb0
000126  f7fffffe          BL       ADC_SoftwareStartConv
                  |L1.298|
;;;170          }
;;;171          for(uint16_t i=0;i<65535;i++)
00012a  2000              MOVS     r0,#0
00012c  e007              B        |L1.318|
                  |L1.302|
;;;172          {
;;;173              for(uint16_t j=0;j<30;j++);
00012e  2100              MOVS     r1,#0
000130  e001              B        |L1.310|
                  |L1.306|
000132  1c4a              ADDS     r2,r1,#1
000134  b291              UXTH     r1,r2
                  |L1.310|
000136  291e              CMP      r1,#0x1e
000138  dbfb              BLT      |L1.306|
00013a  1c41              ADDS     r1,r0,#1              ;171
00013c  b288              UXTH     r0,r1                 ;171
                  |L1.318|
00013e  4912              LDR      r1,|L1.392|
000140  4288              CMP      r0,r1                 ;171
000142  dbf4              BLT      |L1.302|
                  |L1.324|
000144  e7c5              B        |L1.210|
;;;174          }
;;;175        }
;;;176    #endif
;;;177    }
;;;178    #if defined(SC32f12xx)
                          ENDP

000146  0000              DCW      0x0000
                  |L1.328|
                          DCD      0x40011100
                  |L1.332|
                          DCD      0x400221b0
                  |L1.336|
000150  4f5030b7          DCB      "OP0",183,197,180,243,208,197,186,197,178,201,209,249,214
000154  c5b4f3d0
000158  c5bac5b2
00015c  c9d1f9d6
000160  b5ceaa30          DCB      181,206,170,"0x%x\r\n",0
000164  7825780d
000168  0a00    
00016a  00                DCB      0
00016b  00                DCB      0
                  |L1.364|
00016c  4f5031b7          DCB      "OP1",183,197,180,243,208,197,186,197,178,201,209,249,214
000170  c5b4f3d0
000174  c5bac5b2
000178  c9d1f9d6
00017c  b5ceaa30          DCB      181,206,170,"0x%x\r\n",0
000180  7825780d
000184  0a00    
000186  00                DCB      0
000187  00                DCB      0
                  |L1.392|
                          DCD      0x0000ffff

                          AREA ||.data||, DATA, ALIGN=0

                  ADC_Flag
000000  00                DCB      0x00
                  offset_flag
000001  00                DCB      0x00

;*** Start embedded assembler ***

#line 1 "..\\Apps\\OP_AmplifiesVoltage.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___21_OP_AmplifiesVoltage_c_02dacc80____REV16|
#line 463 "..\\CMSIS\\cmsis_armcc.h"
|__asm___21_OP_AmplifiesVoltage_c_02dacc80____REV16| PROC
#line 464

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
