Improve HI704, SP0A20, SP0828 sensor drivers (#3)

* add sp0a20 support

* HI704: use validated factory table

Replace the init data with the byte-exact 704-byte FTY/X5/X6 sequence and align the descriptor and formatting with the Taixin sensor drivers.

* SP0A20: use validated factory table

Replace the malformed mixed data with the byte-exact 724-byte HQT6 sequence and align the descriptor and formatting with the Taixin sensor drivers.

* SP0828: use validated factory table

Replace the main init data with the byte-exact 458-byte FTY/X5/X6 24 MHz sequence, retain the existing probe prewrite, and align the driver with Taixin formatting.
This commit is contained in:
divadiow
2026-08-11 00:42:37 +03:00
committed by GitHub
parent c9225190f2
commit 05bd1742cd
3 changed files with 1012 additions and 1107 deletions
+359 -69
View File
@@ -8,94 +8,384 @@
#if DEV_SENSOR_HI704 #if DEV_SENSOR_HI704
SENSOR_INIT_SECTION static const unsigned char HI704InitTable[CMOS_INIT_LEN] = SENSOR_INIT_SECTION static const unsigned char HI704InitTable[CMOS_INIT_LEN]=
{ {
0x03, 0x00, 0x01, 0xf1, 0x01, 0xf3, 0x01, 0xf1, 0x11, 0x90, 0x12, 0x04, 0x03,0x00,
0x20, 0x00, 0x21, 0x04, 0x22, 0x00, 0x23, 0x04, 0x24, 0x01, 0x25, 0xe0, 0x01,0xf1,
0x26, 0x02, 0x27, 0x80, 0x40, 0x01, 0x41, 0x58, 0x42, 0x00, 0x43, 0x13, 0x01,0xf3,
0x80, 0x2e, 0x81, 0x7e, 0x82, 0x90, 0x83, 0x30, 0x84, 0x2c, 0x85, 0x4b, 0x01,0xf1,
0x89, 0x48, 0x90, 0x0a, 0x91, 0x0a, 0x92, 0x48, 0x93, 0x40, 0x98, 0x38, 0x03,0x00,
0x99, 0x40, 0xa0, 0x00, 0xa8, 0x40, 0x03, 0x02, 0x13, 0x40, 0x14, 0x04, 0x10,0x08,
0x1a, 0x00, 0x1b, 0x08, 0x20, 0x33, 0x21, 0xaa, 0x22, 0xa7, 0x23, 0xb1, 0x11,0x90,
0x3b, 0x48, 0x50, 0x21, 0x52, 0xa2, 0x53, 0x0a, 0x54, 0x30, 0x55, 0x10, 0x12,0x04,
0x56, 0x0c, 0x59, 0x0F, 0x60, 0x54, 0x61, 0x5d, 0x62, 0x56, 0x63, 0x5c, 0x20,0x00,
0x64, 0x56, 0x65, 0x5c, 0x72, 0x57, 0x73, 0x5b, 0x74, 0x57, 0x75, 0x5b, 0x21,0x04,
0x80, 0x02, 0x81, 0x46, 0x82, 0x07, 0x83, 0x10, 0x84, 0x07, 0x85, 0x10, 0x22,0x00,
0x92, 0x24, 0x93, 0x30, 0x94, 0x24, 0x95, 0x30, 0xa0, 0x03, 0xa1, 0x45, 0x23,0x04,
0xa4, 0x45, 0xa5, 0x03, 0xa8, 0x12, 0xa9, 0x20, 0xaa, 0x34, 0xab, 0x40, 0x40,0x01,
0xb8, 0x55, 0xb9, 0x59, 0xbc, 0x05, 0xbd, 0x09, 0xc0, 0x5f, 0xc1, 0x67, 0x41,0x58,
0xc2, 0x5f, 0xc3, 0x67, 0xc4, 0x60, 0xc5, 0x66, 0xc6, 0x60, 0xc7, 0x66, 0x42,0x00,
0xc8, 0x61, 0xc9, 0x65, 0xca, 0x61, 0xcb, 0x65, 0xcc, 0x62, 0xcd, 0x64, 0x43,0x64,
0xce, 0x62, 0xcf, 0x64, 0xd0, 0x53, 0xd1, 0x68, 0x03, 0x10, 0x10, 0x03, 0x45,0x01,
0x11, 0x43, 0x12, 0x30, 0x40, 0x80, 0x41, 0x02, 0x48, 0x98, 0x50, 0x48, 0x46,0x08,
0x60, 0x7f, 0x61, 0x00, 0x62, 0xb0, 0x63, 0xa8, 0x64, 0x48, 0x66, 0x90, 0x47,0xf5,
0x67, 0x42, 0x03, 0x11, 0x10, 0x25, 0x11, 0x1f, 0x20, 0x00, 0x21, 0x38, 0x80,0x2e,
0x23, 0x0a, 0x60, 0x10, 0x61, 0x82, 0x62, 0x00, 0x63, 0x83, 0x64, 0x83, 0x81,0x7e,
0x67, 0xF0, 0x68, 0x30, 0x69, 0x10, 0x03, 0x12, 0x40, 0xe9, 0x41, 0x09, 0x82,0x90,
0x50, 0x18, 0x51, 0x24, 0x70, 0x1f, 0x71, 0x00, 0x72, 0x00, 0x73, 0x00, 0x83,0x30,
0x74, 0x10, 0x75, 0x10, 0x76, 0x20, 0x77, 0x80, 0x78, 0x88, 0x79, 0x18, 0x84,0x2c,
0xb0, 0x7d, 0x03, 0x13, 0x10, 0x01, 0x11, 0x89, 0x12, 0x14, 0x13, 0x19, 0x85,0x4b,
0x14, 0x08, 0x20, 0x06, 0x21, 0x03, 0x23, 0x30, 0x24, 0x33, 0x25, 0x08, 0x89,0x48,
0x26, 0x18, 0x27, 0x00, 0x28, 0x08, 0x29, 0x50, 0x2a, 0xe0, 0x2b, 0x10, 0x90,0x0c,
0x2c, 0x28, 0x2d, 0x40, 0x2e, 0x00, 0x2f, 0x00, 0x30, 0x11, 0x80, 0x03, 0x91,0x0c,
0x81, 0x07, 0x90, 0x04, 0x91, 0x02, 0x92, 0x00, 0x93, 0x20, 0x94, 0x42, 0x92,0x48,
0x95, 0x60, 0x03, 0x14, 0x10, 0x01, 0x20, 0x80, 0x21, 0x80, 0x22, 0x78, 0x93,0x40,
0x23, 0x4d, 0x24, 0x46, 0x03, 0x15, 0x10, 0x03, 0x14, 0x3c, 0x16, 0x2c, 0x98,0x38,
0x17, 0x2f, 0x30, 0xc4, 0x31, 0x5b, 0x32, 0x1f, 0x33, 0x2a, 0x34, 0xce, 0x99,0x40,
0x35, 0x24, 0x36, 0x0b, 0x37, 0x3f, 0x38, 0x8a, 0x40, 0x87, 0x41, 0x18, 0xa0,0x00,
0x42, 0x91, 0x43, 0x94, 0x44, 0x9f, 0x45, 0x33, 0x46, 0x00, 0x47, 0x94, 0xa8,0x40,
0x48, 0x14, 0x03, 0x16, 0x30, 0x00, 0x31, 0x1c, 0x32, 0x2d, 0x33, 0x4e, 0x03,0x02,
0x34, 0x6d, 0x35, 0x8b, 0x36, 0xa2, 0x37, 0xb5, 0x38, 0xc4, 0x39, 0xd0, 0x13,0x40,
0x3a, 0xda, 0x3b, 0xea, 0x3c, 0xf4, 0x3d, 0xfb, 0x3e, 0xff, 0x03, 0x17, 0x14,0x04,
0xc4, 0x3c, 0xc5, 0x32, 0x03, 0x20, 0x10, 0x0c, 0x11, 0x04, 0x20, 0x01, 0x1a,0x00,
0x28, 0x27, 0x29, 0xa1, 0x2a, 0xf0, 0x2b, 0x34, 0x2c, 0x2b, 0x30, 0xf8, 0x1b,0x08,
0x39, 0x22, 0x3a, 0xde, 0x3b, 0x22, 0x3c, 0xde, 0x60, 0x95, 0x68, 0x3c, 0x20,0x33,
0x69, 0x64, 0x6A, 0x28, 0x6B, 0xc8, 0x70, 0x42, 0x76, 0x22, 0x77, 0x02, 0x21,0xaa,
0x78, 0x12, 0x79, 0x27, 0x7a, 0x23, 0x7c, 0x1d, 0x7d, 0x22, 0x83, 0x00, 0x22,0xa7,
0x84, 0xbe, 0x85, 0x6e, 0x86, 0x00, 0x87, 0xfa, 0x88, 0x02, 0x89, 0x7a, 0x23,0x32,
0x8a, 0xc4, 0x8b, 0x3f, 0x8c, 0x7a, 0x8d, 0x34, 0x8e, 0xbc, 0x91, 0x02, 0x3b,0x48,
0x92, 0xdc, 0x93, 0x6c, 0x94, 0x01, 0x95, 0xb7, 0x96, 0x74, 0x98, 0x8C, 0x50,0x21,
0x99, 0x23, 0x9c, 0x0b, 0x9d, 0xb8, 0x9e, 0x00, 0x9f, 0xfa, 0xb1, 0x14, 0x52,0xa2,
0xb2, 0x50, 0xb4, 0x14, 0xb5, 0x38, 0xb6, 0x26, 0xb7, 0x20, 0xb8, 0x1d, 0x53,0x0a,
0xb9, 0x1b, 0xba, 0x1a, 0xbb, 0x19, 0xbc, 0x19, 0xbd, 0x18, 0xc0, 0x16, 0x54,0x30,
0xc3, 0x48, 0xc4, 0x48, 0x03, 0x22, 0x10, 0xe2, 0x11, 0x26, 0x21, 0x40, 0x55,0x10,
0x30, 0x80, 0x31, 0x80, 0x38, 0x12, 0x39, 0x33, 0x40, 0xf0, 0x41, 0x33, 0x56,0x0c,
0x42, 0x33, 0x43, 0xf3, 0x44, 0x55, 0x45, 0x44, 0x46, 0x02, 0x80, 0x45, 0x59,0x0f,
0x81, 0x20, 0x82, 0x48, 0x83, 0x52, 0x84, 0x1b, 0x85, 0x50, 0x86, 0x25, 0x60,0xca,
0x87, 0x4d, 0x88, 0x38, 0x89, 0x3e, 0x8a, 0x29, 0x8b, 0x02, 0x8d, 0x22, 0x61,0xdb,
0x8e, 0x71, 0x8f, 0x63, 0x90, 0x60, 0x91, 0x5c, 0x92, 0x56, 0x93, 0x52, 0x62,0xca,
0x94, 0x4c, 0x95, 0x36, 0x96, 0x31, 0x97, 0x2e, 0x98, 0x2a, 0x99, 0x29, 0x63,0xda,
0x9a, 0x26, 0x9b, 0x09, 0x03, 0x22, 0x10, 0xfb, 0x03, 0x20, 0x10, 0x9c, 0x64,0xca,
0x01, 0xf0, 0x03, 0x00, 0x01, 0x90, 0xff, 0xff, 0x65,0xda,
0x72,0xcb,
0x73,0xd8,
0x74,0xcb,
0x75,0xd8,
0x80,0x02,
0x81,0xbd,
0x82,0x24,
0x83,0x3e,
0x84,0x24,
0x85,0x3e,
0x92,0x72,
0x93,0x8c,
0x94,0x72,
0x95,0x8c,
0xa0,0x03,
0xa1,0xbb,
0xa4,0xbb,
0xa5,0x03,
0xa8,0x44,
0xa9,0x6a,
0xaa,0x92,
0xab,0xb7,
0xb8,0xc9,
0xb9,0xd0,
0xbc,0x20,
0xbd,0x28,
0xc0,0xde,
0xc1,0xec,
0xc2,0xde,
0xc3,0xec,
0xc4,0xe0,
0xc5,0xea,
0xc6,0xe0,
0xc7,0xea,
0xc8,0xe1,
0xc9,0xe8,
0xca,0xe1,
0xcb,0xe8,
0xcc,0xe2,
0xcd,0xe7,
0xce,0xe2,
0xcf,0xe7,
0xd0,0xc8,
0xd1,0xef,
0x03,0x10,
0x10,0x03,
0x11,0x43,
0x40,0x80,
0x41,0x00,
0x48,0x90,
0x50,0x48,
0x60,0x7f,
0x61,0x00,
0x62,0x9a,
0x63,0x90,
0x64,0x48,
0x66,0x90,
0x67,0x9e,
0x03,0x11,
0x10,0x25,
0x11,0x1f,
0x20,0x00,
0x21,0x38,
0x23,0x0a,
0x60,0x10,
0x61,0x82,
0x62,0x00,
0x63,0x83,
0x64,0x83,
0x67,0xf0,
0x68,0x30,
0x69,0x10,
0x03,0x12,
0x40,0xe9,
0x41,0x09,
0x50,0x18,
0x51,0x24,
0x70,0x1f,
0x71,0x00,
0x72,0x00,
0x73,0x00,
0x74,0x10,
0x75,0x10,
0x76,0x20,
0x77,0x80,
0x78,0x88,
0x79,0x18,
0xb0,0x7d,
0x03,0x13,
0x10,0x01,
0x11,0x89,
0x12,0x14,
0x13,0x19,
0x14,0x08,
0x20,0x04,
0x21,0x04,
0x23,0x30,
0x24,0x33,
0x25,0x08,
0x26,0x18,
0x27,0x00,
0x28,0x08,
0x29,0x90,
0x2a,0xe0,
0x2b,0x10,
0x2c,0x28,
0x2d,0x40,
0x2e,0x00,
0x2f,0x00,
0x30,0x11,
0x80,0x03,
0x81,0x07,
0x90,0x04,
0x91,0x04,
0x92,0x00,
0x93,0x20,
0x94,0x42,
0x95,0x60,
0x03,0x14,
0x10,0x01,
0x20,0x60,
0x21,0x80,
0x22,0x66,
0x23,0x50,
0x24,0x44,
0x03,0x15,
0x10,0x03,
0x14,0x3c,
0x16,0x2c,
0x17,0x2f,
0x30,0xcb,
0x31,0x61,
0x32,0x16,
0x33,0x23,
0x34,0xce,
0x35,0x2b,
0x36,0x01,
0x37,0x34,
0x38,0x75,
0x40,0x87,
0x41,0x18,
0x42,0x91,
0x43,0x94,
0x44,0x9f,
0x45,0x33,
0x46,0x00,
0x47,0x94,
0x48,0x14,
0x03,0x16,
0x30,0x00,
0x31,0x0a,
0x32,0x1b,
0x33,0x2e,
0x34,0x5c,
0x35,0x79,
0x36,0x97,
0x37,0xa7,
0x38,0xb5,
0x39,0xc3,
0x3a,0xcf,
0x3b,0xe1,
0x3c,0xf2,
0x3d,0xff,
0x3e,0xff,
0x03,0x17,
0xc4,0x3c,
0xc5,0x32,
0x03,0x20,
0x10,0x0c,
0x11,0x04,
0x20,0x01,
0x28,0x27,
0x29,0xa1,
0x2a,0xf0,
0x2b,0x34,
0x2c,0x2b,
0x30,0x78,
0x39,0x22,
0x3a,0xde,
0x3b,0x22,
0x3c,0xde,
0x60,0x95,
0x68,0x3c,
0x69,0x64,
0x6a,0x28,
0x6b,0xc8,
0x70,0x4a,
0x76,0x22,
0x77,0x02,
0x78,0x12,
0x79,0x27,
0x7a,0x23,
0x7c,0x1d,
0x7d,0x22,
0x83,0x00,
0x84,0xaf,
0x85,0xc8,
0x86,0x00,
0x87,0xfa,
0x88,0x02,
0x89,0xbf,
0x8a,0x20,
0x8b,0x3a,
0x8c,0x98,
0x8d,0x30,
0x8e,0xd4,
0x91,0x04,
0x92,0x91,
0x93,0xec,
0x94,0x01,
0x95,0xb7,
0x96,0x74,
0x98,0x8c,
0x99,0x23,
0x9c,0x06,
0x9d,0xd6,
0x9e,0x00,
0x9f,0xfa,
0xb1,0x14,
0xb2,0x50,
0xb4,0x14,
0xb5,0x38,
0xb6,0x26,
0xb7,0x20,
0xb8,0x1d,
0xb9,0x1b,
0xba,0x1a,
0xbb,0x19,
0xbc,0x19,
0xbd,0x18,
0xc0,0x1a,
0xc3,0x48,
0xc4,0x48,
0x03,0x22,
0x10,0xe2,
0x11,0x26,
0x20,0x34,
0x21,0x40,
0x30,0x80,
0x31,0x80,
0x38,0x12,
0x39,0x33,
0x40,0xf0,
0x41,0x55,
0x42,0x33,
0x43,0xf3,
0x44,0x88,
0x45,0x66,
0x46,0x02,
0x03,0x22,
0x10,0x6a,
0x80,0x38,
0x81,0x20,
0x82,0x30,
0x83,0x36,
0x84,0x30,
0x85,0x50,
0x86,0x44,
0x87,0x4d,
0x88,0x38,
0x89,0x3e,
0x8a,0x29,
0x8b,0x02,
0x8d,0x22,
0x8e,0x71,
0x8f,0x63,
0x90,0x60,
0x91,0x5c,
0x92,0x56,
0x93,0x52,
0x94,0x4c,
0x95,0x36,
0x96,0x31,
0x97,0x2e,
0x98,0x2a,
0x99,0x29,
0x9a,0x26,
0x9b,0x09,
0x03,0x22,
0x10,0xfb,
0x03,0x20,
0x10,0x9c,
0x03,0x22,
0x10,0x6a,
0x80,0x48,
0x81,0x20,
0x82,0x40,
0x83,0x58,
0x84,0x10,
0x85,0x70,
0x86,0x10,
0x10,0xea,
0x03,0x00,
0x01,0xf0,
0xff,0xff,
}; };
SENSOR_OP_SECTION const _Sensor_Adpt_ hi704_cmd= SENSOR_OP_SECTION const _Sensor_Adpt_ hi704_cmd=
{ {
.typ = 1, //YUV .typ = 1, //YUV
.pixelw = 640, .pixelw = 640,
.pixelh= 480, .pixelh= 480,
.hsyn = 1, .hsyn = 1,
.vsyn = 0, .vsyn = 1,
.rduline = 0,// .rduline = 0,
.rawwide = 1,//10bit .rawwide = 1,//10bit
.colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_ .colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
.init = (uint8 *)HI704InitTable, .init = (uint8 *)HI704InitTable,
.rotate_adapt = {0}, .rotate_adapt = {0},
.hvb_adapt = {0x80,0x0a,0x80,0x0a}, .hvb_adapt = {0},
. mclk = 24000000, .mclk = 24000000,
.p_fun_adapt = {NULL,NULL,NULL}, .p_fun_adapt = {NULL,NULL,NULL},
.p_xc7016_adapt = {NULL}, .p_xc7016_adapt = {NULL},
}; };
const _Sensor_Ident_ hi704_init = const _Sensor_Ident_ hi704_init=
{ {
/* id , w_cmd, r_cmd, addr_num, data_num, id_reg */ //id, w_cmd, r_cmd, addr_num, data_num, id_reg
0x96,0x60,0x61,0x01,0x01,0x04 0x96,0x60,0x61,0x01,0x01,0x04
}; };
#endif #endif
+229 -254
View File
@@ -1,11 +1,3 @@
// sensor_sp0828.c — SP0828 (SuperPix) camera sensor driver (revised)
/*
* Notes:
* - Platform cam clock is 156 MHz / div. Use div=6 (~26 MHz) for probe/bring-up.
* - I2C 7-bit address: 0x18 => write: 0x30, read: 0x31
* - ID register: 0x02 should read 0x0C on SP0828 in this platform’s reference.
*/
#include "sys_config.h" #include "sys_config.h"
#include "typesdef.h" #include "typesdef.h"
#include "lib/video/dvp/cmos_sensor/csi.h" #include "lib/video/dvp/cmos_sensor/csi.h"
@@ -16,216 +8,213 @@
#if DEV_SENSOR_SP0828 #if DEV_SENSOR_SP0828
// ----------------------------- SENSOR_INIT_SECTION static const unsigned char SP0828InitTable[CMOS_INIT_LEN]=
// Main init table (bring-up) {
// -----------------------------
SENSOR_INIT_SECTION static const unsigned char SP0828InitTable[CMOS_INIT_LEN] = {
0xFD, 0x00,
0x1C, 0x00,
0x30, 0x00,
0x0F, 0x2F,
0x10, 0x2F,
0x12, 0x7F,
//0x13, 0x2F,
//0x15, 0x7F,
//0x16, 0x0F,
0x22, 0xE0,
0x26, 0x08,
0x27, 0xE8,
0x28, 0x0B,
0x32, 0x00,
0xFD, 0x00,
0x31, 0x50,
0xD8, 0x58,
0xD9, 0x58,
0xDA, 0x58,
0xDB, 0x58,
0x36, 0x00,
0x5F, 0x11,
0xE0, 0x00,
0xE1, 0xDC,
0xE2, 0xB0,
0xE3, 0x00,
0xE4, 0x2E,
0xE5, 0x00,
0xE6, 0x2B,
0xB7, 0x3C,
0xB8, 0x50,
0xFD, 0x01,
0x25, 0x1A,
0x26, 0xFB,
0x28, 0x61,
0x29, 0x49,
0x31, 0x64,
0x32, 0x18,
0x4D, 0xDC,
0x4E, 0x53,
0x41, 0x8C,
0x42, 0x57,
0x55, 0xFF,
0x56, 0x00,
0x59, 0x82,
0x5A, 0x00,
0x5D, 0xFF,
0x5E, 0x6F,
0x57, 0xFF,
0x58, 0x00,
0x5B, 0xFF,
0x5C, 0xA8,
0x5F, 0x75,
0x60, 0x00,
0x2D, 0x00,
0x2E, 0x00,
0x2F, 0x00,
0x30, 0x00,
0x33, 0x00,
0x34, 0x00,
0x37, 0x00,
0x38, 0x00,
0x39, 0x01,
0x3A, 0x07,
0xFD, 0x00,
0x33, 0x0F,
0x51, 0x3F,
0x52, 0x09,
0x53, 0x00,
0x54, 0x00,
0x55, 0x10,
0x4F, 0x08,
0x50, 0x08,
0x56, 0x70,
0x57, 0x10,
0x58, 0x10,
0x59, 0x10,
0x5A, 0x02,
0x5B, 0x02,
0x5C, 0x20,
0x65, 0x03,
0x66, 0x01,
0x67, 0x03,
0x68, 0x46,
0x69, 0x7F,
0x6A, 0x01,
0x6B, 0x04,
0x6C, 0x01,
0x6D, 0x03,
0x6E, 0x46,
0x6F, 0x7F,
0x70, 0x01,
0x71, 0x05,
0x72, 0x01,
0x73, 0x03,
0x74, 0x46,
0x75, 0x7F,
0x76, 0x01,
0x7F, 0x96,
0x80, 0x00,
0x81, 0xE0,
0x82, 0xED,
0x83, 0xA6,
0x84, 0xED,
0x85, 0xFA,
0x86, 0xBA,
0x87, 0xCC,
0x88, 0x30,
0x89, 0x33,
0x8A, 0x0F,
0x8B, 0x00,
0x8C, 0x1A,
0x8D, 0x29,
0x8E, 0x41,
0x8F, 0x62,
0x90, 0x7C,
0x91, 0x90,
0x92, 0xA2,
0x93, 0xAF,
0x94, 0xBA,
0x95, 0xC4,
0x96, 0xCE,
0x97, 0xD6,
0x98, 0xDD,
0x99, 0xE4,
0x9A, 0xEA,
0x9B, 0xF1,
0xFD, 0x01,
0x8D, 0xF8,
0x8E, 0xFF,
0xFD, 0x00,
0xCA, 0xCF,
0xCB, 0x07,
0xCC, 0x04,
0xCE, 0xFF,
0xCF, 0x10,
0xD0, 0x20,
0xD1, 0x00,
0xD2, 0x1C,
0xD3, 0x16,
0xD4, 0x00,
0xD6, 0x1C,
0xD7, 0x16,
0xDD, 0x6C,
0xDE, 0xA0,
0xB9, 0x00,
0xBA, 0x04,
0xBB, 0x08,
0xBC, 0x10,
0xBD, 0x20,
0xBE, 0x30,
0xBF, 0x40,
0xC0, 0x50,
0xC1, 0x60,
0xC2, 0x70,
0xC3, 0x80,
0xC4, 0x90,
0xC5, 0xA0,
0xC6, 0xB0,
0xC7, 0xC0,
0xC8, 0xD0,
0xC9, 0xE0,
0xFD, 0x01,
0x89, 0xF0,
0x8A, 0xFF,
0xFD, 0x00,
0xE8, 0x30,
0xE9, 0x30,
0xEA, 0x40,
0xF4, 0x1B,
0xF5, 0x97,
//0xEC, 0x53,
//0xED, 0x78,
//0xEE, 0x47,
//0xEF, 0x6C,
0xF7, 0x78,
0xF8, 0x63,
0xF9, 0x68,
0xFA, 0x53,
0xFD, 0x01,
0x09, 0x31,
0x0A, 0x85,
0x0B, 0x0B,
0x14, 0x20,
0x15, 0x0F,
0xfd,0x00, 0xfd,0x00,
0x05,0x0 , 0x1c,0x00,
0x06,0x0 , 0x30,0x00,
0x09,0x3 , 0x0f,0x2f,
0x0a,0xbc, 0x10,0x2f,
0xf0,0x50, 0x12,0x7f,
0xf1,0x0 , 0x13,0x2f,
0xf2,0x60, 0x15,0x7f,
0xf5,0x79, 0x16,0x0f,
0x22,0xe0,
0x26,0x08,
0x27,0xe8,
0x28,0x0b,
0x32,0x00,
0xfd,0x00,
0x31,0x10,
0xd8,0x58,
0xd9,0x58,
0xda,0x58,
0xdb,0x58,
0x36,0x00,
0x5f,0x11,
0xe0,0x00,
0xe1,0xdc,
0xe2,0xb0,
0xe3,0x00,
0xe4,0x2e,
0xe5,0x00,
0xe6,0x2b,
0xb7,0x3c,
0xb8,0x50,
0xfd,0x01, 0xfd,0x01,
0x00,0xb9, 0x25,0x1a,
0x0f,0x61, 0x26,0xfb,
0x16,0x61, 0x28,0x61,
0x17,0xa9, 0x29,0x49,
0x18,0xb1, 0x31,0x64,
0x1b,0x61, 0x32,0x18,
0x1c,0xb1, 0x4d,0xdc,
0x4e,0x53,
0x41,0x8c,
0x42,0x57,
0x55,0xff,
0x56,0x00,
0x59,0x82,
0x5a,0x00,
0x5d,0xff,
0x5e,0x6f,
0x57,0xff,
0x58,0x00,
0x5b,0xff,
0x5c,0xa8,
0x5f,0x75,
0x60,0x00,
0x2d,0x00,
0x2e,0x00,
0x2f,0x00,
0x30,0x00,
0x33,0x00,
0x34,0x00,
0x37,0x00,
0x38,0x00,
0x39,0x01,
0x3a,0x07,
0xfd,0x00,
0x33,0x0f,
0x51,0x3f,
0x52,0x09,
0x53,0x00,
0x54,0x00,
0x55,0x10,
0x4f,0x08,
0x50,0x08,
0x56,0x70,
0x57,0x10,
0x58,0x10,
0x59,0x10,
0x5a,0x02,
0x5b,0x02,
0x5c,0x20,
0x65,0x03,
0x66,0x01,
0x67,0x03,
0x68,0x46,
0x69,0x7f,
0x6a,0x01,
0x6b,0x04,
0x6c,0x01,
0x6d,0x03,
0x6e,0x46,
0x6f,0x7f,
0x70,0x01,
0x71,0x05,
0x72,0x01,
0x73,0x03,
0x74,0x46,
0x75,0x7f,
0x76,0x01,
0x7f,0xa0,
0x80,0x00,
0x81,0xe0,
0x82,0xed,
0x83,0xa6,
0x84,0xed,
0x85,0xfa,
0x86,0xba,
0x87,0xcc,
0x88,0x30,
0x89,0x33,
0x8a,0x0f,
0x8b,0x00,
0x8c,0x1a,
0x8d,0x29,
0x8e,0x41,
0x8f,0x62,
0x90,0x7c,
0x91,0x90,
0x92,0xa2,
0x93,0xaf,
0x94,0xba,
0x95,0xc4,
0x96,0xce,
0x97,0xd6,
0x98,0xdd,
0x99,0xe4,
0x9a,0xea,
0x9b,0xf1,
0xfd,0x01,
0x8d,0xf8,
0x8e,0xff,
0xfd,0x00,
0xca,0xcf,
0xcb,0x07,
0xcc,0x04,
0xce,0xff,
0xcf,0x10,
0xd0,0x20,
0xd1,0x00,
0xd2,0x1c,
0xd3,0x16,
0xd4,0x00,
0xd6,0x1c,
0xd7,0x16,
0xdd,0x6c,
0xde,0xa0,
0xb9,0x00,
0xba,0x04,
0xbb,0x08,
0xbc,0x10,
0xbd,0x20,
0xbe,0x30,
0xbf,0x40,
0xc0,0x50,
0xc1,0x60,
0xc2,0x70,
0xc3,0x80,
0xc4,0x90,
0xc5,0xa0,
0xc6,0xb0,
0xc7,0xc0,
0xc8,0xd0,
0xc9,0xe0,
0xfd,0x01,
0x89,0xf0,
0x8a,0xff,
0xfd,0x00,
0xe8,0x30,
0xe9,0x30,
0xea,0x40,
0xf4,0x1b,
0xf5,0x97,
0xec,0x53,
0xed,0x78,
0xee,0x47,
0xef,0x6c,
0xf7,0x70,
0xf8,0x5b,
0xf9,0x64,
0xfa,0x4f,
0xfd,0x01,
0x09,0x31,
0x0a,0x85,
0x0b,0x0b,
0x14,0x20,
0x15,0x0f,
0xfd,0x00,
0x05,0x00,
0x06,0xfe,
0x09,0x02,
0x0a,0x4d,
0xf0,0x47,
0xf1,0x00,
0xf2,0x59,
0xf5,0x72,
0xfd,0x01,
0x00,0xac,
0x0f,0x5a,
0x16,0x5a,
0x17,0x9c,
0x18,0xa4,
0x1b,0x5a,
0x1c,0xa4,
0xb4,0x21, 0xb4,0x21,
0xb5,0x3b, 0xb5,0x3b,
0xb6,0x5f, 0xb6,0x43,
0xb9,0x40, 0xb9,0x40,
0xba,0x4f, 0xba,0x4f,
0xbb,0x47, 0xbb,0x47,
@@ -238,68 +227,54 @@ SENSOR_INIT_SECTION static const unsigned char SP0828InitTable[CMOS_INIT_LEN] =
0xc2,0x41, 0xc2,0x41,
0xc3,0x41, 0xc3,0x41,
0xc4,0x41, 0xc4,0x41,
0xc5,0x41, 0xc5,0x70,
0xc6,0x41, 0xc6,0x41,
0xca,0x70, 0xca,0x70,
0xcb,0x10, 0xcb,0x0c,
0xfd,0x00, 0xfd,0x00,
0xfd,0x00,
0xFD, 0x00, 0x31,0x10,
0x32, 0x15, 0x32,0x15,
0x34, 0x26, 0x34,0x66,
0x35, 0x40, 0x35,0x40,
0xFD, 0x00, 0x1b,0x07,
//0x1B, 0x07, 0xff,0xff,
//0xFE, 0xFE,
//0x01, 0xFD,
//0x00, 0x62,
//0x00, 0x63,
//0x80, 0x64,
//0x80,
0xFF, 0xFF,
}; };
//Sensor prewrite sequence
// ----------------------------- SENSOR_INIT_SECTION static const unsigned char SP0828prewriteInitTable[CMOS_INIT_LEN]=
// Optional prewrite (kept, but not required for probe)
// -----------------------------
SENSOR_INIT_SECTION static const unsigned char SP0828prewriteInitTable[CMOS_INIT_LEN] =
{ {
0xFD,0x00, 0xfd,0x00,
0x1C,0x00, 0x1c,0x00,
0x30,0x00, 0x30,0x00,
0x31,0x00, 0x31,0x00,
0xFF,0xFF 0xff,0xff,
}; };
// -----------------------------
// Adapter descriptor SENSOR_OP_SECTION const _Sensor_Adpt_ sp0828_cmd=
// -----------------------------
SENSOR_OP_SECTION const _Sensor_Adpt_ sp0828_cmd =
{ {
.typ = 1, //YUV .typ = 1, //YUV
.pixelw = 240, .pixelw = 240,
.pixelh = 320, .pixelh= 320,
.hsyn = 1, .hsyn = 1,
.vsyn = 1, .vsyn = 1,
.rduline = 0, .rduline = 0,
.rawwide = 1, .rawwide = 1,//10bit
.colrarray = 2, .colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
.init = (uint8*)SP0828InitTable, .init = (uint8 *)SP0828InitTable,
.preset = (uint8*)SP0828prewriteInitTable, .preset = (uint8 *)SP0828prewriteInitTable,
.rotate_adapt = {0}, .rotate_adapt = {0},
.hvb_adapt = {0x80,0x0a,0x80,0x0a}, .hvb_adapt = {0x80,0x0a,0x80,0x0a},
. mclk = 24000000, .mclk = 24000000,
.p_fun_adapt = {NULL,NULL,NULL}, .p_fun_adapt = {NULL,NULL,NULL},
.p_xc7016_adapt = {NULL}, .p_xc7016_adapt = {NULL},
}; };
// ----------------------------- const _Sensor_Ident_ sp0828_init=
// Chip ID (probe expects reg 0x02 == 0x0C)
// -----------------------------
const _Sensor_Ident_ sp0828_init =
{ {
0x0C,0x30,0x31,0x01,0x01,0x02 //id, w_cmd, r_cmd, addr_num, data_num, id_reg
0x0c,0x30,0x31,0x01,0x01,0x02
}; };
#endif // DEV_SENSOR_SP0828 #endif
File diff suppressed because it is too large Load Diff