示例#1
0
int cmos_siv120b_identify(void)
{
   	char data=0x0, data1 = 0x0;

       wmt_vid_i2c_write(CMOS_SIV120B_I2C_ADDR,0x0,0x0 );
	data = wmt_vid_i2c_read(CMOS_SIV120B_I2C_ADDR, 0x1) ;
	data1 = wmt_vid_i2c_read(CMOS_SIV120B_I2C_ADDR, 0x2) ;
	printk("SIV120 data 0x%02x  data1 0x%02x \n",data, data1);
	if ((data==0x12) && (data1==0x11)){
		printk(" find SIV120B\n");
		return 0;
	}

	return -1;
}
示例#2
0
int cmos_ov7675_identify(void)
{
	char data=0x0;
	data = wmt_vid_i2c_read(CMOS_OV7675_I2C_ADDR ,0xa) ;
	if (data==0x76){
		printk("find cmos device OV7675\n");
		return 0;
	}
	return -1;
}
示例#3
0
int cmos_gc0308_identify(void)
{
	char data=0x0;
	data = wmt_vid_i2c_read(CMOS_GC0308_I2C_ADDR,0) ;
	if(data ==0x9b)
	{
		printk("find cmos device gc0308\n");
		return 0;
	}

	return -1;
}
示例#4
0
int cmos_init_gc0308(int width, int height,  int cmos_v_flip, int cmos_h_flip)
{
	unsigned char *array_addr,addr,data;
	unsigned int array_size,i;
	array_size=sizeof(gc0308);
	array_addr=gc0308;
       printk("cmos_init_gc0308 %d %d \n", width, height);
	for(i=0;i<array_size;i+=2)
	{
        addr = array_addr[i];
        data = array_addr[i+1];
		wmt_vid_i2c_write(CMOS_GC0308_I2C_ADDR,addr,data);
	}

	if((width == 320) && ( height == 240))
	{
		printk("init gc0308_320_240 \n");
		array_size=sizeof(gc0308_320_240);
		array_addr=gc0308_320_240;

		for(i=0;i<array_size;i+=2)
		{
	          addr = array_addr[i];
	          data = array_addr[i+1];
		    wmt_vid_i2c_write(CMOS_GC0308_I2C_ADDR,addr,data);
		}
	}

	//set the blanking to default , fps will be 25 
      	wmt_vid_i2c_write(CMOS_GC0308_I2C_ADDR, 0x1, 0x6a);
      	wmt_vid_i2c_write(CMOS_GC0308_I2C_ADDR, 0x2, 0x70);
      	wmt_vid_i2c_write(CMOS_GC0308_I2C_ADDR, 0xf, 0x0);
  
	data = wmt_vid_i2c_read(CMOS_GC0308_I2C_ADDR,0x14) ;
	data &= 0xfc;
	
	data |= 0x10;
	if (cmos_v_flip)
		data |= 0x2;
	
	if (cmos_h_flip)
		data |= 0x1;
	
      wmt_vid_i2c_write( CMOS_GC0308_I2C_ADDR, 0x14, data);
      return 0;
}