📄 s5x532.h
字号:
#ifndef _S5X532_H_
#define _S5X532_H_
#include "camif.h"
//#undef CIS_S5X532_REV36
//#define CIS_S5X532_REV36 (1)
// const
/*unsigned char S5X3A1_YCbCr8bit[][2] =
{
// page 0
{0xec,0x00},
{0x02,0x00}, //Image format : SXGA
//{0x72,0xd2}, //main clock = 27MHz:0x00, 24MHz:0xd2, ...
{0x72,0x00}, //main clock = 27MHz:0x00, 24MHz:0xd2, ...
//{0x75,0x02}, // Mirror
{0x75,0x02}, // Mirror
{0xec,0x01},
{0x97,0xa0}, // AE window Start point
{0x9a,0xb0}, // AE window End point
{0xec,0x00},
{0x34,0x0e}, // AWB Tracking Boundary Constant R_Limit High#else
{0xec,0x01},
{0x8b,0x23}, //V Output Sync inversion, Full_YC,SCK656_INV_R
{0x6a,0x07}, //Y,Cr first ITU R-60 1format
{0xec,0x02},
{0x05,0x0b},
{0x07,0x0b},
{0x1f,0x13}, //Adjust Global Gain for 20Mhz
{0x26,0x86}, //ADLC Set
{0x30,0x05}, //for reducing noise... switch cap
{0x2d,0x00}, //APS Bias Current 6uA ---> 1uA for SHBN & HN reduce
{0x2f,0x30}, //Ramp Bias Current for SHBN reduce
{0xec,0x03},
{0x06,0x07},
// {0xec,0x04},
// {0x06,0x07},
///////////////////////////
{0xec,0x07},
{0x62,0x00}, // for flicker detection
// gamma : 1.800000
{0xec,0x01},
{0x2E,0x45}, // Y Gamma
{0x2F,0x65},
{0x30,0x95},
{0x31,0xDB},
{0x32,0x42},
{0x33,0xDA},
{0x34,0xB8},
{0x35,0xFF},
{0x36,0x00},
{0x37,0x5B},
{0x55,0x45}, // C Gamma
{0x56,0x65},
{0x57,0x95},
{0x58,0xDB},
{0x59,0x42},
{0x5A,0xDA},
{0x5B,0xB8},
{0x5C,0xFF},
{0x5D,0x00},
{0x5E,0x5B},
/// Color Matrix
{0x17,0xf0},
{0x18,0xa0},
// Color Tunning
//White Point
{0xec,0x00},
{0x40,0x1c}, //s401c
{0x41,0x41}, //s414b
{0x42,0x23}, //s4224
{0x43,0x33}, //s433a
{0x44,0x2e}, //s442f
{0x45,0x25}, //s452b
{0x48,0xc0}, //s48e0 // Hue, Gain control 0726
{0x49,0xfe}, //s49fe
{0x4a,0x3}, //s4a03
{0x4b,0x40}, //s4b50
{0x4c,0xfe}, //s4cfe
{0x4d,0xfe}, //s4df0
{0x4e,0x50}, //s4e50
{0x4f,0x10}, //s4f10
{0x50,0xaa}, //s50c2
{0x51,0xfe}, //s51fe
{0x52,0x28}, //s521a
{0x53,0x40}, //s534a
{0x54,0xfe}, //s54fe
{0x55,0xfc}, //s55fc
{0x56,0x6a}, //s5670
{0x57,0x1a}, //s5730
{0x58,0xaa}, //s58e0
{0x59,0xfe}, //s59f0
{0x5a,0x35}, //s5a10
{0x5b,0x40}, //s5b40
{0x5c,0xfe}, //s5cfe
{0x5d,0xfe}, //s5dfe
{0x5e,0x7e}, //s5e7e
{0x5f,0x3a}, //s5f3a
{0x6c,0x10}, // AE Target
{0x77,0xea}, // Color Gain
/////////////////////////////
// Shading
{0xec,0x05},
{0x00,0x0f}, // Shading Old(Y shading) & Shading New(RGB Shading)
///RGB Shading
{0x05,0x05}, // R Shading of RGB Shading
{0x06,0x05},
{0x07,0x05},
{0x08,0x05},
{0x09,0x00}, // GR Shading of RGB Shading
{0x0a,0x00},
{0x0b,0x00},
{0x0c,0x00},
{0x0d,0x00}, // GB Shading of RGB Shading
{0x0e,0x00},
{0x0f,0x00},
{0x10,0x00},
{0x11,0x00}, // B Shading of RGB Shading
{0x12,0x00},
{0x13,0x00},
{0x14,0x00},
/// Y Shading
{0x2d,0xe0},
{0x2e,0xc0},
{0x2f,0xa0},
{0x30,0x80},
{0x31,0x80},
{0x32,0xa0},
{0x33,0xc0},
{0x34,0xe0},
{0x35,0xe0},
{0x36,0xa6},
{0x37,0x90},
{0x38,0x80},
{0x39,0x80},
{0x3a,0x90},
{0x3b,0xa6},
{0x3c,0xe0},
/////////////////////////////
{0xec,0x07},
{0x11,0xfe}, // GGain_Offset
{0x17,0x42}, // modify AWB Ggain to make <1.46> =0x40(x1)
// to dectect 50Hz flicker in 25Mhz 7.5fps
{0x60,0x10}, // adjust flicker thres
{0x62,0x11}, // adjust edge detection boundary
{0x63,0x04},
{0x70,0x80}, // BLC Off
{0xec,0x01},
{0x1c,0xd0}, // Highlight Suppress Reference
{0x41,0xfe}, // Black Balance Blue
{0x42,0xfa}, // Black Balance Green
{0xaa,0xe0}, // For AWB, High Threshold Value of Y signal
{0xab,0x30}, // For AWB, Low Threshold Value of Y signal
/// Pixel Filter
{0xac,0x80}, // AWB B-G Low Threshold
{0xad,0x80}, // AWB B-G High Threshold
{0xae,0x80}, // AWB R-G Low Threshold
{0xaf,0x80}, // AWB R-G Low Threshold
{0xb0,0x60}, // AWB R-G,B-G High Threshold
{0xb1,0x80}, // AWB R-G,B-G Low Threshold
{0xa0,0x10}, // AWB Window Horizontal Start Point
{0xec,0x07}, // AE weight
{0x80,0x40},
{0x81,0x10},
{0x82,0x10},
{0x83,0x10},
{0x84,0x30},
{0xec,0x01},
{0x97,0xa0}, // AE window Start point
{0x9a,0xb0}, // AE window End point
{0xec,0x00},
{0x34,0x0e}, // AWB Tracking Boundary Constant R_Limit High
///////////////////////////////
// control hsync hblank
// to reduce broken pixel width
{0xec,0x01},
{0x78,0x3b}, // HBLK START
{0x82,0x3b}, // HS656 START
{0xec,0x04},
{0x0e,0x3b},
{0x18,0x3b},
{0xec,0x03},
{0x0e,0x3b},
{0x18,0x3b},
////////////////////////////
// for Demo
// reduce Total Gain
{0xec,0x00},
{0x78,0x60}, //Analog x4, Digital x1
{0x2d,0x5a}, //FrameAE start
{0x0c,0x50}, //CBPRM Start Position
{0x86,0x58}, //DBPRM AGC Min
{0x0d,0x24}, //CBPR Auto
{0x7e,0x0c}, //Color Suppress & DBPRM
{0x82,0x5A}, //Color Suppress AGC Min
{0xec,0x07},
{0x1c,0x58}, //CBPR AGC Min
{0x1e,0x60}, //CBPR AGC Max
{0x22,0x60}, //DBPR AGC Max
////////////////////////////
// improve AE speed
{0xec,0x00},
{0x1e,0x20}, //for Haunting
{0x92,0x80}, //AE ratio high
{0xec,0x07},
{0x10,0x30}, // AGC predict ON
};
*/
/*const*/ unsigned char S5X3A1_YCbCr8bit[][2] =
{
// page 0
{0xec,0x00},
{0x72,0xd2}, //main clock = 27MHz:0x00, 24MHz:0xd2, ...
// {0x72,0x00},
// page 1
{0xec,0x01},
{0x0b,0x10}, // href type
{0x5c,0x01}, // href type
{0x5d,0x00}, // href type
{0x5e,0x01}, // href type
{0x5f,0x04}, // href type
// page 0
{0xec,0x00},
{0x75,0x05} // mirror hori
};
//const
unsigned char S5X532_YCbCr8bit_TV[][2] =
{
//#if (CIS_TYPE == CIS_S5X532)
#if (CIS_TYPE == CIS_S5X3AA)
// page 5
{0xec,0x05},
{0x08,0x55},
{0x0a,0x75},
{0x0c,0x90},
{0x0e,0x18},
{0x12,0x09},
{0x14,0x9d},
{0x16,0x90},
{0x1a,0x18},
{0x1c,0x0c},
{0x1e,0x09},
{0x20,0x06},
{0x22,0x20},
{0x2a,0x00},
{0x2d,0x04},
{0x12,0x24},
// page 3
{0xec,0x03},
{0x0c,0x09},
{0x6c,0x09},
{0x2b,0x10}, // momo clock inversion
// page 2
{0xec,0x02},
{0x03,0x09},
{0x05,0x08},
{0x06,0x01},
{0x07,0xf8},
{0x15,0x25},
{0x30,0x29},
{0x36,0x12},
{0x38,0x04},
{0x1b,0x77}, // 24MHz : 0x77, 12MHz : 0x22
{0x1c,0x77}, // 24MHz : 0x77, 12MHz : 0x22
// page 1
{0xec,0x01},
{0x00,0x03}, //
{0x0a,0x08}, // 0x0-QQVGA, 0x06-CIF, 0x02-QCIF, 0x08-VGA, 0x04-QVGA, 0x0a-SXGA
{0x0c,0x00}, // Pattern selectio. 0-CIS, 1-Color bar, 2-Ramp, 3-Blue screen
//{0x10,0x27}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
{0x10,0x21}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
{0x50,0x21}, // Hblank
{0x51,0x00}, // Hblank
{0x52,0xA1}, // Hblank
{0x53,0x02}, // Hblank
{0x54,0x01}, // Vblank
{0x55,0x00}, // Vblank
{0x56,0xE1}, // Vblank
{0x57,0x01}, // Vblank
{0x58,0x21}, // Hsync
{0x59,0x00}, // Hsync
{0x5a,0xA1}, // Hsync
{0x5b,0x02}, // Hsync
{0x5c,0x03}, // Vref
{0x5d,0x00}, // Vref
{0x5e,0x05}, // Vref
{0x5f,0x00}, // Vref
{0x70,0x0E},
{0x71,0xD6},
{0x72,0x30},
{0x73,0xDB},
{0x74,0x0E},
{0x75,0xD6},
{0x76,0x18},
{0x77,0xF5},
{0x78,0x0E},
{0x79,0xD6},
{0x7a,0x28},
{0x7b,0xE6},
{0x50,0x00},
{0x5c,0x00},
// page 0
{0xec,0x00},
{0x79,0x01},
{0x58,0x90},
{0x59,0xA0},
{0x5a,0x50},
{0x5b,0x70},
{0x5c,0xD0},
{0x5d,0xC0},
{0x5e,0x28},
{0x5f,0x08},
{0x50,0x90},
{0x51,0xA0},
{0x52,0x50},
{0x53,0x70},
{0x54,0xD0},
{0x55,0xC0},
{0x56,0x28},
{0x57,0x00},
{0x48,0x90},
{0x49,0xA0},
{0x4a,0x50},
{0x4b,0x70},
{0x4c,0xD0},
{0x4d,0xC0},
{0x4e,0x28},
{0x4f,0x08},
{0x72,0x82}, // main clock = 24MHz:0xd2, 16M:0x82, 12M:0x54
{0x75,0x05} // absolute vertical mirror. junon
#endif
#if (CIS_TYPE == CIS_S5X532_Rev36)
{0xec,0x00},
{0x02,0x00},
{0x14,0x60},
{0x15,0x60},
{0x16,0x60},
{0x1b,0x20},
{0x1c,0x20},
{0x1d,0x20},
{0x1e,0x20},
{0x72,0xde},
{0x73,0x00}, //11
{0x76,0x84}, //82
{0x77,0x90},
{0x78,0x6c},
{0x0a,0x02},
{0x34,0x0d},
{0x35,0x0a},
{0x36,0x05},
{0x37,0x05},
{0x38,0x06},
{0x39,0x08},
{0x3A,0x0d},
{0x3B,0x0d},
{0x3C,0x18},
{0x3D,0xE0},
{0x3E,0x20},
{0x66,0x02},
{0x6c,0x40},
{0x7c,0x01},
{0x0D,0x24},
{0x40,0x1B},
{0x41,0x4F},
{0x42,0x24},
{0x43,0x3E},
{0x44,0x32},
{0x45,0x30},
{0x48,0xa0},
{0x49,0xd0},
{0x4A,0x28},
{0x4B,0x7d},
{0x4C,0xd0},
{0x4D,0xe0},
{0x4E,0x1a},
{0x4F,0xa0},
{0x50,0xc0},
{0x51,0xc0},
{0x52,0x42},
{0x53,0x7e},
{0x54,0xc0},
{0x55,0xf0},
{0x56,0x1e},
{0x57,0xe0},
{0x58,0xc0},
{0x59,0xa0},
{0x5A,0x4a},
{0x5B,0x7e},
{0x5C,0xc0},
{0x5D,0xf0},
{0x5E,0x2a},
{0x5F,0x10},
{0x79,0x00},
{0x7a,0x00},
{0xe0,0x0f},
{0xe3,0x14},
{0xe5,0x48},
{0xe7,0x58},
//=============== page1 ===============//
{0xec,0x01},
{0x10,0x05},
{0x20,0xde},
{0x0b,0x06},
{0x30,0x00},
{0x31,0x00},
{0x32,0x00},
{0x24,0x28},
{0x25,0x3F},
{0x26,0x65},
{0x27,0xA1},
{0x28,0xFF},
{0x29,0x96},
{0x2A,0x85},
{0x2B,0xFF},
{0x2C,0x00},
{0x2D,0x1B},
{0xB0,0x28},
{0xB1,0x3F},
{0xB2,0x65},
{0xB3,0xA1},
{0xB4,0xFF},
{0xB5,0x96},
{0xB6,0x85},
{0xB7,0xFF},
{0xB8,0x00},
{0xB9,0x1B},
{0x15,0x15},
{0x18,0x85},
{0x1f,0x05},
{0x87,0x40},
{0x37,0x60},
{0x38,0xd5},
{0x48,0xa0},
{0x61,0x54},
{0x62,0x54},
{0x63,0x14},
{0x64,0x14},
{0x6d,0x12},
{0x78,0x09},
{0x79,0xD7},
{0x7A,0x14},
{0x7B,0xEE},
//=============== page2 ===============//
{0xec,0x02},
{0x2c,0x76},
{0x25,0x25},
{0x27,0x27},
{0x30,0x29},
{0x36,0x08},
{0x38,0x04},
//=============== page3 ===============//
{0xec,0x03},
{0x08,0x00},
{0x09,0x33},
//=============== page4 ===============//
{0xec,0x04},
{0x00,0x21},
{0x01,0x00},
{0x02,0x9d},
{0x03,0x02},
{0x04,0x04},
{0x05,0x00},
{0x06,0x1f},
{0x07,0x02},
{0x08,0x21},
{0x09,0x00},
{0x0a,0x9d},
{0x0b,0x02},
{0x0c,0x04},
{0x0d,0x00},
{0x0e,0x20},
{0x0f,0x02},
{0x1b,0x3c},
{0x1c,0x3c},
//=============== page5 ===============//
{0xec,0x05},
{0x1f,0x00},
{0x08,0x59},
{0x0a,0x71},
{0x1e,0x23},
{0x0e,0x3c},
//=============== page7 ===============//
{0xec,0x07},
{0x11,0xfe},
// added by junon
{0xec,0x01},
{0x10,0x26}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
#endif
#if (CIS_TYPE == CIS_S5X3A1)
#if (S5X3A1_CamMode==0)
// page 0
{0xec,0x00},
{0x72,0x00}, //main clock = 27MHz:0x00, 24MHz:0xd2, ...
{0x01,0x00}, //Zoom/Linear
{0x02,0x11}, // VGA
{0x1a,0x10}, // narrow
{0x75,0x01}, // vertical mirror
{0x76,0xc0}, // Brightness
// page 1
{0xec,0x01},
{0x0b,0x10}, // href type
{0x5c,0x01}, // href type
{0x5d,0x00}, // href type
{0x5e,0x01}, // href type
{0x5f,0x04}, // href type
// page 3
// {0xec,0x03},
// {0x2a,0x02},
// {0x2b,0xce},
// page 4
// {0xec,0x04},
// {0x32,0xa8},
// {0x33,0x01},
// {0x36,0x5b},
// {0x37,0x05},
// page 0
{0xec,0x00}
#else
// page 0
{0xec,0x00},
{0x72,0x00}, // main clock = 27MHz:0x00, 24MHz:0xd2, ...
{0x01,0x00}, // Zoom/Linear
{0x1a,0x10}, // narrow
{0x75,0x01}, // vertical mirror
{0x76,0xc0}, // Brightness
// page 1
{0xec,0x01},
{0x0b,0x10}, // href type
{0x5c,0x01}, // href type
{0x5d,0x00}, // href type
{0x5e,0x01}, // href type
{0x5f,0x04}, // href type
// page 0
{0xec,0x00}
#endif
#endif
};
//const
unsigned char S5X3AA_YCbCr8bit[][2] =
{
/*
// page 5
{0xec,0x05},
{0x08,0x55},
{0x0a,0x75},
{0x0c,0x90},
{0x0e,0x18},
{0x12,0x09},
{0x14,0x9d},
{0x16,0x90},
{0x1a,0x18},
{0x1c,0x0c},
{0x1e,0x09},
{0x20,0x06},
{0x22,0x20},
{0x2a,0x00},
{0x2d,0x04},
{0x12,0x24},
// page 3
{0xec,0x03},
{0x0c,0x09},
{0x6c,0x09},
{0x2b,0x10}, // momo clock inversion
// page 2
{0xec,0x02},
{0x03,0x09},
{0x05,0x08},
{0x06,0x01},
{0x07,0xf8},
{0x15,0x25},
{0x30,0x29},
{0x36,0x12},
{0x38,0x04},
{0x1b,0x77}, // 24MHz : 0x77, 12MHz : 0x22
{0x1c,0x77}, // 24MHz : 0x77, 12MHz : 0x22
// page 1
{0xec,0x01},
{0x00,0x03}, //
{0x0a,0x0a}, // 0x0-QQVGA, 0x06-CIF, 0x02-QCIF, 0x08-VGA, 0x04-QVGA, 0x0a-SXGA
{0x0c,0x00}, // Pattern selectio. 0-CIS, 1-Color bar, 2-Ramp, 3-Blue screen
//{0x10,0x27}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
{0x10,0x21}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
{0x50,0x21}, // Hblank
{0x51,0x00}, // Hblank
{0x52,0xA1}, // Hblank
{0x53,0x02}, // Hblank
{0x54,0x01}, // Vblank
{0x55,0x00}, // Vblank
{0x56,0xE1}, // Vblank
{0x57,0x01}, // Vblank
{0x58,0x21}, // Hsync
{0x59,0x00}, // Hsync
{0x5a,0xA1}, // Hsync
{0x5b,0x02}, // Hsync
{0x5c,0x03}, // Vref
{0x5d,0x00}, // Vref
{0x5e,0x05}, // Vref
{0x5f,0x00}, // Vref
{0x70,0x0E},
{0x71,0xD6},
{0x72,0x30},
{0x73,0xDB},
{0x74,0x0E},
{0x75,0xD6},
{0x76,0x18},
{0x77,0xF5},
{0x78,0x0E},
{0x79,0xD6},
{0x7a,0x28},
{0x7b,0xE6},
{0x50,0x00},
{0x5c,0x00},
// page 0
{0xec,0x00},
{0x79,0x01},
{0x58,0x90},
{0x59,0xA0},
{0x5a,0x50},
{0x5b,0x70},
{0x5c,0xD0},
{0x5d,0xC0},
{0x5e,0x28},
{0x5f,0x08},
{0x50,0x90},
{0x51,0xA0},
{0x52,0x50},
{0x53,0x70},
{0x54,0xD0},
{0x55,0xC0},
{0x56,0x28},
{0x57,0x00},
{0x48,0x90},
{0x49,0xA0},
{0x4a,0x50},
{0x4b,0x70},
{0x4c,0xD0},
{0x4d,0xC0},
{0x4e,0x28},
{0x4f,0x08},
//{0x72,0x82}, // main clock = 24MHz:0xd2, 16M:0x82, 12M:0x54
{0x72,0xd2},
*/
{0xec,0x00},
{0x75,0x05} // absolute vertical mirror. junon
};
#endif // _S5X532_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -