i2c.c

来自「TI 无线传输芯片CC1100用 TMS320C5509 驱动的发送程序」· C语言 代码 · 共 33 行

C
33
字号
#include <csl_i2c.h>

I2C_Config Config_I2C = {
	0,                     /* 7 bit address mode */
	0x0000,                /* own address - don't care if master */
	144,                   /* clkout value (Mhz)  */
	400,                   /* transfer rate 400kbps*/
	0,                     /* 8bit/Byte */
	0,                     /* DLB mode off */
	1                      /* FREE mode of on */
};

/*Initialize array for OV7620*/
Uint16 common_control_a[2] = {0x12,0x24};       /*enable AGC, select YCrCb as video data output,enable auto white balance,use standard black level compensation to do A/D BLC field method*/                
Uint16 common_control_b[2] = {0x13,0x11};       /*16bit format,CCIR656 format, enable auto adjust mode*/
Uint16 common_control_h[2] = {0x28,0x20};       /*select progressive mode*/




void initI2C(void)
{
  I2C_config(&Config_I2C); 

  /*Configure the registers of OV7620*/
  I2C_write(common_control_a,2,1,0x42,1,30000);            /*configure common_control_a register, data length is 2, master mode, slaveaddress is 0x1A, tansfermode is S-A-D-P, timeout value is 30000*/
  I2C_write(common_control_b,2,1,0x42,1,30000);
  I2C_write(common_control_h,2,1,0x42,1,30000);
  
 
   
}

⌨️ 快捷键说明

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