www.pudn.com > ADSP-BF561_MicronSensorExample_I2C_ASM_in_C.zip > Micron_Config.c


 
#include  
 
#include  
#include  
void MI350_init(void); 
int byte, result = 0; 
extern volatile int SCCB_In_Progress; 
extern volatile int SCCB_DataOut; 
void MI350_init(void) 
{ 
	 
	volatile int i = 0;	 
	 
	 
	I2C_rd(MI350WR, CHIP_VERSION_REG, MI350RD); 
	while(SCCB_In_Progress){}; 
	result = SCCB_DataOut; 
 
I2C_wr(MI350WR, 0x0D, 0x00, 0x30); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x0F, 0x00, 0x11); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x10, 0x00, 0x40); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x15, 0x7F, 0x32); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x1C, 0x00, 0x02); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x20, 0x01, 0xD1); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x2B, 0x00, 0x03); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x32, 0x00, 0x1a); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x70, 0x00, 0x04); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0xAF, 0x00, 0x03); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x73, 0x02, 0xF7); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0xC2, 0x00, 0x40); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x31, 0x00, 0x1f); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x33, 0x00, 0x12); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x01, 0x00, 0x01); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x02, 0x00, 0x04); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x03, 0x01, 0xe0); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x04, 0x02, 0x80); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x05, 0x01, 0xB8); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x06, 0x02, 0x08); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0xbd, 0x00, 0x40); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0xa5, 0x00, 0x37); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0xbe, 0x00, 0x3F); 
while(SCCB_In_Progress){}; 
I2C_wr(MI350WR, 0x35, 0x00, 0x03); 
while(SCCB_In_Progress){}; 
 
}