📄 sam2m.c
字号:
#include "ssd192X.h"#include "i2c.h"#include "sam2m.h"//#if (S5K3BA_MODE==OV9640_QVGA)int CAM_WIDTH=320;int CAM_HEIGHT=240;//#else//int CAM_WIDTH=1600;//int CAM_HEIGHT=1200;//#endifint CAM_FRAME_RATE=15;void cam_hw_init(void){ I2C i2c; SSD_REGWB(REG_VCLK_CONFIG_0,0x02); // Cam running rate SSD_REGWB(REG_VCLK_CONFIG_1,0x07); // Reset HV7131 SSD_REGWB(REG_DV_ENB,0x03); // ENB_DV = 1)= RESET_DV = 1mdelay(500); SSD_REGWB(REG_DV_ENB,0x02); // ENB_DV = 1)= RESET_DV = 0mdelay(500); SSD_REGWB(REG_DV_ENB,0x03); // ENB_DV = 1)= RESET_DV = 1mdelay(500); i2c.deviceID=I2C_DEVICE_ID; i2c.bitRate=1; ssd192X_i2c_init(&i2c); //Mode ssd192X_i2c_writeb(&i2c, 0xfc, 0x0);mdelay(100); ssd192X_i2c_writeb(&i2c, 0x72, 0x87);mdelay(100); ssd192X_i2c_writeb(&i2c, 0xfc, 0x1);mdelay(100); ssd192X_i2c_writeb(&i2c, 0x2, 0x5);mdelay(100); ssd192X_i2c_writeb(&i2c, 0xfc, 0x0);mdelay(100); ssd192X_i2c_writeb(&i2c, 0x2, 0x3);mdelay(100);// ssd192X_i2c_writeb(&i2c, 0xfc, 0x1);// printk("read i2c value: %d\n",ssd192X_i2c_readb(&i2c,0x2,0xff)); //Set YUV format// ssd192X_i2c_writeb(&i2c, 0x3a, 0x08);}void cam_hw_still(void){#if 0 I2C i2c; i2c.deviceID=I2C_DEVICE_ID; i2c.bitRate=1; ssd192X_i2c_init(&i2c); ssd192X_i2c_writew(&i2c, 0x0e, CAM_WIDTH); ssd192X_i2c_writew(&i2c, 0x0c, CAM_HEIGHT); //set window start position and size ssd192X_i2c_writew(&i2c, 0x08, 240); ssd192X_i2c_writew(&i2c, 0x0a, 180);#endif // bt656 / field stuff select SSD_REGWB(REG_DV_TV_0,0x12); SSD_REGWB(REG_DV_TV_1,0x00); SSD_REGWB(REG_DV_TV_2,0x04); SSD_REGWW(REG_DV_NFRAME_POS_0, 0x0002); SSD_REGWW(REG_DV_HORI_PERIOD_0, CAM_WIDTH); SSD_REGWB(REG_DV_FRAME_PULSE_WIDTH, 0x08);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -