6 Commits
Author SHA1 Message Date
divadiow 05bd1742cd 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.
2026-08-11 00:42:37 +03:00
divadiow c9225190f2 add sp0a20 support (#2) 2025-10-09 21:47:38 +03:00
NonPIayerCharacter d96e703e90 Reduce freq to 8mhz 2025-09-29 20:43:49 +03:00
NonPIayerCharacter 9f1291c400 sp0828 sensor 2025-09-29 20:36:14 +03:00
divadiow 37e27673fd hi704 driver + print more sensor info (#1)
* realign with sdk

* hi704 + info print

* Update csi.h

* Update csi_v2.c

* Update Makefile

* change sensor match wording
2025-09-18 21:48:40 +03:00
NonPIayerCharacter beed2be607 configurable cam i2c pins 2025-09-17 01:21:09 +03:00
11 changed files with 1631 additions and 2337 deletions
+3
View File
@@ -426,6 +426,9 @@ SRC_C += ../sdk/lib/bus/iic/sensor/sensor_sp0a19.c
SRC_C += ../sdk/lib/bus/iic/sensor/sensor_sp0718.c
SRC_C += ../sdk/lib/bus/iic/sensor/sensor_bf30a2.c
SRC_C += ../sdk/lib/bus/iic/sensor/sensor_ov7660.c
SRC_C += ../sdk/lib/bus/iic/sensor/sensor_hi704.c
SRC_C += ../sdk/lib/bus/iic/sensor/sensor_sp0828.c
SRC_C += ../sdk/lib/bus/iic/sensor/sensor_sp0a20.c
SRC_C += ../sdk/lib/bus/iic/gsensor/da280.c
SRC_C += ../sdk/lib/bus/iic/gsensor/qma7981.c
SRC_C += ../sdk/lib/bus/iic/gsensor/sc7a20.c
+3 -2310
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -58,7 +58,7 @@ static void *start_block(void)
static void get_back_audio_frame( struct frame *f, void *d )
{
struct audio_encoder *en = (struct audio_encoder *)d;
_os_printf("-");
//_os_printf("-");
//exchange_frame( en->ex, new_frame() );
deliver_frame_to_stream( f, en->output );
}
+1 -1
View File
@@ -72,7 +72,7 @@ static int audio_get_sdp( char *dest, int len, int payload, int port, void *d )
static int audio_process_frame( struct frame *f, void *d )
{
_os_printf("+");
//_os_printf("+");
struct rtp_media *rtp = (struct rtp_media *)d;
struct rtp_audio *out = (struct rtp_audio *)rtp->private;
out->f = f;
+10 -8
View File
@@ -31,6 +31,8 @@
__weak void user_pin_func(int dev_id, int request) {};
extern int dvp_scl;
extern int dvp_sda;
void gpio_iomap_output_iomask(uint32 io_func)
@@ -684,15 +686,15 @@ static int iic_pin_func(int dev_id, int request)
break;
case HG_I2C2_DEVID:
if (request) {
gpio_iomap_inout(PIN_IIC2_SCL, GPIO_IOMAP_IN_SPI2_SCK_IN, GPIO_IOMAP_OUT_SPI2_SCK_OUT);
gpio_iomap_inout(PIN_IIC2_SDA, GPIO_IOMAP_IN_SPI2_IO0_IN, GPIO_IOMAP_OUT_SPI2_IO0_OUT);
gpio_driver_strength(PIN_IIC2_SCL, GPIO_DS_28MA);
gpio_driver_strength(PIN_IIC2_SDA, GPIO_DS_28MA);
gpio_set_mode(PIN_IIC2_SCL, GPIO_OPENDRAIN_PULL_UP, GPIO_PULL_LEVEL_4_7K);
gpio_set_mode(PIN_IIC2_SDA, GPIO_OPENDRAIN_PULL_UP, GPIO_PULL_LEVEL_4_7K);
gpio_iomap_inout(dvp_scl, GPIO_IOMAP_IN_SPI2_SCK_IN, GPIO_IOMAP_OUT_SPI2_SCK_OUT);
gpio_iomap_inout(dvp_sda, GPIO_IOMAP_IN_SPI2_IO0_IN, GPIO_IOMAP_OUT_SPI2_IO0_OUT);
gpio_driver_strength(dvp_scl, GPIO_DS_28MA);
gpio_driver_strength(dvp_sda, GPIO_DS_28MA);
gpio_set_mode(dvp_scl, GPIO_OPENDRAIN_PULL_UP, GPIO_PULL_LEVEL_4_7K);
gpio_set_mode(dvp_sda, GPIO_OPENDRAIN_PULL_UP, GPIO_PULL_LEVEL_4_7K);
} else {
gpio_set_dir(PIN_IIC2_SCL, GPIO_DIR_INPUT);
gpio_set_dir(PIN_IIC2_SDA, GPIO_DIR_INPUT);
gpio_set_dir(dvp_scl, GPIO_DIR_INPUT);
gpio_set_dir(dvp_sda, GPIO_DIR_INPUT);
}
break;
default:
+26 -1
View File
@@ -302,11 +302,21 @@ void vpp_put_psram(uint32 yuvbuf_addr,uint32 s_w,uint32 s_h);
#define DEV_SENSOR_BF30A2 (0||CMOS_AUTO_LOAD)
#endif
#ifndef DEV_SENSOR_IOT101
#define DEV_SENSOR_IOT101 0
#endif
#ifndef DEV_SENSOR_HI704
#define DEV_SENSOR_HI704 (0||CMOS_AUTO_LOAD)
#endif
#ifndef DEV_SENSOR_SP0828
#define DEV_SENSOR_SP0828 (0||CMOS_AUTO_LOAD)
#endif
#ifndef DEV_SENSOR_SP0A20
#define DEV_SENSOR_SP0A20 (0||CMOS_AUTO_LOAD)
#endif
#if DEV_SENSOR_OV7725
extern const _Sensor_Ident_ ov7725_init;
@@ -435,4 +445,19 @@ extern const _Sensor_Ident_ sc101iot_init;
extern SENSOR_OP_SECTION const _Sensor_Adpt_ sc101iot_cmd;
#endif
#if DEV_SENSOR_HI704
extern const _Sensor_Ident_ hi704_init;
extern SENSOR_OP_SECTION const _Sensor_Adpt_ hi704_cmd;
#endif
#if DEV_SENSOR_SP0828
extern const _Sensor_Ident_ sp0828_init;
extern SENSOR_OP_SECTION const _Sensor_Adpt_ sp0828_cmd;
#endif
#if DEV_SENSOR_SP0A20
extern const _Sensor_Ident_ sp0a20_init;
extern SENSOR_OP_SECTION const _Sensor_Adpt_ sp0a20_cmd;
#endif
#endif
+391
View File
@@ -0,0 +1,391 @@
#include "sys_config.h"
#include "typesdef.h"
#include "lib/video/dvp/cmos_sensor/csi.h"
#include "tx_platform.h"
#include "list.h"
#include "dev.h"
#include "hal/i2c.h"
#if DEV_SENSOR_HI704
SENSOR_INIT_SECTION static const unsigned char HI704InitTable[CMOS_INIT_LEN]=
{
0x03,0x00,
0x01,0xf1,
0x01,0xf3,
0x01,0xf1,
0x03,0x00,
0x10,0x08,
0x11,0x90,
0x12,0x04,
0x20,0x00,
0x21,0x04,
0x22,0x00,
0x23,0x04,
0x40,0x01,
0x41,0x58,
0x42,0x00,
0x43,0x64,
0x45,0x01,
0x46,0x08,
0x47,0xf5,
0x80,0x2e,
0x81,0x7e,
0x82,0x90,
0x83,0x30,
0x84,0x2c,
0x85,0x4b,
0x89,0x48,
0x90,0x0c,
0x91,0x0c,
0x92,0x48,
0x93,0x40,
0x98,0x38,
0x99,0x40,
0xa0,0x00,
0xa8,0x40,
0x03,0x02,
0x13,0x40,
0x14,0x04,
0x1a,0x00,
0x1b,0x08,
0x20,0x33,
0x21,0xaa,
0x22,0xa7,
0x23,0x32,
0x3b,0x48,
0x50,0x21,
0x52,0xa2,
0x53,0x0a,
0x54,0x30,
0x55,0x10,
0x56,0x0c,
0x59,0x0f,
0x60,0xca,
0x61,0xdb,
0x62,0xca,
0x63,0xda,
0x64,0xca,
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=
{
.typ = 1, //YUV
.pixelw = 640,
.pixelh= 480,
.hsyn = 1,
.vsyn = 1,
.rduline = 0,
.rawwide = 1,//10bit
.colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
.init = (uint8 *)HI704InitTable,
.rotate_adapt = {0},
.hvb_adapt = {0},
.mclk = 24000000,
.p_fun_adapt = {NULL,NULL,NULL},
.p_xc7016_adapt = {NULL},
};
const _Sensor_Ident_ hi704_init=
{
//id, w_cmd, r_cmd, addr_num, data_num, id_reg
0x96,0x60,0x61,0x01,0x01,0x04
};
#endif
+280
View File
@@ -0,0 +1,280 @@
#include "sys_config.h"
#include "typesdef.h"
#include "lib/video/dvp/cmos_sensor/csi.h"
#include "tx_platform.h"
#include "list.h"
#include "dev.h"
#include "hal/i2c.h"
#if DEV_SENSOR_SP0828
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,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,
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,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,
0xb5,0x3b,
0xb6,0x43,
0xb9,0x40,
0xba,0x4f,
0xbb,0x47,
0xbc,0x45,
0xbd,0x43,
0xbe,0x42,
0xbf,0x42,
0xc0,0x42,
0xc1,0x41,
0xc2,0x41,
0xc3,0x41,
0xc4,0x41,
0xc5,0x70,
0xc6,0x41,
0xca,0x70,
0xcb,0x0c,
0xfd,0x00,
0xfd,0x00,
0x31,0x10,
0x32,0x15,
0x34,0x66,
0x35,0x40,
0x1b,0x07,
0xff,0xff,
};
//Sensor prewrite sequence
SENSOR_INIT_SECTION static const unsigned char SP0828prewriteInitTable[CMOS_INIT_LEN]=
{
0xfd,0x00,
0x1c,0x00,
0x30,0x00,
0x31,0x00,
0xff,0xff,
};
SENSOR_OP_SECTION const _Sensor_Adpt_ sp0828_cmd=
{
.typ = 1, //YUV
.pixelw = 240,
.pixelh= 320,
.hsyn = 1,
.vsyn = 1,
.rduline = 0,
.rawwide = 1,//10bit
.colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
.init = (uint8 *)SP0828InitTable,
.preset = (uint8 *)SP0828prewriteInitTable,
.rotate_adapt = {0},
.hvb_adapt = {0x80,0x0a,0x80,0x0a},
.mclk = 24000000,
.p_fun_adapt = {NULL,NULL,NULL},
.p_xc7016_adapt = {NULL},
};
const _Sensor_Ident_ sp0828_init=
{
//id, w_cmd, r_cmd, addr_num, data_num, id_reg
0x0c,0x30,0x31,0x01,0x01,0x02
};
#endif
+401
View File
@@ -0,0 +1,401 @@
#include "sys_config.h"
#include "typesdef.h"
#include "lib/video/dvp/cmos_sensor/csi.h"
#include "tx_platform.h"
#include "list.h"
#include "dev.h"
#include "hal/i2c.h"
#if DEV_SENSOR_SP0A20
SENSOR_INIT_SECTION static const unsigned char SP0A20InitTable[CMOS_INIT_LEN]=
{
0xfd,0x00,
0x1d,0x1f,
0x0c,0x01,
0x1b,0x27,
0x12,0x02,
0x13,0x2f,
0x6d,0x32,
0x6c,0x32,
0x6f,0x33,
0x6e,0x34,
0x16,0x38,
0x17,0x38,
0x70,0x3a,
0x14,0x02,
0x15,0x20,
0x71,0x23,
0x69,0x25,
0x6a,0x1a,
0x72,0x1c,
0x75,0x1e,
0x73,0x3c,
0x74,0x21,
0x79,0x00,
0x77,0x10,
0x1a,0x4d,
0x1c,0x07,
0x1e,0x15,
0x21,0x08,
0x22,0x28,
0x26,0x66,
0x28,0x0b,
0x37,0x7a,
0xfd,0x02,
0x01,0x80,
0x52,0x10,
0x54,0x00,
0xfd,0x01,
0x41,0x00,
0x42,0x00,
0x43,0x00,
0x44,0x00,
0xfd,0x00,
0x03,0x01,
0x04,0xc2,
0x05,0x00,
0x06,0x00,
0x07,0x00,
0x08,0x00,
0x09,0x02,
0x0a,0xf4,
0xfd,0x01,
0xf0,0x00,
0xf7,0x4b,
0x02,0x0e,
0x03,0x01,
0x06,0x4b,
0x07,0x00,
0x08,0x01,
0x09,0x00,
0xfd,0x02,
0xbe,0x1a,
0xbf,0x04,
0xd0,0x1a,
0xd1,0x04,
0xfd,0x01,
0x5a,0x40,
0xfd,0x02,
0xbc,0x70,
0xbd,0x50,
0xb8,0x66,
0xb9,0x88,
0xba,0x30,
0xbb,0x45,
0xfd,0x01,
0xe0,0x7c,
0xe1,0x60,
0xe2,0x54,
0xe3,0x4c,
0xe4,0x4c,
0xe5,0x48,
0xe6,0x48,
0xe7,0x44,
0xe8,0x44,
0xe9,0x44,
0xea,0x40,
0xf3,0x40,
0xf4,0x40,
0xfd,0x01,
0x04,0xc8,
0x05,0x40,
0x0a,0xc8,
0x0b,0x40,
0xfd,0x01,
0xeb,0x80,
0xec,0x68,
0xed,0x05,
0xee,0x0c,
0xfd,0x01,
0xf2,0x4d,
0xfd,0x02,
0x5b,0x05,
0x5c,0xa0,
0xfd,0x01,
0x26,0x80,
0x27,0x4f,
0x28,0x00,
0x29,0x20,
0x2a,0x00,
0x2b,0x03,
0x2c,0x00,
0x2d,0x20,
0x30,0x00,
0x31,0x00,
0xfd,0x01,
0xa1,0x1b,
0xa2,0x16,
0xa3,0x09,
0xa4,0x1a,
0xa5,0x1a,
0xa6,0x16,
0xa7,0x0c,
0xa8,0x1b,
0xa9,0x15,
0xaa,0x12,
0xab,0x07,
0xac,0x18,
0xad,0x05,
0xae,0x07,
0xaf,0x06,
0xb0,0x05,
0xb1,0x00,
0xb2,0x00,
0xb3,0x02,
0xb4,0x01,
0xb5,0x02,
0xb6,0x03,
0xb7,0x04,
0xb8,0x02,
0xfd,0x02,
0x08,0x00,
0x09,0x06,
0x1d,0x03,
0x1f,0x05,
0xfd,0x01,
0x32,0x00,
0xfd,0x02,
0x26,0xbf,
0x27,0xa3,
0xfd,0x00,
0xe7,0x03,
0xe7,0x00,
0xfd,0x02,
0x10,0xd3,
0x11,0xd3,
0x1b,0x80,
0x1a,0x80,
0x18,0x27,
0x19,0x26,
0x2a,0x00,
0x2b,0x00,
0x28,0xf8,
0x29,0x08,
0x66,0x4a,
0x67,0x6c,
0x68,0xd4,
0x69,0xf4,
0x6a,0xa5,
0x7c,0x30,
0x7d,0x4b,
0x7e,0xf7,
0x7f,0x13,
0x80,0xa6,
0x70,0x26,
0x71,0x4a,
0x72,0x25,
0x73,0x46,
0x74,0xaa,
0x6b,0x0a,
0x6c,0x31,
0x6d,0x2e,
0x6e,0x52,
0x6f,0xaa,
0x61,0xff,
0x62,0x18,
0x63,0x40,
0x64,0x6a,
0x65,0x6a,
0x75,0x80,
0x76,0x09,
0x77,0x02,
0x24,0x25,
0x0e,0x16,
0x3b,0x09,
0xfd,0x02,
0xde,0x0f,
0xd7,0x08,
0xd8,0x08,
0xd9,0x10,
0xda,0x14,
0xe8,0x20,
0xe9,0x20,
0xea,0x20,
0xeb,0x20,
0xec,0x28,
0xed,0x28,
0xee,0x20,
0xef,0x20,
0xd3,0x20,
0xd4,0x48,
0xd5,0x20,
0xd6,0x08,
0xfd,0x01,
0xd1,0x20,
0xfd,0x02,
0xdc,0x05,
0x05,0x20,
0xfd,0x02,
0x81,0x00,
0xfd,0x01,
0xfc,0x00,
0x7d,0x05,
0x7e,0x05,
0x7f,0x09,
0x80,0x08,
0xfd,0x02,
0xdd,0x0f,
0xfd,0x01,
0x6d,0x08,
0x6e,0x0f,
0x6f,0x20,
0x70,0x28,
0x86,0x28,
0x71,0x06,
0x72,0x07,
0x73,0x10,
0x74,0x14,
0x75,0x08,
0x76,0x08,
0x77,0x06,
0x78,0x06,
0x79,0x25,
0x7a,0x13,
0x7b,0x12,
0x7c,0x00,
0x81,0x0d,
0x82,0x18,
0x83,0x20,
0x84,0x24,
0xfd,0x02,
0x83,0x12,
0x84,0x14,
0x86,0x04,
0xfd,0x01,
0x61,0x60,
0x62,0x28,
0x8a,0x10,
0xfd,0x01,
0x8b,0x00,
0x8c,0x00,
0x8d,0x16,
0x8e,0x23,
0x8f,0x2f,
0x90,0x44,
0x91,0x57,
0x92,0x66,
0x93,0x73,
0x94,0x8b,
0x95,0x9e,
0x96,0xaf,
0x97,0xbd,
0x98,0xc8,
0x99,0xd1,
0x9a,0xd7,
0x9b,0xdd,
0x9c,0xe1,
0x9d,0xe5,
0x9e,0xe8,
0x9f,0xe9,
0xa0,0xeb,
0xfd,0x02,
0x15,0xc0,
0x16,0x8c,
0xa0,0x8a,
0xa1,0xf6,
0xa2,0x00,
0xa3,0x15,
0xa4,0x73,
0xa5,0xf7,
0xa6,0x18,
0xa7,0xcf,
0xa8,0x99,
0xa9,0x0c,
0xaa,0x30,
0xab,0x0c,
0xac,0x93,
0xad,0xe7,
0xae,0x06,
0xaf,0xda,
0xb0,0xcc,
0xb1,0xda,
0xb2,0xda,
0xb3,0xda,
0xb4,0xcc,
0xb5,0x0c,
0xb6,0x33,
0xb7,0x0f,
0xfd,0x01,
0xd3,0x80,
0xd4,0x80,
0xd5,0x70,
0xd6,0x50,
0xd7,0x80,
0xd8,0x80,
0xd9,0x70,
0xda,0x50,
0xfd,0x01,
0xdd,0x30,
0xde,0x10,
0xdf,0xff,
0x00,0x00,
0xfd,0x01,
0xc2,0xaa,
0xc3,0x77,
0xc4,0x77,
0xc5,0x66,
0xfd,0x01,
0xcd,0x10,
0xce,0x1f,
0xcf,0x30,
0xd0,0x45,
0xfd,0x02,
0x31,0x60,
0x32,0x60,
0x33,0xc0,
0x35,0x60,
0x37,0x13,
0xfd,0x01,
0x0e,0x80,
0x0f,0x20,
0x10,0x70,
0x11,0x70,
0x12,0x78,
0x13,0x78,
0x14,0xa8,
0x15,0xa0,
0x16,0xa0,
0x17,0xa0,
0xfd,0x00,
0x31,0x01,
0xfd,0x01,
0x32,0x15,
0x33,0xef,
0x34,0x07,
0xd2,0x01,
0xfb,0x25,
0xf2,0x49,
0x35,0x40,
0x5d,0x11,
0xfd,0x00,
0xfd,0x00,
0x1b,0x20,
0xff,0xff,
};
SENSOR_OP_SECTION const _Sensor_Adpt_ sp0a20_cmd=
{
.typ = 1, //YUV
.pixelw = 640,
.pixelh= 480,
.hsyn = 1,
.vsyn = 1,
.rduline = 0,
.rawwide = 1,//10bit
.colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
.init = (uint8 *)SP0A20InitTable,
.rotate_adapt = {0},
.hvb_adapt = {0},
.mclk = 24000000,
.p_fun_adapt = {NULL,NULL,NULL},
.p_xc7016_adapt = {NULL},
};
const _Sensor_Ident_ sp0a20_init=
{
//id, w_cmd, r_cmd, addr_num, data_num, id_reg
0x2b,0x42,0x43,0x01,0x01,0x02
};
#endif
+361
View File
@@ -0,0 +1,361 @@
# Also see "include/mbedtls/mbedtls_config.h"
CFLAGS ?= -O2
WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
LDFLAGS ?=
# Include ../include for public headers and . for private headers.
# Note that . needs to be included explicitly for the sake of library
# files that are not in the /library directory (which currently means
# under /3rdparty).
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I. -I../include -D_FILE_OFFSET_BITS=64
LOCAL_LDFLAGS =
ifdef DEBUG
LOCAL_CFLAGS += -g3
endif
# MicroBlaze specific options:
# CFLAGS += -mno-xl-soft-mul -mxl-barrel-shift
# To compile on Plan9:
# CFLAGS += -D_BSD_EXTENSION
PERL ?= perl
ifdef WINDOWS
PYTHON ?= python
else
PYTHON ?= $(shell if type python3 >/dev/null 2>/dev/null; then echo python3; else echo python; fi)
endif
# if were running on Windows build for Windows
ifdef WINDOWS
WINDOWS_BUILD=1
else ifeq ($(shell uname -s),Darwin)
ifeq ($(AR),ar)
APPLE_BUILD ?= 1
endif
endif
# To compile as a shared library:
ifdef SHARED
# all code is position-indep with mingw, avoid warning about useless flag
ifndef WINDOWS_BUILD
LOCAL_CFLAGS += -fPIC -fpic
endif
endif
SOEXT_TLS?=so.19
SOEXT_X509?=so.5
SOEXT_CRYPTO?=so.14
# Set AR_DASH= (empty string) to use an ar implementation that does not accept
# the - prefix for command line options (e.g. llvm-ar)
AR_DASH ?= -
ARFLAGS = $(AR_DASH)src
ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
ARFLAGS = $(AR_DASH)Src
RLFLAGS = -no_warning_for_no_symbols -c
RL ?= ranlib
endif
endif
DLEXT ?= so
ifdef WINDOWS_BUILD
# Windows shared library extension:
DLEXT = dll
else ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
# Mac OS X shared library extension:
DLEXT = dylib
endif
endif
OBJS_CRYPTO= \
aes.o \
aesni.o \
aesce.o \
aria.o \
asn1parse.o \
asn1write.o \
base64.o \
bignum.o \
bignum_core.o \
bignum_mod.o \
bignum_mod_raw.o \
camellia.o \
ccm.o \
chacha20.o \
chachapoly.o \
cipher.o \
cipher_wrap.o \
cmac.o \
constant_time.o \
ctr_drbg.o \
des.o \
dhm.o \
ecdh.o \
ecdsa.o \
ecjpake.o \
ecp.o \
ecp_curves.o \
entropy.o \
entropy_poll.o \
error.o \
gcm.o \
hash_info.o \
hkdf.o \
hmac_drbg.o \
lmots.o \
lms.o \
md.o \
md5.o \
memory_buffer_alloc.o \
nist_kw.o \
oid.o \
padlock.o \
pem.o \
pk.o \
pk_wrap.o \
pkcs12.o \
pkcs5.o \
pkparse.o \
pkwrite.o \
platform.o \
platform_util.o \
poly1305.o \
psa_crypto.o \
psa_crypto_aead.o \
psa_crypto_cipher.o \
psa_crypto_client.o \
psa_crypto_driver_wrappers.o \
psa_crypto_ecp.o \
psa_crypto_hash.o \
psa_crypto_mac.o \
psa_crypto_pake.o \
psa_crypto_rsa.o \
psa_crypto_se.o \
psa_crypto_slot_management.o \
psa_crypto_storage.o \
psa_its_file.o \
psa_util.o \
ripemd160.o \
rsa.o \
rsa_alt_helpers.o \
sha1.o \
sha256.o \
sha512.o \
threading.o \
timing.o \
version.o \
version_features.o \
# This line is intentionally left blank
include ../3rdparty/Makefile.inc
LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
OBJS_CRYPTO+=$(THIRDPARTY_CRYPTO_OBJECTS)
OBJS_X509= \
x509.o \
x509_create.o \
x509_crl.o \
x509_crt.o \
x509_csr.o \
x509write_crt.o \
x509write_csr.o \
pkcs7.o \
# This line is intentionally left blank
OBJS_TLS= \
debug.o \
mps_reader.o \
mps_trace.o \
net_sockets.o \
ssl_cache.o \
ssl_ciphersuites.o \
ssl_client.o \
ssl_cookie.o \
ssl_debug_helpers_generated.o \
ssl_msg.o \
ssl_ticket.o \
ssl_tls.o \
ssl_tls12_client.o \
ssl_tls12_server.o \
ssl_tls13_keys.o \
ssl_tls13_client.o \
ssl_tls13_server.o \
ssl_tls13_generic.o \
# This line is intentionally left blank
.SILENT:
.PHONY: all static shared clean
ifndef SHARED
all: static
else
all: shared static
endif
static: libmbedcrypto.a libmbedx509.a libmbedtls.a
cd ../tests && echo "This is a seedfile that contains 64 bytes (65 on Windows)......" > seedfile
shared: libmbedcrypto.$(DLEXT) libmbedx509.$(DLEXT) libmbedtls.$(DLEXT)
# Windows builds under Mingw can fail if make tries to create archives in the same
# directory at the same time - see https://bugs.launchpad.net/gcc-arm-embedded/+bug/1848002.
# This forces builds of the .a files to be serialised.
ifdef WINDOWS
libmbedtls.a: | libmbedx509.a
libmbedx509.a: | libmbedcrypto.a
endif
# tls
libmbedtls.a: $(OBJS_TLS)
echo " AR $@"
$(AR) $(ARFLAGS) $@ $(OBJS_TLS)
ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
echo " RL $@"
$(RL) $(RLFLAGS) $@
endif
endif
libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so
echo " LD $@"
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_TLS) -L. -lmbedx509 -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
ifneq ($(SOEXT_TLS),so)
libmbedtls.so: libmbedtls.$(SOEXT_TLS)
echo " LN $@ -> $<"
ln -sf $< $@
endif
libmbedtls.dylib: $(OBJS_TLS) libmbedx509.dylib
echo " LD $@"
$(CC) -dynamiclib -o $@ $(OBJS_TLS) -L. -lmbedx509 -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
libmbedtls.dll: $(OBJS_TLS) libmbedx509.dll
echo " LD $@"
$(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_TLS) -lws2_32 -lwinmm -lgdi32 -L. -lmbedx509 -lmbedcrypto -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS)
# x509
libmbedx509.a: $(OBJS_X509)
echo " AR $@"
$(AR) $(ARFLAGS) $@ $(OBJS_X509)
ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
echo " RL $@"
$(RL) $(RLFLAGS) $@
endif
endif
libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so
echo " LD $@"
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_X509) -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
ifneq ($(SOEXT_X509),so)
libmbedx509.so: libmbedx509.$(SOEXT_X509)
echo " LN $@ -> $<"
ln -sf $< $@
endif
libmbedx509.dylib: $(OBJS_X509) libmbedcrypto.dylib
echo " LD $@"
$(CC) -dynamiclib -o $@ $(OBJS_X509) -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
libmbedx509.dll: $(OBJS_X509) libmbedcrypto.dll
echo " LD $@"
$(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_X509) -lws2_32 -lwinmm -lgdi32 -L. -lmbedcrypto -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS)
# crypto
libmbedcrypto.a: $(OBJS_CRYPTO)
echo " AR $@"
$(AR) $(ARFLAGS) $@ $(OBJS_CRYPTO)
ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
echo " RL $@"
$(RL) $(RLFLAGS) $@
endif
endif
libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO)
echo " LD $@"
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_CRYPTO) $(LOCAL_LDFLAGS) $(LDFLAGS)
ifneq ($(SOEXT_CRYPTO),so)
libmbedcrypto.so: libmbedcrypto.$(SOEXT_CRYPTO)
echo " LN $@ -> $<"
ln -sf $< $@
endif
libmbedcrypto.dylib: $(OBJS_CRYPTO)
echo " LD $@"
$(CC) -dynamiclib -o $@ $(OBJS_CRYPTO) $(LOCAL_LDFLAGS) $(LDFLAGS)
libmbedcrypto.dll: $(OBJS_CRYPTO)
echo " LD $@"
$(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_CRYPTO) -lws2_32 -lwinmm -lgdi32 -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS)
.c.o:
echo " CC $<"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $<
.PHONY: generated_files
GENERATED_FILES = \
error.c version_features.c \
ssl_debug_helpers_generated.c \
psa_crypto_driver_wrappers.c
generated_files: $(GENERATED_FILES)
error.c: ../scripts/generate_errors.pl
error.c: ../scripts/data_files/error.fmt
error.c: $(filter-out %config%,$(wildcard ../include/mbedtls/*.h))
error.c:
echo " Gen $@"
$(PERL) ../scripts/generate_errors.pl
ssl_debug_helpers_generated.c: ../scripts/generate_ssl_debug_helpers.py
ssl_debug_helpers_generated.c: $(filter-out %config%,$(wildcard ../include/mbedtls/*.h))
ssl_debug_helpers_generated.c:
echo " Gen $@"
$(PYTHON) ../scripts/generate_ssl_debug_helpers.py --mbedtls-root .. .
version_features.c: ../scripts/generate_features.pl
version_features.c: ../scripts/data_files/version_features.fmt
## The generated file only depends on the options that are present in mbedtls_config.h,
## not on which options are set. To avoid regenerating this file all the time
## when switching between configurations, don't declare mbedtls_config.h as a
## dependency. Remove this file from your working tree if you've just added or
## removed an option in mbedtls_config.h.
#version_features.c: ../include/mbedtls/mbedtls_config.h
version_features.c:
echo " Gen $@"
$(PERL) ../scripts/generate_features.pl
psa_crypto_driver_wrappers.c: ../scripts/generate_driver_wrappers.py
psa_crypto_driver_wrappers.c: ../scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja
psa_crypto_driver_wrappers.c:
echo " Gen $@"
$(PYTHON) ../scripts/generate_driver_wrappers.py
clean:
ifndef WINDOWS
rm -f *.o libmbed*
rm -f $(THIRDPARTY_CRYPTO_OBJECTS)
else
if exist *.o del /Q /F *.o
if exist libmbed* del /Q /F libmbed*
del /Q /F del_errors_out_if_the_file_list_is_empty_but_not_if_a_file_does_not_exist $(subst /,\,$(THIRDPARTY_CRYPTO_OBJECTS))
endif
neat: clean
ifndef WINDOWS
rm -f $(GENERATED_FILES)
else
for %f in ($(subst /,\,$(GENERATED_FILES))) if exist %f del /Q /F %f
endif
+154 -16
View File
@@ -137,6 +137,18 @@ static const _Sensor_Ident_ *devSensorInitTable[] = {
&sc101iot_init,
#endif
#if DEV_SENSOR_HI704
&hi704_init,
#endif
#if DEV_SENSOR_SP0828
&sp0828_init,
#endif
#if DEV_SENSOR_SP0A20
&sp0a20_init,
#endif
NULL,
};
@@ -234,8 +246,127 @@ static const _Sensor_Adpt_ *devSensorOPTable[] = {
&sc101iot_cmd,
#endif
#if DEV_SENSOR_HI704
&hi704_cmd,
#endif
#if DEV_SENSOR_SP0828
&sp0828_cmd,
#endif
#if DEV_SENSOR_SP0A20
&sp0a20_cmd,
#endif
};
// Keep same order as devSensorOPTable - helps ID which driver is used to init sensor
static const char *devSensorNameTable[] = {
#if DEV_SENSOR_GC0308
"gc0308",
#endif
#if DEV_SENSOR_GC0309
"gc0309",
#endif
#if DEV_SENSOR_GC0311
"gc0311",
#endif
#if DEV_SENSOR_GC0312
"gc0312",
#endif
#if DEV_SENSOR_GC0328
"gc0328",
#endif
#if DEV_SENSOR_GC0329
"gc0329",
#endif
#if DEV_SENSOR_BF3A03
"bf3a03",
#endif
#if DEV_SENSOR_BF3703
"bf3703",
#endif
#if DEV_SENSOR_OV2640
"ov2640",
#endif
#if DEV_SENSOR_OV7725
"ov7725",
#endif
#if DEV_SENSOR_OV7670
"ov7670",
#endif
#if DEV_SENSOR_OV7660
"ov7660",
#endif
#if DEV_SENSOR_BF2013
"bf2013",
#endif
#if DEV_SENSOR_XC7016_H63
"xc7016_h63",
#endif
#if DEV_SENSOR_XC7011_H63
"xc7011_h63",
#endif
#if DEV_SENSOR_XC7011_GC1054
"xc7011_gc1054",
#endif
#if DEV_SENSOR_XCG532
"xcg532",
#endif
#if DEV_SENSOR_GC2145
"gc2145",
#endif
#if DEV_SENSOR_SP0718
"sp0718",
#endif
#if DEV_SENSOR_SP0A19
"sp0a19",
#endif
#if DEV_SENSOR_BF3720
"bf3720",
#endif
#if DEV_SENSOR_NT99230
"nt99230",
#endif
#if DEV_SENSOR_IOT101
"sc101iot",
#endif
#if DEV_SENSOR_HI704
"hi704",
#endif
#if DEV_SENSOR_SP0828
"sp0828",
#endif
#if DEV_SENSOR_SP0A20
"sp0a20",
#endif
};
#if IPF_EN
#if 1
@@ -1006,7 +1137,12 @@ int sensorCheckId(struct i2c_device *p_iic,const _Sensor_Ident_ *p_sensor_ident,
i2c_read(p_iic,u8Buf,p_sensor_ident->addr_num,(int8*)&id,p_sensor_ident->data_num);
os_printf("SID: %x, %x, %x, %x,%x\r\n",id,p_sensor_ident->id,u8SensorwriteID,u8SensorreadID,p_sensor_ident->id_reg);
os_printf("SID: id=0x%02x expect=0x%02x addr8={0x%02x,0x%02x} addr7=0x%02x reg=0x%02x\r\n",
id, p_sensor_ident->id,
u8SensorwriteID, u8SensorreadID,
(u8SensorwriteID >> 1),
p_sensor_ident->id_reg);
if(id == p_sensor_ident->id)
return 1;
else
@@ -1032,15 +1168,22 @@ static _Sensor_Adpt_ * sensorAutoCheck(struct i2c_device *p_iic,uint8 *init_buf)
sensor_reset();
if(sensorCheckId(p_iic,devSensorInitTable[i],devSensorOPTable[i])>=0)
{
os_printf("id =%x num:%d \n",devSensorInitTable[i]->id,i);
devSensorInit = (_Sensor_Ident_ *) devSensorInitTable[i];
//#if CMOS_AUTO_LOAD
// devSensor_Struct = sensor_adpt_load(devSensorInit->id,devSensorInit->w_cmd,devSensorInit->r_cmd,init_buf);
//#else
devSensor_Struct = (_Sensor_Adpt_ *) devSensorOPTable[i];
//#endif
devSensorInit = (_Sensor_Ident_ *) devSensorInitTable[i];
devSensor_Struct= (_Sensor_Adpt_ *) devSensorOPTable[i];
// New, more informative line:
os_printf("sensor driver match: name=%s id=0x%02x num=%d addr7=0x%02x mclk=%d pix=%dx%d\r\n",
devSensorNameTable[i],
devSensorInit->id,
i,
(devSensorInit->w_cmd >> 1), // 7-bit I2C address
devSensor_Struct->mclk,
devSensor_Struct->pixelw,
devSensor_Struct->pixelh);
break;
}
}
if(devSensor_Struct == NULL)
{
@@ -1631,9 +1774,9 @@ bool csi_yuv_mode(){
i2c_ioctl(iic_test,IIC_STRONG_OUTPUT,1);
//i2c_send_stop(iic_test);
os_printf("iic init finish,sensor reset & set sensor clk into 6M\r\n");
os_printf("iic init finish,sensor reset & set sensor clk into 8M\r\n");
//2:init sensor
dvp_set_baudrate(dvp_test,6000000);
dvp_set_baudrate(dvp_test,8000000);
os_sleep_ms(3);
os_printf("set sensor finish ,Auto Check sensor id\r\n");
@@ -1904,9 +2047,4 @@ bool csi_open(){
}
#endif
#endif