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

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

                          REQUIRE _printf_percent
                          REQUIRE _printf_x
                          REQUIRE _printf_longlong_hex
                  SPI_FIFOSlave_Function PROC
;;;21     
;;;22     void SPI_FIFOSlave_Function(void)
000000  b092              SUB      sp,sp,#0x48
;;;23     {
;;;24     	GPIO_InitTypeDef GPIO_InitStruct;
;;;25     	GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_10;
000002  2103              MOVS     r1,#3
000004  0289              LSLS     r1,r1,#10
000006  a810              ADD      r0,sp,#0x40
000008  8001              STRH     r1,[r0,#0]
;;;26       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT_PP;
00000a  2102              MOVS     r1,#2
00000c  8041              STRH     r1,[r0,#2]
;;;27       GPIO_Init(GPIOB, &GPIO_InitStruct);
00000e  a910              ADD      r1,sp,#0x40
000010  483b              LDR      r0,|L1.256|
000012  f7fffffe          BL       GPIO_Init
;;;28     	SPI_InitTypeDef SPI_InitStruct; //SPIʼṹ
;;;29     	
;;;30     #if (SPI_Mode_ == 1)
;;;31     	volatile uint16_t FIFOSlave_SPI0_ReceiveData[16] = {0};
;;;32     
;;;33       /* ʹSPI0ʱ */
;;;34       RCC_APB0Cmd(ENABLE);  //SPI0APB0ʱ
;;;35       RCC_APB0PeriphClockCmd(RCC_APB0Periph_SPI0, ENABLE);
;;;36     	
;;;37       /*  SPI0Ϊӻ */
;;;38     	SPI_InitStruct.SPI_CPHA = SPI_CPHA_1Edge;	//SPIһزɼ
;;;39     	SPI_InitStruct.SPI_CPOL = SPI_CPOL_Low;	//SPIеƽΪ͵ƽ
;;;40     	SPI_InitStruct.SPI_DataSize = SPI_DataSize_16B;	//ݳΪ16λ
;;;41     	SPI_InitStruct.SPI_FirstBit = SPI_FirstBit_MSB;	//ֵΪλǰ
;;;42     	SPI_InitStruct.SPI_Mode = SPI_Mode_Slave;	//SPIڴӻģʽ
;;;43     	SPI_InitStruct.SPI_Prescaler = SPI_Prescaler_1024;	//SPIƵΪAPB0ʱ1024Ƶ	
;;;44     	SPI_Init(SPI0,&SPI_InitStruct);		
;;;45     	#if defined(SC32f15xx)
;;;46       SPI_PinRemapConfig(SPI0,SPI_PinRemap_A);   //SPI0ӳA
;;;47     #endif
;;;48     	/* ʹSPI0 */
;;;49     	SPI_Cmd(SPI0,ENABLE);
;;;50     	
;;;51     	//PB_OT(11) ;
;;;52     	
;;;53     #elif (SPI_Mode_ == 0)
;;;54       volatile uint16_t FIFOSlave_SPI1_ReceiveData[16];
;;;55     	volatile uint16_t SPI1_Num = 0;
000016  2100              MOVS     r1,#0
000018  9101              STR      r1,[sp,#4]
;;;56     	
;;;57     #if defined(SC32f15xx)
;;;58       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15;
00001a  2101              MOVS     r1,#1
00001c  03c9              LSLS     r1,r1,#15
00001e  a810              ADD      r0,sp,#0x40
000020  8001              STRH     r1,[r0,#0]
;;;59       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT_PP;
000022  2102              MOVS     r1,#2
000024  8041              STRH     r1,[r0,#2]
;;;60       GPIO_Init(GPIOB, &GPIO_InitStruct);
000026  a910              ADD      r1,sp,#0x40
000028  4835              LDR      r0,|L1.256|
00002a  f7fffffe          BL       GPIO_Init
;;;61     	PC_BIT(2) = 1;
00002e  2001              MOVS     r0,#1
000030  4934              LDR      r1,|L1.260|
000032  7088              STRB     r0,[r1,#2]
;;;62     #elif defined(SC32f12xx)
;;;63       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1;
;;;64       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT_PP;
;;;65       GPIO_Init(GPIOA, &GPIO_InitStruct);
;;;66     	PA_BIT(1) = 1;
;;;67     #elif defined(SC32f10xx)
;;;68       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13;
;;;69       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT_PP;
;;;70       GPIO_Init(GPIOA, &GPIO_InitStruct);
;;;71     	PA_BIT(13) = 1;
;;;72     #endif
;;;73       /* ʹSPI1ʱ */
;;;74        RCC_APB1Cmd(ENABLE);//SPI1APB1ʱ 
000034  f7fffffe          BL       RCC_APB1Cmd
;;;75     #if defined(SC32f12xx)
;;;76       RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI1, ENABLE);
;;;77     #elif defined(SC32f10xx)
;;;78        RCC_APB1Cmd(ENABLE);//SPI1APB1ʱ
;;;79     #elif defined(SC32f15xx)
;;;80       /* ʹSPI1ʱ */
;;;81       RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI1_TWI1, ENABLE);
000038  2101              MOVS     r1,#1
00003a  2010              MOVS     r0,#0x10
00003c  f7fffffe          BL       RCC_APB1PeriphClockCmd
;;;82     #endif
;;;83     	
;;;84       /* SPI1Ϊ */
;;;85     	SPI_InitStruct.SPI_CPHA = SPI_CPHA_1Edge;	//SPIһزɼ
000040  2000              MOVS     r0,#0
000042  900c              STR      r0,[sp,#0x30]
;;;86     	SPI_InitStruct.SPI_CPOL = SPI_CPOL_Low;	//SPIеƽΪ͵ƽ
000044  900d              STR      r0,[sp,#0x34]
;;;87     	SPI_InitStruct.SPI_DataSize = SPI_DataSize_16B;	//ݳΪ16λ
000046  2002              MOVS     r0,#2
000048  900b              STR      r0,[sp,#0x2c]
;;;88     	SPI_InitStruct.SPI_FirstBit = SPI_FirstBit_MSB;	//ֵΪλǰ
00004a  2000              MOVS     r0,#0
00004c  900e              STR      r0,[sp,#0x38]
;;;89     	SPI_InitStruct.SPI_Mode = SPI_Mode_Master;	//SPIģʽ
00004e  2001              MOVS     r0,#1
000050  900a              STR      r0,[sp,#0x28]
;;;90     	SPI_InitStruct.SPI_Prescaler = SPI_Prescaler_1024;	//SPIƵΪAPB0ʱ1024Ƶ
000052  2005              MOVS     r0,#5
000054  0240              LSLS     r0,r0,#9
000056  900f              STR      r0,[sp,#0x3c]
;;;91     	SPI_Init(SPI1,&SPI_InitStruct);		
000058  a90a              ADD      r1,sp,#0x28
00005a  482b              LDR      r0,|L1.264|
00005c  f7fffffe          BL       SPI_Init
;;;92     	
;;;93     #if defined(SC32f12xx)
;;;94       /* ʹSPI1ж */
;;;95       SPI_ITConfig(SPI1, SPI_IT_INTEN, ENABLE);
;;;96       NVIC_EnableIRQ(SPI1_2_IRQn);
;;;97     #elif defined(SC32f10xx)
;;;98       /* ʹSPI1ж */
;;;99       SPI_ITConfig(SPI1, SPI_IT_INTEN, ENABLE);
;;;100      NVIC_EnableIRQ(SPI1_IRQn);
;;;101    #elif defined(SC32f15xx)
;;;102      /* ʹSPI1ж */
;;;103      SPI_ITConfig(SPI1, SPI_IT_INTEN, ENABLE);
000060  2201              MOVS     r2,#1
000062  4611              MOV      r1,r2
000064  4828              LDR      r0,|L1.264|
000066  f7fffffe          BL       SPI_ITConfig
;;;104      NVIC_EnableIRQ(SPI1_TWI1_IRQn);
00006a  200a              MOVS     r0,#0xa
00006c  2800              CMP      r0,#0
00006e  db05              BLT      |L1.124|
000070  06c2              LSLS     r2,r0,#27
000072  0ed2              LSRS     r2,r2,#27
000074  2101              MOVS     r1,#1
000076  4091              LSLS     r1,r1,r2
000078  4a24              LDR      r2,|L1.268|
00007a  6011              STR      r1,[r2,#0]
                  |L1.124|
00007c  bf00              NOP      
;;;105    #endif
;;;106    
;;;107      /* ʹSPI1 */
;;;108    	SPI_Cmd(SPI1,ENABLE);
00007e  2101              MOVS     r1,#1
000080  4821              LDR      r0,|L1.264|
000082  f7fffffe          BL       SPI_Cmd
;;;109    #endif
;;;110    	
;;;111    	
;;;112    	while(1)
000086  e039              B        |L1.252|
                  |L1.136|
;;;113    	{
;;;114    #if (SPI_Mode_ == 1)
;;;115    
;;;116       	SPI_SendDataFIFO(SPI0,(uint32_t *)FIFOSlave_SPI0_SendData,8);//дǰ8
;;;117    
;;;118    		while(SPI_GetFlagStatus(SPI0,SPI_Flag_RXFIF) == RESET); //ȴFIFO
;;;119    		SPI_ReceiveDataFIFO(SPI0,(uint32_t *)FIFOSlave_SPI0_ReceiveData,8); //ȡ8
;;;120    		
;;;121    		SPI_SendDataFIFO(SPI0,(uint32_t *)(FIFOSlave_SPI0_SendData+8),8);//д8
;;;122    		
;;;123    		while(SPI_GetFlagStatus(SPI0,SPI_Flag_RXFIF) == RESET); //ȴFIFO
;;;124    		SPI_ReceiveDataFIFO(SPI0,(uint32_t *)(FIFOSlave_SPI0_ReceiveData+8),8); //ȡ8
;;;125    	
;;;126    		for(int i=0 ;i <= 15 ;i++)	printf("SPI0ӻյΪ0x%x\r\n",FIFOSlave_SPI0_ReceiveData[i]);
;;;127    		printf("\r\n");
;;;128    #elif (SPI_Mode_ == 0)
;;;129    			
;;;130    		
;;;131    		
;;;132    		/* SPI1ûFIFOҪֶ/ */
;;;133    		for(SPI1_Num=0; SPI1_Num <= 15;SPI1_Num ++)
000088  2000              MOVS     r0,#0
00008a  9001              STR      r0,[sp,#4]
00008c  e020              B        |L1.208|
                  |L1.142|
;;;134    		{
;;;135        
;;;136    			SPI_SendData(SPI1,FIFOSlave_SPI1_SendData[SPI1_Num]);
00008e  4668              MOV      r0,sp
000090  8880              LDRH     r0,[r0,#4]
000092  0040              LSLS     r0,r0,#1
000094  4a1e              LDR      r2,|L1.272|
000096  5a11              LDRH     r1,[r2,r0]
000098  481b              LDR      r0,|L1.264|
00009a  f7fffffe          BL       SPI_SendData
;;;137    			while(SPI1_Flag == RESET);
00009e  bf00              NOP      
                  |L1.160|
0000a0  481c              LDR      r0,|L1.276|
0000a2  7800              LDRB     r0,[r0,#0]  ; SPI1_Flag
0000a4  2800              CMP      r0,#0
0000a6  d0fb              BEQ      |L1.160|
;;;138    			SPI1_Flag = RESET;
0000a8  2000              MOVS     r0,#0
0000aa  491a              LDR      r1,|L1.276|
0000ac  7008              STRB     r0,[r1,#0]
;;;139    			FIFOSlave_SPI1_ReceiveData[SPI1_Num] = SPI_ReceiveData(SPI1);//SPI1
0000ae  4816              LDR      r0,|L1.264|
0000b0  f7fffffe          BL       SPI_ReceiveData
0000b4  b281              UXTH     r1,r0
0000b6  4668              MOV      r0,sp
0000b8  8880              LDRH     r0,[r0,#4]
0000ba  0040              LSLS     r0,r0,#1
0000bc  aa02              ADD      r2,sp,#8
0000be  5211              STRH     r1,[r2,r0]
;;;140    		  PB_OT(11) ;
0000c0  2001              MOVS     r0,#1
0000c2  490f              LDR      r1,|L1.256|
0000c4  76c8              STRB     r0,[r1,#0x1b]
0000c6  4668              MOV      r0,sp                 ;133
0000c8  8880              LDRH     r0,[r0,#4]            ;133
0000ca  1c40              ADDS     r0,r0,#1              ;133
0000cc  b281              UXTH     r1,r0                 ;133
0000ce  9101              STR      r1,[sp,#4]            ;133
                  |L1.208|
0000d0  4668              MOV      r0,sp                 ;133
0000d2  8880              LDRH     r0,[r0,#4]            ;133
0000d4  280f              CMP      r0,#0xf               ;133
0000d6  ddda              BLE      |L1.142|
;;;141    				
;;;142    		}
;;;143    
;;;144    		
;;;145    		for(int i=0 ;i <= 15 ;i++)	printf("SPI1յΪ0x%x\r\n",FIFOSlave_SPI1_ReceiveData[i]);
0000d8  2400              MOVS     r4,#0
0000da  e006              B        |L1.234|
                  |L1.220|
0000dc  0060              LSLS     r0,r4,#1
0000de  aa02              ADD      r2,sp,#8
0000e0  5a11              LDRH     r1,[r2,r0]
0000e2  a00d              ADR      r0,|L1.280|
0000e4  f7fffffe          BL       __2printf
0000e8  1c64              ADDS     r4,r4,#1
                  |L1.234|
0000ea  2c0f              CMP      r4,#0xf
0000ec  ddf6              BLE      |L1.220|
;;;146    		printf("SPI1յΪOK\r\n");
0000ee  a013              ADR      r0,|L1.316|
0000f0  f7fffffe          BL       __2printf
;;;147    		/* ־λΪһͨ׼ */
;;;148    		SPI1_Num=0;
0000f4  2000              MOVS     r0,#0
0000f6  9001              STR      r0,[sp,#4]
;;;149    		SPI1_Flag = RESET;
0000f8  4906              LDR      r1,|L1.276|
0000fa  7008              STRB     r0,[r1,#0]
                  |L1.252|
0000fc  e7c4              B        |L1.136|
;;;150    #endif
;;;151    		
;;;152    	}
;;;153    }
;;;154    
                          ENDP

0000fe  0000              DCW      0x0000
                  |L1.256|
                          DCD      0x40011100
                  |L1.260|
                          DCD      0x40011200
                  |L1.264|
                          DCD      0x40021040
                  |L1.268|
                          DCD      0xe000e100
                  |L1.272|
                          DCD      FIFOSlave_SPI1_SendData
                  |L1.276|
                          DCD      SPI1_Flag
                  |L1.280|
000118  53504931          DCB      "SPI1",214,247,187,250,189,211,202,213,181,189,181,196,202
00011c  d6f7bbfa
000120  bdd3cad5
000124  b5bdb5c4
000128  ca      
000129  fdbeddce          DCB      253,190,221,206,170,161,176,"0x%x",161,177,163,161,"\r\n"
00012d  aaa1b030
000131  782578a1
000135  b1a3a10d
000139  0a      
00013a  00                DCB      0
00013b  00                DCB      0
                  |L1.316|
00013c  53504931          DCB      "SPI1",214,247,187,250,189,211,202,213,181,189,181,196,202
000140  d6f7bbfa
000144  bdd3cad5
000148  b5bdb5c4
00014c  ca      
00014d  fdbeddce          DCB      253,190,221,206,170,"OK",163,161,"\r\n",0
000151  aa4f4ba3
000155  a10d0a00
000159  00                DCB      0
00015a  00                DCB      0
00015b  00                DCB      0

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

                  SPI_FIFOSlave_SPI1Handler PROC
;;;155    
;;;156    void SPI_FIFOSlave_SPI1Handler(void)
000000  b510              PUSH     {r4,lr}
;;;157    {
;;;158    
;;;159    #if (SPI_Mode_ == 0)
;;;160    	if(SPI_GetFlagStatus(SPI1,SPI_Flag_SPIF))
000002  2101              MOVS     r1,#1
000004  4806              LDR      r0,|L2.32|
000006  f7fffffe          BL       SPI_GetFlagStatus
00000a  2800              CMP      r0,#0
00000c  d006              BEQ      |L2.28|
;;;161    	{
;;;162    		SPI_ClearFlag(SPI1,SPI_Flag_SPIF);
00000e  2101              MOVS     r1,#1
000010  4803              LDR      r0,|L2.32|
000012  f7fffffe          BL       SPI_ClearFlag
;;;163    		SPI1_Flag = SET;
000016  2001              MOVS     r0,#1
000018  4902              LDR      r1,|L2.36|
00001a  7008              STRB     r0,[r1,#0]
                  |L2.28|
;;;164    	}
;;;165    #endif
;;;166    
;;;167    }
00001c  bd10              POP      {r4,pc}
                          ENDP

00001e  0000              DCW      0x0000
                  |L2.32|
                          DCD      0x40021040
                  |L2.36|
                          DCD      SPI1_Flag

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

                  SPI1_Flag
000000  0000              DCB      0x00,0x00
                  FIFOSlave_SPI1_SendData
000002  0011              DCW      0x0011
000004  00120013          DCW      0x0012,0x0013
000008  00140015          DCW      0x0014,0x0015
00000c  00160017          DCW      0x0016,0x0017
000010  00180019          DCW      0x0018,0x0019
000014  001a001b          DCW      0x001a,0x001b
000018  001c001d          DCW      0x001c,0x001d
00001c  001e001f          DCW      0x001e,0x001f
000020  002f              DCW      0x002f

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
