; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--list --debug -c --asm --interleave -o.\obj\mpu6050.o --asm_dir=.\list\ --list_dir=.\list\ --depend=.\obj\mpu6050.d --cpu=Cortex-M3 --apcs=interwork -O0 --diag_suppress=9931 -I.\FWlib\inc -I.\user -I.\CM3 -I.\dmp -I.\RTE\_STM32-FD -If:\Users\Administrator\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -If:\Users\Administrator\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.4.1\Device\Include -D__MICROLIB -D__UVISION_VERSION=530 -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD --omf_browse=.\obj\mpu6050.crf user\mpu6050.c]
                          THUMB

                          AREA ||.text||, CODE, READONLY, ALIGN=2

                  MPU_Write_Byte PROC
;;;193    //    ,
;;;194    u8 MPU_Write_Byte(u8 reg,u8 data) 				 
000000  b570              PUSH     {r4-r6,lr}
;;;195    { 
000002  4605              MOV      r5,r0
000004  460c              MOV      r4,r1
;;;196        MPU_I2C_Start(); 
000006  f7fffffe          BL       MPU_I2C_Start
;;;197    	MPU_I2C_Send_Byte((MPU_ADDR<<1)|0);//ַ+д	
00000a  20d0              MOVS     r0,#0xd0
00000c  f7fffffe          BL       MPU_I2C_Send_Byte
;;;198    	if(MPU_I2C_Wait_Ack())	//ȴӦ
000010  f7fffffe          BL       MPU_I2C_Wait_Ack
000014  b118              CBZ      r0,|L1.30|
;;;199    	{
;;;200    		MPU_I2C_Stop();		 
000016  f7fffffe          BL       MPU_I2C_Stop
;;;201    		return 1;		
00001a  2001              MOVS     r0,#1
                  |L1.28|
;;;202    	}
;;;203        MPU_I2C_Send_Byte(reg);	//дĴַ
;;;204        MPU_I2C_Wait_Ack();		//ȴӦ 
;;;205    	MPU_I2C_Send_Byte(data);//
;;;206    	if(MPU_I2C_Wait_Ack())	//ȴACK
;;;207    	{
;;;208    		MPU_I2C_Stop();	 
;;;209    		return 1;		 
;;;210    	}		 
;;;211        MPU_I2C_Stop();	 
;;;212    	return 0;
;;;213    }
00001c  bd70              POP      {r4-r6,pc}
                  |L1.30|
00001e  4628              MOV      r0,r5                 ;203
000020  f7fffffe          BL       MPU_I2C_Send_Byte
000024  f7fffffe          BL       MPU_I2C_Wait_Ack
000028  4620              MOV      r0,r4                 ;205
00002a  f7fffffe          BL       MPU_I2C_Send_Byte
00002e  f7fffffe          BL       MPU_I2C_Wait_Ack
000032  b118              CBZ      r0,|L1.60|
000034  f7fffffe          BL       MPU_I2C_Stop
000038  2001              MOVS     r0,#1                 ;209
00003a  e7ef              B        |L1.28|
                  |L1.60|
00003c  f7fffffe          BL       MPU_I2C_Stop
000040  2000              MOVS     r0,#0                 ;212
000042  e7eb              B        |L1.28|
;;;214    //I2Cһֽ 
                          ENDP

                  MPU_Set_LPF PROC
;;;53     //    ,ʧ 
;;;54     u8 MPU_Set_LPF(u16 lpf)
000044  b570              PUSH     {r4-r6,lr}
;;;55     {
000046  4604              MOV      r4,r0
;;;56     	u8 data=0;
000048  2500              MOVS     r5,#0
;;;57     	if(lpf>=188)data=1;
00004a  2cbc              CMP      r4,#0xbc
00004c  db01              BLT      |L1.82|
00004e  2501              MOVS     r5,#1
000050  e010              B        |L1.116|
                  |L1.82|
;;;58     	else if(lpf>=98)data=2;
000052  2c62              CMP      r4,#0x62
000054  db01              BLT      |L1.90|
000056  2502              MOVS     r5,#2
000058  e00c              B        |L1.116|
                  |L1.90|
;;;59     	else if(lpf>=42)data=3;
00005a  2c2a              CMP      r4,#0x2a
00005c  db01              BLT      |L1.98|
00005e  2503              MOVS     r5,#3
000060  e008              B        |L1.116|
                  |L1.98|
;;;60     	else if(lpf>=20)data=4;
000062  2c14              CMP      r4,#0x14
000064  db01              BLT      |L1.106|
000066  2504              MOVS     r5,#4
000068  e004              B        |L1.116|
                  |L1.106|
;;;61     	else if(lpf>=10)data=5;
00006a  2c0a              CMP      r4,#0xa
00006c  db01              BLT      |L1.114|
00006e  2505              MOVS     r5,#5
000070  e000              B        |L1.116|
                  |L1.114|
;;;62     	else data=6; 
000072  2506              MOVS     r5,#6
                  |L1.116|
;;;63     	return MPU_Write_Byte(MPU_CFG_REG,data);//ֵͨ˲  
000074  4629              MOV      r1,r5
000076  201a              MOVS     r0,#0x1a
000078  f7fffffe          BL       MPU_Write_Byte
;;;64     }
00007c  bd70              POP      {r4-r6,pc}
;;;65     
                          ENDP

                  MPU_Set_Rate PROC
;;;69     //    ,ʧ 
;;;70     u8 MPU_Set_Rate(u16 rate)
00007e  b570              PUSH     {r4-r6,lr}
;;;71     {
000080  4604              MOV      r4,r0
;;;72     	u8 data;
;;;73     	if(rate>1000)rate=1000;
000082  f5b47f7a          CMP      r4,#0x3e8
000086  dd01              BLE      |L1.140|
000088  f44f747a          MOV      r4,#0x3e8
                  |L1.140|
;;;74     	if(rate<4)rate=4;
00008c  2c04              CMP      r4,#4
00008e  da00              BGE      |L1.146|
000090  2404              MOVS     r4,#4
                  |L1.146|
;;;75     	data=1000/rate-1;
000092  f44f707a          MOV      r0,#0x3e8
000096  fb90f0f4          SDIV     r0,r0,r4
00009a  1e40              SUBS     r0,r0,#1
00009c  b2c5              UXTB     r5,r0
;;;76     	data=MPU_Write_Byte(MPU_SAMPLE_RATE_REG,data);	//ֵͨ˲
00009e  4629              MOV      r1,r5
0000a0  2019              MOVS     r0,#0x19
0000a2  f7fffffe          BL       MPU_Write_Byte
0000a6  4605              MOV      r5,r0
;;;77      	return MPU_Set_LPF(rate/2);	//ԶLPFΪʵһ
0000a8  4626              MOV      r6,r4
0000aa  eb0471d6          ADD      r1,r4,r6,LSR #31
0000ae  f3c1004f          UBFX     r0,r1,#1,#16
0000b2  f7fffffe          BL       MPU_Set_LPF
;;;78     }
0000b6  bd70              POP      {r4-r6,pc}
;;;79     
                          ENDP

                  MPU_Read_Byte PROC
;;;216    //ֵ:
;;;217    u8 MPU_Read_Byte(u8 reg)
0000b8  b570              PUSH     {r4-r6,lr}
;;;218    {
0000ba  4604              MOV      r4,r0
;;;219    	u8 res;
;;;220        MPU_I2C_Start(); 
0000bc  f7fffffe          BL       MPU_I2C_Start
;;;221    	MPU_I2C_Send_Byte((MPU_ADDR<<1)|0);//ַ+д	
0000c0  20d0              MOVS     r0,#0xd0
0000c2  f7fffffe          BL       MPU_I2C_Send_Byte
;;;222    	MPU_I2C_Wait_Ack();		//ȴӦ 
0000c6  f7fffffe          BL       MPU_I2C_Wait_Ack
;;;223        MPU_I2C_Send_Byte(reg);	//дĴַ
0000ca  4620              MOV      r0,r4
0000cc  f7fffffe          BL       MPU_I2C_Send_Byte
;;;224        MPU_I2C_Wait_Ack();		//ȴӦ
0000d0  f7fffffe          BL       MPU_I2C_Wait_Ack
;;;225        MPU_I2C_Start();
0000d4  f7fffffe          BL       MPU_I2C_Start
;;;226    	MPU_I2C_Send_Byte((MPU_ADDR<<1)|1);//ַ+	
0000d8  20d1              MOVS     r0,#0xd1
0000da  f7fffffe          BL       MPU_I2C_Send_Byte
;;;227        MPU_I2C_Wait_Ack();		//ȴӦ 
0000de  f7fffffe          BL       MPU_I2C_Wait_Ack
;;;228    	res=MPU_I2C_Read_Byte(0);//ȡ,nACK 
0000e2  2000              MOVS     r0,#0
0000e4  f7fffffe          BL       MPU_I2C_Read_Byte
0000e8  4605              MOV      r5,r0
;;;229        MPU_I2C_Stop();			//һֹͣ 
0000ea  f7fffffe          BL       MPU_I2C_Stop
;;;230    	return res;		
0000ee  4628              MOV      r0,r5
;;;231    }
0000f0  bd70              POP      {r4-r6,pc}
;;;232    
                          ENDP

                  MPU_Set_Accel_Fsr PROC
;;;45     //    ,ʧ 
;;;46     u8 MPU_Set_Accel_Fsr(u8 fsr)
0000f2  b510              PUSH     {r4,lr}
;;;47     {
0000f4  4604              MOV      r4,r0
;;;48     	return MPU_Write_Byte(MPU_ACCEL_CFG_REG,fsr<<3);//üٶȴ̷Χ  
0000f6  06e0              LSLS     r0,r4,#27
0000f8  0e01              LSRS     r1,r0,#24
0000fa  201c              MOVS     r0,#0x1c
0000fc  f7fffffe          BL       MPU_Write_Byte
;;;49     }
000100  bd10              POP      {r4,pc}
;;;50     //MPU6050ֵͨ˲
                          ENDP

                  MPU_Set_Gyro_Fsr PROC
;;;36     //    ,ʧ 
;;;37     u8 MPU_Set_Gyro_Fsr(u8 fsr)
000102  b510              PUSH     {r4,lr}
;;;38     {
000104  4604              MOV      r4,r0
;;;39     	return MPU_Write_Byte(MPU_GYRO_CFG_REG,fsr<<3);//̷Χ  
000106  06e0              LSLS     r0,r4,#27
000108  0e01              LSRS     r1,r0,#24
00010a  201b              MOVS     r0,#0x1b
00010c  f7fffffe          BL       MPU_Write_Byte
;;;40     }
000110  bd10              POP      {r4,pc}
;;;41     
                          ENDP

                  MPU_Init PROC
;;;7      //ֵ:0,ɹ Ϊ
;;;8      unsigned char MPU_Init(void)
000112  b510              PUSH     {r4,lr}
;;;9      { 
;;;10     	unsigned char  res; 
;;;11     	MPU_I2C_Init();//ʼI2C
000114  f7fffffe          BL       MPU_I2C_Init
;;;12     	MPU_Write_Byte(MPU_PWR_MGMT1_REG,0X80);	//λMPU6050
000118  2180              MOVS     r1,#0x80
00011a  206b              MOVS     r0,#0x6b
00011c  f7fffffe          BL       MPU_Write_Byte
;;;13       delay_ms(100);
000120  2064              MOVS     r0,#0x64
000122  f7fffffe          BL       delay_ms
;;;14     	MPU_Write_Byte(MPU_PWR_MGMT1_REG,0X00);	//MPU6050 
000126  2100              MOVS     r1,#0
000128  206b              MOVS     r0,#0x6b
00012a  f7fffffe          BL       MPU_Write_Byte
;;;15     	MPU_Set_Gyro_Fsr(3);					//Ǵ,2000dps
00012e  2003              MOVS     r0,#3
000130  f7fffffe          BL       MPU_Set_Gyro_Fsr
;;;16     	MPU_Set_Accel_Fsr(0);					//ٶȴ,2g
000134  2000              MOVS     r0,#0
000136  f7fffffe          BL       MPU_Set_Accel_Fsr
;;;17     	MPU_Set_Rate(200);						//ò200Hz
00013a  20c8              MOVS     r0,#0xc8
00013c  f7fffffe          BL       MPU_Set_Rate
;;;18     	MPU_Write_Byte(MPU_INT_EN_REG,0X00);	//رж
000140  2100              MOVS     r1,#0
000142  2038              MOVS     r0,#0x38
000144  f7fffffe          BL       MPU_Write_Byte
;;;19     	MPU_Write_Byte(MPU_USER_CTRL_REG,0X00);	//I2Cģʽر
000148  2100              MOVS     r1,#0
00014a  206a              MOVS     r0,#0x6a
00014c  f7fffffe          BL       MPU_Write_Byte
;;;20     	MPU_Write_Byte(MPU_FIFO_EN_REG,0X00);	//رFIFO
000150  2100              MOVS     r1,#0
000152  2023              MOVS     r0,#0x23
000154  f7fffffe          BL       MPU_Write_Byte
;;;21     	MPU_Write_Byte(MPU_INTBP_CFG_REG,0X80);	//INTŵ͵ƽЧ
000158  2180              MOVS     r1,#0x80
00015a  2037              MOVS     r0,#0x37
00015c  f7fffffe          BL       MPU_Write_Byte
;;;22     	res=MPU_Read_Byte(MPU_DEVICE_ID_REG); 
000160  2075              MOVS     r0,#0x75
000162  f7fffffe          BL       MPU_Read_Byte
000166  4604              MOV      r4,r0
;;;23     	
;;;24     	USART_SendData(USART1,res);
000168  4621              MOV      r1,r4
00016a  487d              LDR      r0,|L1.864|
00016c  f7fffffe          BL       USART_SendData
;;;25     	if(res==0x68)//IDȷ
000170  2c68              CMP      r4,#0x68
000172  d10b              BNE      |L1.396|
;;;26     	{	//GPIO_SetBits(GPIOB, GPIO_Pin_5);
;;;27     		MPU_Write_Byte(MPU_PWR_MGMT1_REG,0X01);	//CLKSEL,PLL XΪο
000174  2101              MOVS     r1,#1
000176  206b              MOVS     r0,#0x6b
000178  f7fffffe          BL       MPU_Write_Byte
;;;28     		MPU_Write_Byte(MPU_PWR_MGMT2_REG,0X00);	//ٶǶ
00017c  2100              MOVS     r1,#0
00017e  206c              MOVS     r0,#0x6c
000180  f7fffffe          BL       MPU_Write_Byte
;;;29     		MPU_Set_Rate(200);					           	//òΪ200Hz
000184  20c8              MOVS     r0,#0xc8
000186  f7fffffe          BL       MPU_Set_Rate
00018a  e001              B        |L1.400|
                  |L1.396|
;;;30      	}else return 1;
00018c  2001              MOVS     r0,#1
                  |L1.398|
;;;31     	return 0;
;;;32     }
00018e  bd10              POP      {r4,pc}
                  |L1.400|
000190  2000              MOVS     r0,#0                 ;31
000192  e7fc              B        |L1.398|
;;;33     //MPU6050Ǵ̷Χ
                          ENDP

                  MPU_Read_Len PROC
;;;164    //    ,
;;;165    u8 MPU_Read_Len(u8 addr,u8 reg,u8 len,u8 *buf)
000194  e92d41f0          PUSH     {r4-r8,lr}
;;;166    { 
000198  4606              MOV      r6,r0
00019a  460f              MOV      r7,r1
00019c  4614              MOV      r4,r2
00019e  461d              MOV      r5,r3
;;;167     	MPU_I2C_Start(); 
0001a0  f7fffffe          BL       MPU_I2C_Start
;;;168    	MPU_I2C_Send_Byte((addr<<1)|0);//ַ+д	
0001a4  2100              MOVS     r1,#0
0001a6  ea410146          ORR      r1,r1,r6,LSL #1
0001aa  b2c8              UXTB     r0,r1
0001ac  f7fffffe          BL       MPU_I2C_Send_Byte
;;;169    	if(MPU_I2C_Wait_Ack())	//ȴӦ
0001b0  f7fffffe          BL       MPU_I2C_Wait_Ack
0001b4  b120              CBZ      r0,|L1.448|
;;;170    	{
;;;171    		MPU_I2C_Stop();		 
0001b6  f7fffffe          BL       MPU_I2C_Stop
;;;172    		return 1;		
0001ba  2001              MOVS     r0,#1
                  |L1.444|
;;;173    	}
;;;174        MPU_I2C_Send_Byte(reg);	//дĴַ
;;;175        MPU_I2C_Wait_Ack();		//ȴӦ
;;;176        MPU_I2C_Start();
;;;177    	MPU_I2C_Send_Byte((addr<<1)|1);//ַ+	
;;;178        MPU_I2C_Wait_Ack();		//ȴӦ 
;;;179    	while(len)
;;;180    	{
;;;181    		if(len==1)*buf=MPU_I2C_Read_Byte(0);//,nACK 
;;;182    		else *buf=MPU_I2C_Read_Byte(1);		//,ACK  
;;;183    		len--;
;;;184    		buf++; 
;;;185    	}    
;;;186        MPU_I2C_Stop();	//һֹͣ 
;;;187    	return 0;	
;;;188    }
0001bc  e8bd81f0          POP      {r4-r8,pc}
                  |L1.448|
0001c0  4638              MOV      r0,r7                 ;174
0001c2  f7fffffe          BL       MPU_I2C_Send_Byte
0001c6  f7fffffe          BL       MPU_I2C_Wait_Ack
0001ca  f7fffffe          BL       MPU_I2C_Start
0001ce  2101              MOVS     r1,#1                 ;177
0001d0  eb010146          ADD      r1,r1,r6,LSL #1       ;177
0001d4  b2c8              UXTB     r0,r1                 ;177
0001d6  f7fffffe          BL       MPU_I2C_Send_Byte
0001da  f7fffffe          BL       MPU_I2C_Wait_Ack
0001de  e00d              B        |L1.508|
                  |L1.480|
0001e0  2c01              CMP      r4,#1                 ;181
0001e2  d104              BNE      |L1.494|
0001e4  2000              MOVS     r0,#0                 ;181
0001e6  f7fffffe          BL       MPU_I2C_Read_Byte
0001ea  7028              STRB     r0,[r5,#0]            ;181
0001ec  e003              B        |L1.502|
                  |L1.494|
0001ee  2001              MOVS     r0,#1                 ;182
0001f0  f7fffffe          BL       MPU_I2C_Read_Byte
0001f4  7028              STRB     r0,[r5,#0]            ;182
                  |L1.502|
0001f6  1e60              SUBS     r0,r4,#1              ;183
0001f8  b2c4              UXTB     r4,r0                 ;183
0001fa  1c6d              ADDS     r5,r5,#1              ;184
                  |L1.508|
0001fc  2c00              CMP      r4,#0                 ;179
0001fe  d1ef              BNE      |L1.480|
000200  f7fffffe          BL       MPU_I2C_Stop
000204  2000              MOVS     r0,#0                 ;187
000206  e7d9              B        |L1.444|
;;;189    //I2Cдһֽ 
                          ENDP

                  MPU_Get_Temperature PROC
;;;81     //ֵ:¶ֵ(100)
;;;82     short MPU_Get_Temperature(void)
000208  e92d4ff8          PUSH     {r3-r11,lr}
;;;83     {
;;;84         u8 buf[2]; 
;;;85         short raw;
;;;86     	float temp;
;;;87     	MPU_Read_Len(MPU_ADDR,MPU_TEMP_OUTH_REG,2,buf); 
00020c  466b              MOV      r3,sp
00020e  2202              MOVS     r2,#2
000210  2141              MOVS     r1,#0x41
000212  2068              MOVS     r0,#0x68
000214  f7fffffe          BL       MPU_Read_Len
;;;88         raw=((u16)buf[0]<<8)|buf[1];  
000218  f89d0001          LDRB     r0,[sp,#1]
00021c  f89d1000          LDRB     r1,[sp,#0]
000220  ea402001          ORR      r0,r0,r1,LSL #8
000224  fa0ffa80          SXTH     r10,r0
;;;89         temp=36.53+((double)raw)/340;  
000228  4650              MOV      r0,r10
00022a  f7fffffe          BL       __aeabi_i2d
00022e  4680              MOV      r8,r0
000230  2200              MOVS     r2,#0
000232  4b4c              LDR      r3,|L1.868|
000234  f7fffffe          BL       __aeabi_ddiv
000238  4606              MOV      r6,r0
00023a  4a4b              LDR      r2,|L1.872|
00023c  4b4b              LDR      r3,|L1.876|
00023e  f7fffffe          BL       __aeabi_dadd
000242  4604              MOV      r4,r0
000244  f7fffffe          BL       __aeabi_d2f
000248  4683              MOV      r11,r0
;;;90         return temp*100;;
00024a  4949              LDR      r1,|L1.880|
00024c  4658              MOV      r0,r11
00024e  f7fffffe          BL       __aeabi_fmul
000252  4604              MOV      r4,r0
000254  f7fffffe          BL       __aeabi_f2iz
000258  b200              SXTH     r0,r0
;;;91     }
00025a  e8bd8ff8          POP      {r3-r11,pc}
;;;92     
                          ENDP

                  MPU_Get_Gyroscope PROC
;;;96     //    ,
;;;97     u8 MPU_Get_Gyroscope(short *gx,short *gy,short *gz)
00025e  e92d41fc          PUSH     {r2-r8,lr}
;;;98     {
000262  4604              MOV      r4,r0
000264  460d              MOV      r5,r1
000266  4616              MOV      r6,r2
;;;99         u8 buf[6],res;  
;;;100    	res=MPU_Read_Len(MPU_ADDR,MPU_GYRO_XOUTH_REG,6,buf);
000268  466b              MOV      r3,sp
00026a  2206              MOVS     r2,#6
00026c  2143              MOVS     r1,#0x43
00026e  2068              MOVS     r0,#0x68
000270  f7fffffe          BL       MPU_Read_Len
000274  4607              MOV      r7,r0
;;;101    	if(res==0)
000276  b9bf              CBNZ     r7,|L1.680|
;;;102    	{
;;;103    		*gx=((u16)buf[0]<<8)|buf[1];  
000278  f89d0001          LDRB     r0,[sp,#1]
00027c  f89d1000          LDRB     r1,[sp,#0]
000280  ea402001          ORR      r0,r0,r1,LSL #8
000284  b200              SXTH     r0,r0
000286  8020              STRH     r0,[r4,#0]
;;;104    		*gy=((u16)buf[2]<<8)|buf[3];  
000288  f89d0003          LDRB     r0,[sp,#3]
00028c  f89d1002          LDRB     r1,[sp,#2]
000290  ea402001          ORR      r0,r0,r1,LSL #8
000294  b200              SXTH     r0,r0
000296  8028              STRH     r0,[r5,#0]
;;;105    		*gz=((u16)buf[4]<<8)|buf[5];
000298  f89d0005          LDRB     r0,[sp,#5]
00029c  f89d1004          LDRB     r1,[sp,#4]
0002a0  ea402001          ORR      r0,r0,r1,LSL #8
0002a4  b200              SXTH     r0,r0
0002a6  8030              STRH     r0,[r6,#0]
                  |L1.680|
;;;106    	} 	
;;;107        return res;
0002a8  4638              MOV      r0,r7
;;;108    }
0002aa  e8bd81fc          POP      {r2-r8,pc}
;;;109    
                          ENDP

                  MPU_Get_Accelerometer PROC
;;;113    //    ,
;;;114    u8 MPU_Get_Accelerometer(short *ax,short *ay,short *az)
0002ae  e92d41fc          PUSH     {r2-r8,lr}
;;;115    {
0002b2  4604              MOV      r4,r0
0002b4  460d              MOV      r5,r1
0002b6  4616              MOV      r6,r2
;;;116        u8 buf[6],res;  
;;;117    	res=MPU_Read_Len(MPU_ADDR,MPU_ACCEL_XOUTH_REG,6,buf);
0002b8  466b              MOV      r3,sp
0002ba  2206              MOVS     r2,#6
0002bc  213b              MOVS     r1,#0x3b
0002be  2068              MOVS     r0,#0x68
0002c0  f7fffffe          BL       MPU_Read_Len
0002c4  4607              MOV      r7,r0
;;;118    	if(res==0)
0002c6  b9bf              CBNZ     r7,|L1.760|
;;;119    	{
;;;120    		*ax=((u16)buf[0]<<8)|buf[1];  
0002c8  f89d0001          LDRB     r0,[sp,#1]
0002cc  f89d1000          LDRB     r1,[sp,#0]
0002d0  ea402001          ORR      r0,r0,r1,LSL #8
0002d4  b200              SXTH     r0,r0
0002d6  8020              STRH     r0,[r4,#0]
;;;121    		*ay=((u16)buf[2]<<8)|buf[3];  
0002d8  f89d0003          LDRB     r0,[sp,#3]
0002dc  f89d1002          LDRB     r1,[sp,#2]
0002e0  ea402001          ORR      r0,r0,r1,LSL #8
0002e4  b200              SXTH     r0,r0
0002e6  8028              STRH     r0,[r5,#0]
;;;122    		*az=((u16)buf[4]<<8)|buf[5];
0002e8  f89d0005          LDRB     r0,[sp,#5]
0002ec  f89d1004          LDRB     r1,[sp,#4]
0002f0  ea402001          ORR      r0,r0,r1,LSL #8
0002f4  b200              SXTH     r0,r0
0002f6  8030              STRH     r0,[r6,#0]
                  |L1.760|
;;;123    	} 	
;;;124        return res;;
0002f8  4638              MOV      r0,r7
;;;125    }
0002fa  e8bd81fc          POP      {r2-r8,pc}
;;;126    //I2Cд
                          ENDP

                  MPU_Write_Len PROC
;;;132    //    ,
;;;133    u8 MPU_Write_Len(u8 addr,u8 reg,u8 len,u8 *buf)
0002fe  e92d41f0          PUSH     {r4-r8,lr}
;;;134    {
000302  4605              MOV      r5,r0
000304  460e              MOV      r6,r1
000306  4617              MOV      r7,r2
000308  4698              MOV      r8,r3
;;;135    	u8 i; 
;;;136        MPU_I2C_Start(); 
00030a  f7fffffe          BL       MPU_I2C_Start
;;;137    	
;;;138    	MPU_I2C_Send_Byte((addr<<1)|0);//ַ+д	
00030e  2100              MOVS     r1,#0
000310  ea410145          ORR      r1,r1,r5,LSL #1
000314  b2c8              UXTB     r0,r1
000316  f7fffffe          BL       MPU_I2C_Send_Byte
;;;139    	if(MPU_I2C_Wait_Ack())	//ȴӦ
00031a  f7fffffe          BL       MPU_I2C_Wait_Ack
00031e  b120              CBZ      r0,|L1.810|
;;;140    	{//
;;;141    		MPU_I2C_Stop();		//uprintf(USART1," ϵͳɹ!\r\n");   
000320  f7fffffe          BL       MPU_I2C_Stop
;;;142    		return 1;		
000324  2001              MOVS     r0,#1
                  |L1.806|
;;;143    	}
;;;144        MPU_I2C_Send_Byte(reg);	//дĴַ
;;;145        MPU_I2C_Wait_Ack();		//ȴӦ
;;;146    	for(i=0;i<len;i++)
;;;147    	{
;;;148    		MPU_I2C_Send_Byte(buf[i]);	//
;;;149    		if(MPU_I2C_Wait_Ack())		//ȴACK
;;;150    		{
;;;151    			MPU_I2C_Stop();	 
;;;152    			return 1;		 
;;;153    		}		
;;;154    	}    
;;;155        MPU_I2C_Stop();	 
;;;156    	return 0;	
;;;157    } 
000326  e8bd81f0          POP      {r4-r8,pc}
                  |L1.810|
00032a  4630              MOV      r0,r6                 ;144
00032c  f7fffffe          BL       MPU_I2C_Send_Byte
000330  f7fffffe          BL       MPU_I2C_Wait_Ack
000334  2400              MOVS     r4,#0                 ;146
000336  e00c              B        |L1.850|
                  |L1.824|
000338  f8180004          LDRB     r0,[r8,r4]            ;148
00033c  f7fffffe          BL       MPU_I2C_Send_Byte
000340  f7fffffe          BL       MPU_I2C_Wait_Ack
000344  b118              CBZ      r0,|L1.846|
000346  f7fffffe          BL       MPU_I2C_Stop
00034a  2001              MOVS     r0,#1                 ;152
00034c  e7eb              B        |L1.806|
                  |L1.846|
00034e  1c60              ADDS     r0,r4,#1              ;146
000350  b2c4              UXTB     r4,r0                 ;146
                  |L1.850|
000352  42bc              CMP      r4,r7                 ;146
000354  dbf0              BLT      |L1.824|
000356  f7fffffe          BL       MPU_I2C_Stop
00035a  2000              MOVS     r0,#0                 ;156
00035c  e7e3              B        |L1.806|
;;;158    //I2C
                          ENDP

00035e  0000              DCW      0x0000
                  |L1.864|
                          DCD      0x40013800
                  |L1.868|
                          DCD      0x40754000
                  |L1.872|
                          DCD      0x0a3d70a4
                  |L1.876|
                          DCD      0x404243d7
                  |L1.880|
                          DCD      0x42c80000
