micron_config.c

来自「DSP的一个范例」· C语言 代码 · 共 71 行

C
71
字号

#include <sys/exception.h>

#include <I2C.h>
#include <MI350.h>
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){};

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?