⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spca501_init.h

📁 LINUX下的万能摄象头驱动
💻 H
📖 第 1 页 / 共 4 页
字号:
/*  * SPCA501 chip based cameras initialization data * */#ifndef SPCA501_INIT_H#define SPCA501_INIT_H/* * Data to initialize a SPCA501. From a capture file provided by Bill Roehl * With SPCA501 chip description */#define CCDSP_SET		// set CCDSP parameters#define TG_SET			// set time generator set#undef DSPWIN_SET		// set DSP windows parameters#undef ALTER_GAMA		// Set alternate set to YUV transform coeffs.#define SPCA501_SNAPBIT 0x80#define SPCA501_SNAPCTRL 0x10/* Frame packet header offsets for the spca501 */#define SPCA501_OFFSET_GPIO   1#define SPCA501_OFFSET_TYPE   2#define SPCA501_OFFSET_TURN3A 3#define SPCA501_OFFSET_FRAMSEQ 4#define SPCA501_OFFSET_COMPRESS 5#define SPCA501_OFFSET_QUANT 6#define SPCA501_OFFSET_QUANT2 7#define SPCA501_OFFSET_DATA 8#define SPCA501_PROP_COMP_ENABLE(d) ( (d) & 1 )#define SPCA501_PROP_SNAP(d) ( (d) & 0x40 )#define SPCA501_PROP_SNAP_CTRL(d) ( (d) & 0x10)#define SPCA501_PROP_COMP_THRESH(d) ( ((d) & 0xE ) >> 1)#define SPCA501_PROP_COMP_QUANT(d) ( ((d) & 0x70 ) >> 4)/* SPCA501 CCDSP control */#define SPCA501_REG_CCDSP 0x1/* SPCA501 control/status registers */#define SPCA501_REG_CTLRL 0x2//registers for color correction and YUV transformation#define SPCA501_A11 0x08#define SPCA501_A12 0x09#define SPCA501_A13 0x0A#define SPCA501_A21 0x0B#define SPCA501_A22 0x0C#define SPCA501_A23 0x0D#define SPCA501_A31 0x0E#define SPCA501_A32 0x0F#define SPCA501_A33 0x10/* Data for video camera initialization before capturing */static __u16 spca501_open_data[][3] = {    /* bmRequest,value,index */    {0x2, 0x50, 0x0},		//C/S enable soft reset    {0x2, 0x40, 0x0},		//C/S disable soft reset    {0x2, 0x02, 0x5},		//C/S general purpose I/O data    {0x2, 0x03, 0x5},		//C/S general purpose I/O data#ifdef CCDSP_SET    {0x1, 0x38, 0x1},		// CCDSP options    {0x1, 0x05, 0x2},		// CCDSP Optical black level for user settings    {0x1, 0xC0, 0x3},		// CCDSP Optical black settings    {0x1, 0x67, 0x7},    {0x1, 0x63, 0x3f},		// CCDSP CCD gamma enable    {0x1, 0x03, 0x56},		// Add gamma correction    {0x1, 0xFF, 0x15},		//CCDSP High luminance for white balance    {0x1, 0x01, 0x16},		//CCDSP Low luminance for white balance    /* Color correction and RGB-to-YUV transformation coefficients changing */#ifdef ALTER_GAMA    {0x0, 0x00, 0x08},		//A11    {0x0, 0x00, 0x09},		//A12    {0x0, 0x90, 0x0A},		//A13    {0x0, 0x12, 0x0B},		//A21    {0x0, 0x00, 0x0C},		//A22    {0x0, 0x00, 0x0D},		//A23    {0x0, 0x00, 0x0E},		//A31    {0x0, 0x02, 0x0F},		//A32    {0x0, 0x00, 0x10},		//A33#else    {0x1, 0x31, 0x08},		//A11    {0x1, 0x00, 0x09},		//A12    {0x1, 0x00, 0x0A},		//A13    {0x1, 0x00, 0x0B},		//A21    {0x1, 0x14, 0x0C},		//A22    {0x1, 0x00, 0x0D},		//A23    {0x1, 0x00, 0x0E},		//A31    {0x1, 0x00, 0x0F},		//A32    {0x1, 0x1E, 0x10},		//A33#endif    {0x1, 0x00, 0x11},		// R offset    {0x1, 0x00, 0x12},		// G offset    {0x1, 0x00, 0x13},		// B offset    {0x1, 0x00, 0x14},		// GB offset#endif#ifdef TG_SET    /* Time generator manipulations */    {0x0, 0xfc, 0x0},		// Set up high bits of shutter speed    {0x0, 0x01, 0x1},		// Set up low bits of shutter speed    {0x0, 0xe4, 0x04},		// DCLK*2 clock phase adjustment    {0x0, 0x08, 0x05},		// ADCK phase adjustment, inv. ext. VB    {0x0, 0x03, 0x06},		// FR phase adjustment    {0x0, 0x01, 0x07},		// FCDS phase adjustment    {0x0, 0x39, 0x08},		// FS phase adjustment    {0x0, 0x88, 0x0a},		// FH1 phase and delay adjustment    {0x0, 0x03, 0x0f},		// pixel identification    {0x0, 0x00, 0x11},		// clock source selection (default)    /*VERY strange manipulations with      * select DMCLP or OBPX to be ADCLP output (0x0C)     * OPB always toggle or not (0x0D) but they allow     * us to set up brightness     */    {0x0, 0x01, 0x0c},    {0x0, 0xe0, 0x0d},    /* Done */#endif#ifdef DSPWIN_SET    {0x1, 0xa0, 0x01},		//Setting image processing parameters    {0x1, 0x1c, 0x17},		//Changing Windows positions X1    {0x1, 0xe2, 0x19},		//X2    {0x1, 0x1c, 0x1b},		//X3    {0x1, 0xe2, 0x1d},		//X4    {0x1, 0x5f, 0x1f},		//X5    {0x1, 0x32, 0x20},		//Y5    {0x1, 0x01, 0x10},		//Changing A33#endif    {0x2, 0x204a, 0x07},	//Setting video compression & resolution 160x120    {0x2, 0x94, 0x06},		//Setting video no compression    {0, 0, 0}};/*   The SPCAxxx docs from Sunplus document these values   in tables, one table per register number.  In the data   below, dmRequest is the register number, index is the Addr,   and value is a combination of Bit values.     Bit  Value (hex)   0    01   1    02   2    04   3    08   4    10   5    20   6    40   7    80 *//* Data for chip initialization (set default values) */static __u16 spca501_init_data[][3] = {    /* Set all the values to powerup defaults */    /* bmRequest,value,index */    {0x0, 0xAA, 0x00},    {0x0, 0x02, 0x01},    {0x0, 0x01, 0x02},    {0x0, 0x02, 0x03},    {0x0, 0xCE, 0x04},    {0x0, 0x00, 0x05},    {0x0, 0x00, 0x06},    {0x0, 0x00, 0x07},    {0x0, 0x00, 0x08},    {0x0, 0x00, 0x09},    {0x0, 0x90, 0x0A},    {0x0, 0x12, 0x0B},    {0x0, 0x00, 0x0C},    {0x0, 0x00, 0x0D},    {0x0, 0x00, 0x0E},    {0x0, 0x02, 0x0F},    {0x0, 0x00, 0x10},    {0x0, 0x00, 0x11},    {0x0, 0x00, 0x12},    {0x0, 0x00, 0x13},    {0x0, 0x00, 0x14},    {0x0, 0x00, 0x15},    {0x0, 0x00, 0x16},    {0x0, 0x00, 0x17},    {0x0, 0x00, 0x18},    {0x0, 0x00, 0x19},    {0x0, 0x00, 0x1A},    {0x0, 0x00, 0x1B},    {0x0, 0x00, 0x1C},    {0x0, 0x00, 0x1D},    {0x0, 0x00, 0x1E},    {0x0, 0x00, 0x1F},    {0x0, 0x00, 0x20},    {0x0, 0x00, 0x21},    {0x0, 0x00, 0x22},    {0x0, 0x00, 0x23},    {0x0, 0x00, 0x24},    {0x0, 0x00, 0x25},    {0x0, 0x00, 0x26},    {0x0, 0x00, 0x27},    {0x0, 0x00, 0x28},    {0x0, 0x00, 0x29},    {0x0, 0x00, 0x2A},    {0x0, 0x00, 0x2B},    {0x0, 0x00, 0x2C},    {0x0, 0x00, 0x2D},    {0x0, 0x00, 0x2E},    {0x0, 0x00, 0x2F},    {0x0, 0x00, 0x30},    {0x0, 0x00, 0x31},    {0x0, 0x00, 0x32},    {0x0, 0x00, 0x33},    {0x0, 0x00, 0x34},    {0x0, 0x00, 0x35},    {0x0, 0x00, 0x36},    {0x0, 0x00, 0x37},    {0x0, 0x00, 0x38},    {0x0, 0x00, 0x39},    {0x0, 0x00, 0x3A},    {0x0, 0x00, 0x3B},    {0x0, 0x00, 0x3C},    {0x0, 0x00, 0x3D},    {0x0, 0x00, 0x3E},    {0x0, 0x00, 0x3F},    {0x0, 0x00, 0x40},    {0x0, 0x00, 0x41},    {0x0, 0x00, 0x42},    {0x0, 0x00, 0x43},    {0x0, 0x00, 0x44},    {0x0, 0x00, 0x45},    {0x0, 0x00, 0x46},    {0x0, 0x00, 0x47},    {0x0, 0x00, 0x48},    {0x0, 0x00, 0x49},    {0x0, 0x00, 0x4A},    {0x0, 0x00, 0x4B},    {0x0, 0x00, 0x4C},    {0x0, 0x00, 0x4D},    {0x0, 0x00, 0x4E},    {0x0, 0x00, 0x4F},    {0x0, 0x00, 0x50},    {0x0, 0x00, 0x51},    {0x0, 0x00, 0x52},    {0x0, 0x00, 0x53},    {0x0, 0x00, 0x54},    {0x0, 0x00, 0x55},    {0x0, 0x00, 0x56},    {0x0, 0x00, 0x57},    {0x0, 0x00, 0x58},    {0x0, 0x00, 0x59},    {0x0, 0x00, 0x5A},    {0x0, 0x00, 0x5B},    {0x0, 0x00, 0x5C},    {0x0, 0x00, 0x5D},    {0x0, 0x00, 0x5E},    {0x0, 0x00, 0x5F},    {0x0, 0x00, 0x60},    {0x0, 0x00, 0x61},    {0x0, 0x00, 0x62},    {0x0, 0x00, 0x63},    {0x0, 0x00, 0x64},    {0x0, 0x00, 0x65},    {0x0, 0x00, 0x66},    {0x0, 0x00, 0x67},    {0x0, 0x00, 0x68},    {0x0, 0x00, 0x69},    {0x0, 0x00, 0x6A},    {0x0, 0x00, 0x6B},    {0x0, 0x00, 0x6C},    {0x0, 0x00, 0x6D},    {0x0, 0x00, 0x6E},    {0x0, 0x00, 0x6F},    {0x0, 0x00, 0x70},    {0x0, 0x00, 0x71},    {0x0, 0x00, 0x72},    {0x0, 0x00, 0x73},    {0x0, 0x00, 0x74},    {0x0, 0x00, 0x75},    {0x0, 0x00, 0x76},    {0x0, 0x00, 0x77},    {0x0, 0x00, 0x78},    {0x0, 0x00, 0x79},    {0x0, 0x00, 0x7A},    {0x0, 0x00, 0x7B},    {0x0, 0x00, 0x7C},    {0x0, 0x00, 0x7D},    {0x0, 0x00, 0x7E},    {0x0, 0x00, 0x7F},    {0x0, 0x00, 0x80},    {0x0, 0x00, 0x81},    {0x0, 0x00, 0x82},    {0x0, 0x00, 0x83},    {0x0, 0x00, 0x84},    {0x0, 0x00, 0x85},    {0x0, 0x00, 0x86},    {0x0, 0x00, 0x87},    {0x0, 0x00, 0x88},    {0x0, 0x00, 0x89},    {0x0, 0x00, 0x8A},    {0x0, 0x00, 0x8B},    {0x0, 0x00, 0x8C},    {0x0, 0x00, 0x8D},    {0x0, 0x00, 0x8E},    {0x0, 0x00, 0x8F},    {0x0, 0x00, 0x90},    {0x0, 0x00, 0x91},    {0x0, 0x00, 0x92},    {0x0, 0x00, 0x93},    {0x0, 0x00, 0x94},    {0x0, 0x00, 0x95},    {0x0, 0x00, 0x96},    {0x0, 0x00, 0x97},    {0x0, 0x00, 0x98},    {0x0, 0x00, 0x99},    {0x0, 0x00, 0x9A},    {0x0, 0x00, 0x9B},    {0x0, 0x00, 0x9C},    {0x0, 0x00, 0x9D},    {0x0, 0x00, 0x9E},    {0x0, 0x00, 0x9F},    {0x0, 0x00, 0xA0},    {0x0, 0x00, 0xA1},    {0x0, 0x00, 0xA2},    {0x0, 0x00, 0xA3},    {0x0, 0x00, 0xA4},    {0x0, 0x00, 0xA5},    {0x0, 0x00, 0xA6},    {0x0, 0x00, 0xA7},    {0x0, 0x00, 0xA8},    {0x0, 0x00, 0xA9},    {0x0, 0x00, 0xAA},    {0x0, 0x00, 0xAB},    {0x0, 0x00, 0xAC},    {0x0, 0x00, 0xAD},    {0x0, 0x00, 0xAE},    {0x0, 0x00, 0xAF},    {0x0, 0x00, 0xB0},    {0x0, 0x00, 0xB1},    {0x0, 0x00, 0xB2},    {0x0, 0x00, 0xB3},    {0x0, 0x00, 0xB4},    {0x0, 0x00, 0xB5},    {0x0, 0x00, 0xB6},    {0x0, 0x00, 0xB7},    {0x0, 0x00, 0xB8},    {0x0, 0x00, 0xB9},    {0x0, 0x00, 0xBA},    {0x0, 0x00, 0xBB},    {0x0, 0x00, 0xBC},    {0x0, 0x00, 0xBD},    {0x0, 0x00, 0xBE},    {0x0, 0x00, 0xBF},    {0x0, 0x00, 0xC0},    {0x0, 0x00, 0xC1},    {0x0, 0x00, 0xC2},    {0x0, 0x00, 0xC3},    {0x0, 0x00, 0xC4},    {0x0, 0x00, 0xC5},    {0x0, 0x00, 0xC6},    {0x0, 0x00, 0xC7},    {0x0, 0x00, 0xC8},    {0x0, 0x00, 0xC9},    {0x0, 0x00, 0xCA},    {0x0, 0x00, 0xCB},    {0x0, 0x00, 0xCC},    {0x1, 0xF4, 0x00},    {0x1, 0x38, 0x01},    {0x1, 0x40, 0x02},    {0x1, 0x0A, 0x03},    {0x1, 0x40, 0x04},    {0x1, 0x40, 0x05},    {0x1, 0x40, 0x06},    {0x1, 0x67, 0x07},    {0x1, 0x31, 0x08},    {0x1, 0x00, 0x09},    {0x1, 0x00, 0x0A},    {0x1, 0x00, 0x0B},    {0x1, 0x14, 0x0C},    {0x1, 0x00, 0x0D},    {0x1, 0x00, 0x0E},    {0x1, 0x00, 0x0F},    {0x1, 0x1E, 0x10},    {0x1, 0x00, 0x11},    {0x1, 0x00, 0x12},    {0x1, 0x00, 0x13},    {0x1, 0x00, 0x14},    {0x1, 0xFF, 0x15},    {0x1, 0x01, 0x16},    {0x1, 0x32, 0x17},    {0x1, 0x23, 0x18},    {0x1, 0xCE, 0x19},    {0x1, 0x23, 0x1A},    {0x1, 0x32, 0x1B},    {0x1, 0x8D, 0x1C},    {0x1, 0xCE, 0x1D},    {0x1, 0x8D, 0x1E},    {0x1, 0x00, 0x1F},    {0x1, 0x00, 0x20},    {0x1, 0xFF, 0x3E},    {0x1, 0x02, 0x3F},    {0x1, 0x00, 0x40},    {0x1, 0x00, 0x41},    {0x1, 0x00, 0x42},    {0x1, 0x00, 0x43},    {0x1, 0x00, 0x44},    {0x1, 0x00, 0x45},    {0x1, 0x00, 0x46},    {0x1, 0x00, 0x47},    {0x1, 0x00, 0x48},    {0x1, 0x00, 0x49},    {0x1, 0x00, 0x4A},    {0x1, 0x00, 0x4B},    {0x1, 0x00, 0x4C},    {0x1, 0x00, 0x4D},    {0x1, 0x00, 0x4E},    {0x1, 0x00, 0x4F},    {0x1, 0x00, 0x50},    {0x1, 0x00, 0x51},    {0x1, 0x00, 0x52},    {0x1, 0x00, 0x53},    {0x1, 0x00, 0x54},    {0x1, 0x00, 0x55},    {0x1, 0x00, 0x56},    {0x1, 0x00, 0x57},    {0x1, 0x00, 0x58},    {0x1, 0x00, 0x59},    {0x1, 0x00, 0x5A},    {0x2, 0x03, 0x00},    {0x2, 0x00, 0x01},    {0x2, 0x00, 0x05},    {0x2, 0x00, 0x06},    {0x2, 0x00, 0x07},    {0x2, 0x00, 0x10},    {0x2, 0x00, 0x11},    /* Strange - looks like the 501 driver doesn't do anything      * at insert time except read the EEPROM      */    {0x0, 0x0, 0x0}};/* Data for video camera init before capture. * Capture and decoding by Colin Peart. * This is is for the 3com HomeConnect Lite which is spca501a based. */static __u16 spca501_3com_open_data[][3] = {    /* bmRequest,value,index */    {0x2, 0x0050, 0x0000},	//C/S Enable TG soft reset, timing mode=010    {0x2, 0x0043, 0x0000},	//C/S Disable TG soft reset, timing mode=010    {0x2, 0x0002, 0x0005},	//C/S GPIO    {0x2, 0x0003, 0x0005},	//C/S GPIO#ifdef CCDSP_SET    {0x1, 0x0020, 0x0001},	//CCDSP Options    {0x1, 0x0020, 0x0002},	//CCDSP Black Level    {0x1, 0x006e, 0x0007},	//CCDSP Gamma options    {0x1, 0x0090, 0x0015},	//CCDSP Luminance Low    {0x1, 0x00ff, 0x0016},	//CCDSP Luminance High    {0x1, 0x0003, 0x003F},	//CCDSP Gamma correction toggle#ifdef ALTER_GAMMA    {0x1, 0x0010, 0x0008},	//CCDSP YUV A11     {0x1, 0x0000, 0x0009},	//CCDSP YUV A12     {0x1, 0x0000, 0x000a},	//CCDSP YUV A13     {0x1, 0x0000, 0x000b},	//CCDSP YUV A21     {0x1, 0x0010, 0x000c},	//CCDSP YUV A22     {0x1, 0x0000, 0x000d},	//CCDSP YUV A23     {0x1, 0x0000, 0x000e},	//CCDSP YUV A31     {0x1, 0x0000, 0x000f},	//CCDSP YUV A32     {0x1, 0x0010, 0x0010},	//CCDSP YUV A33     {0x1, 0x0000, 0x0011},	//CCDSP R Offset    {0x1, 0x0000, 0x0012},	//CCDSP G Offset    {0x1, 0x0001, 0x0013},	//CCDSP B Offset    {0x1, 0x0001, 0x0014},	//CCDSP BG Offset    {0x1, 0x003f, 0x00C1},	//CCDSP Gamma Correction Enable#endif#endif#ifdef TG_SET    {0x0, 0x00fc, 0x0000},	//TG Shutter Speed High Bits

⌨️ 快捷键说明

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