毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 计算机安全 >> 正文

无线胶囊内窥镜系统设计 第14页

更新时间:2014-6-29:  来源:毕业论文

无线胶囊内窥镜系统设计 第14页
typedef struct
{
uint8_t need;
uint8_t addr;
uint8_t data;
} OV_reg_t;
static OV_reg_t ov_reg[]={
{ 0 , 0x00 , 0x00 },
{ 0 , 0x01 , 0x80 },
{ 0 , 0x02 , 0x80 },
{ 0 , 0x03 , 0x00 }, //default : 0x00 ; //V窗口
{ 0 , 0x04 , 0x00 }, //default : 0x00
{ 0 , 0x05 , 0x00 },
{ 0 , 0x06 , 0x00 },
{ 0 , 0x07 , 0x00 },
{ 0 , 0x08 , 0x00 },
{ 0 , 0x09 , 0x01 },
{ 0 , 0x0c , 0x00 }, //?
{ 0 , 0x0d , 0x40 },
{ 0 , 0x0e , 0x04 }, //default : 0x01 ; -0x04 for nothing
{ 0 , 0x0f , 0x62 }, //default : 0x43 ; -0x62 for disable ADBLC//black level calibration
{ 0 , 0x10 , 0x40 },
{ 1 , 0x11 , 0x40 }, //default : 0x00 ; 0x40 for external clock
{ 1 , 0x12 , 0x10 }, //default : 0x00 ; 0x10 for QVGA ;0x08 for QCIF//
{ 1 , 0x13 , 0x8f }, //default : 0x8f ; -0x40 for disable fast agc/aec & step size = aec & agc=1,awb=0,aec=0// -0xce for disable aec
{ 0 , 0x14 , 0x48 }, //default : 0x4a ; ?-0x78 for maxAGC & disable drop frame
{ 0 , 0x15 , 0x40 }, //default : 0x00 ; ?-0x40 for href changes to hsync //更改则不工作
{ 0 , 0x17 , 0x11 }, //default : 0x11 for HStart=140; 0x00 for HSTART = 0 //HStart窗口
{ 0 , 0x18 , 0x39 }, //default : 0x61 for HStop=780; 0x28 for HSTOP = 320 ;0x50 for 640 ;0x39 for HStop=460 for 320//HStop窗口
{ 0 , 0x19 , 0x02 }, //default : 0x02 for VStart=16; 0x00 for VSTART = 0 //VStart窗口
{ 0 , 0x1a , 0x3e }, //default : 0x7a for VStop=976; 0x3c for VSTOP = 240 ;0x1e for 240 ;0x3e for VStop=496 for 240//VStop窗口
{ 1 , 0x1b , 0x01 }, //default : 0x00 ; -0x01 for pixel delay select
{ 0 , 0x1e , 0x30 }, //default : 0x00 ; -0x01 for nothing ; -0x20 for Hmirror -0x30 for HVmirror
{ 0 , 0x20 , 0x80 },
{ 0 , 0x21 , 0x80 },
{ 0 , 0x22 , 0x80 },
{ 0 , 0x23 , 0x80 },
{ 0 , 0x24 , 0x78 },
{ 0 , 0x25 , 0x68 },
{ 0 , 0x26 , 0xd4 },
{ 0 , 0x27 , 0x80 },
{ 0 , 0x28 , 0x80 },
{ 0 , 0x29 , 0x20 }, //RSVD for nothing
{ 0 , 0x2a , 0x00 },
{ 0 , 0x2b , 0x00 },
{ 0 , 0x2c , 0x80 },
{ 0 , 0x2d , 0x00 },
{ 0 , 0x2e , 0x00 },
{ 0 , 0x2f , 0x00 },
{ 0 , 0x30 , 0x08 },
{ 0 , 0x31 , 0x30 },
{ 0 , 0x32 , 0xa4 }, //default : 0xa4=0b10 100 100 ; 0b 10 000 000 for 640//H窗口
{ 0 , 0x33 , 0x00 }, //CHLF for noting
{ 0 , 0x34 , 0x07 }, //default : 0x03 ; 0x07 for nothing
{ 0 , 0x35 , 0x84 }, //RSVD for nothing
{ 0 , 0x36 , 0x00 }, //RSVD for nothing
{ 0 , 0x37 , 0x04 },
{ 0 , 0x38 , 0x13 }, //default : 0x12 ; -0x13 for nothing
{ 0 , 0x39 , 0x43 }, //default : 0x00 ; ?-0x43 for line buffer power down(set to 1 before chip power down) //影响亮度
{ 0 , 0x3a , 0x0c }, //default : 0x0c ; -0x04 for YVYU //应该是0x0c for UYVY
{ 1 , 0x3b , 0xa0 }, //default : 0x00 ; 0xa0 for night mode //有效果
{ 0 , 0x3c , 0x68 }, //default : 0x40 ; -0x68 for nothing
{ 0 , 0x3d , 0x19 }, //default : 0x99 ; -0x19 for disallow gamma-signal //影响不大
{ 0 , 0x3e , 0x0e },
{ 0 , 0x3f , 0x88 },
{ 0 , 0x40 , 0xc1 }, //default : 0xc0 ; -0xc1 for nothing
{ 0 , 0x41 , 0x10 },
{ 0 , 0x42 , 0x08 },
{ 0 , 0x4f , 0x58 },
{ 0 , 0x50 , 0x48 },
{ 0 , 0x51 , 0x10 },
{ 0 , 0x52 , 0x28 },
{ 0 , 0x53 , 0x48 },
{ 0 , 0x54 , 0x70 },
{ 0 , 0x55 , 0x40 },
{ 0 , 0x56 , 0x40 },
{ 0 , 0x57 , 0x40 },
{ 0 , 0x58 , 0x0f },
{ 0 , 0x62 , 0x80 }, //default : 0x00 ; -lens1 = 0x80
{ 0 , 0x63 , 0x80 }, //default : 0x00 ; -lens2 = 0x80
{ 0 , 0x64 , 0x09 }, //default : 0x10 ; -lens3 = 0x09
{ 0 , 0x65 , 0x80 }, //default : 0x80 ; -lens4 = 0x10
{ 0 , 0x66 , 0x01 }, //default : 0x00 ; -0x01 for lens correction enable
{ 0 , 0x67 , 0x80 },
{ 0 , 0x68 , 0x80 },
{ 0 , 0x69 , 0x80 }, //default : 0x00 ; -0x80 for B channel pre-gain
{ 0 , 0x6b , 0x0a }, //default : 0x3a ; -0x0a for notihing
{ 0 , 0x92 , 0x00 },
{ 0 , 0x93 , 0x00 },
{ 0 , 0x9d , 0x99 },
{ 0 , 0x9e , 0x7f },
{ 0 , 0xa0 , 0x00 },
{ 0xff , 0 , 0x00 }

};
//(140,16,640,480) is good for VGA
//(272,16,320,240) is good for QVGA

void OV7660_config_window(uint16_t startx,uint16_t starty,uint16_t width, uint16_t height)
{
uint16_t endx=(startx+width);
uint16_t endy=(starty+height*2);// "v*2"必须
uint8_t temp_reg1, temp_reg2;
uint8_t state,temp;

state = TWI_poll( TWI_CHIP_OV7660|TWI_READ, 0x03, &temp_reg1 );
temp_reg1 &= 0xC0;
state = TWI_poll( TWI_CHIP_OV7660|TWI_READ, 0x32, &temp_reg2 );
temp_reg2 &= 0xC0;

// Horizontal
temp = 0x80|((endx&0x7)<<3)|(startx&0x7);
state = TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x32, &temp );
temp = (startx&0x7F8)>>3;
state = TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x17, &temp );
temp = (endx&0x7F8)>>3;
state = TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x18, &temp );
// Vertical
temp = temp_reg1|((endy&0x7)<<3)|(starty&0x7);
state = TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x03, &temp );
temp = (starty&0x7F8)>>3;
state = TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x19, &temp );
temp = (endy&0x7F8)>>3;
state = TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x1A, &temp );
} /* config_OV7660_window */

uint8_t OV7660_init(void)
{
uint8_t temp;
uint8_t i;

uint8_t ovidmsb;
uint8_t ovidlsb;

temp=0x80;
TWI_poll( TWI_CHIP_OV7660|TWI_WRITE, 0x12, &temp); //Reset SCCB
my_delay_ms(100);

TWI_poll( TWI_CHIP_OV7660|TWI_READ, 0x0a, &ovidmsb );
if(ovidmsb !=0x76)
   return ovidmsb;
TWI_poll( TWI_CHIP_OV7660|TWI_READ, 0x0b, &ovidlsb );
if(ovidlsb !=0x60)
   return ovidlsb;
 

 << 上一页  [11] [12] [13] [14] [15] [16] 下一页

无线胶囊内窥镜系统设计 第14页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。