mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
Rolling 20220716
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
|
||||
#ifndef __BF20A6_H__
|
||||
#define __BF20A6_H__
|
||||
|
||||
#include "sensor.h"
|
||||
|
||||
/**
|
||||
* @brief Detect sensor pid
|
||||
*
|
||||
* @param slv_addr SCCB address
|
||||
* @param id Detection result
|
||||
* @return
|
||||
* 0: Can't detect this sensor
|
||||
* Nonzero: This sensor has been detected
|
||||
*/
|
||||
int bf20a6_detect(int slv_addr, sensor_id_t *id);
|
||||
|
||||
/**
|
||||
* @brief initialize sensor function pointers
|
||||
*
|
||||
* @param sensor pointer of sensor
|
||||
* @return
|
||||
* Always 0
|
||||
*/
|
||||
int bf20a6_init(sensor_t *sensor);
|
||||
|
||||
#endif // __BF20A6_H__
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* BF20A6 register definitions.
|
||||
*/
|
||||
#ifndef __BF20A6_REG_REGS_H__
|
||||
#define __BF20A6_REG_REGS_H__
|
||||
|
||||
#define SENSOR_ID_HIGH 0XFC
|
||||
#define SENSOR_ID_LOW 0XFD
|
||||
#define RESET_RELATED 0XF2
|
||||
|
||||
|
||||
#endif //__BF20A6_REG_REGS_H__
|
||||
@@ -0,0 +1,158 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define REG_DLY 0xffff
|
||||
#define REGLIST_TAIL 0xffff /* Array end token */
|
||||
|
||||
static const uint16_t bf20a6_default_init_regs[][2] = {
|
||||
{0xf2,0x01},
|
||||
{0x12,0x20},
|
||||
{0x3a,0x00},
|
||||
{0xe1,0x92},
|
||||
{0xe3,0x12},// PLL Control, important for framerate(choice: 0x02\0x12\0x22\0x32\0x82)
|
||||
{0xe0,0x00},
|
||||
{0x2a,0x98},
|
||||
{0xcd,0x17},
|
||||
{0xc0,0x10},
|
||||
{0xc6,0x1d},
|
||||
{0x10,0x35},
|
||||
{0xe2,0x09},
|
||||
{0xe4,0x72},
|
||||
{0xe5,0x22},
|
||||
{0xe6,0x24},
|
||||
{0xe7,0x64},
|
||||
{0xe8,0xa2}, // DVP:a2}, SPI:f2 VDDIO=1.8V,E8[2]=1},VDDIO=2.8V,E8[2]=0},
|
||||
{0x4a,0x00},
|
||||
{0x00,0x03},
|
||||
{0x1f,0x02},
|
||||
{0x22,0x02},
|
||||
{0x0c,0x31},
|
||||
|
||||
{0x00,0x00},
|
||||
{0x60,0x81},
|
||||
{0x61,0x81},
|
||||
|
||||
{0xa0,0x08},
|
||||
{0x01,0x1a},
|
||||
// {0x01,0x1a},
|
||||
// {0x01,0x1a},
|
||||
// {0x02,0x15},
|
||||
// {0x02,0x15},
|
||||
{0x02,0x15},
|
||||
{0x13,0x08},
|
||||
{0x8a,0x96},
|
||||
{0x8b,0x06},
|
||||
{0x87,0x18},
|
||||
|
||||
|
||||
{0x34,0x48}, // lens
|
||||
{0x35,0x40},
|
||||
{0x36,0x40},
|
||||
|
||||
{0x71,0x44},
|
||||
{0x72,0x48},
|
||||
{0x74,0xa2},
|
||||
{0x75,0xa9},
|
||||
{0x78,0x12},
|
||||
{0x79,0xa0},
|
||||
{0x7a,0x94},
|
||||
{0x7c,0x97},
|
||||
{0x40,0x30},
|
||||
{0x41,0x30},
|
||||
{0x42,0x28},
|
||||
{0x43,0x1f},
|
||||
{0x44,0x1c},
|
||||
{0x45,0x16},
|
||||
{0x46,0x13},
|
||||
{0x47,0x10},
|
||||
{0x48,0x0D},
|
||||
{0x49,0x0C},
|
||||
{0x4B,0x0A},
|
||||
{0x4C,0x0B},
|
||||
{0x4E,0x09},
|
||||
{0x4F,0x08},
|
||||
{0x50,0x08},
|
||||
|
||||
|
||||
{0x5f,0x29},
|
||||
{0x23,0x33},
|
||||
{0xa1,0x10}, // AWB
|
||||
{0xa2,0x0d},
|
||||
{0xa3,0x30},
|
||||
{0xa4,0x06},
|
||||
{0xa5,0x22},
|
||||
{0xa6,0x56},
|
||||
{0xa7,0x18},
|
||||
{0xa8,0x1a},
|
||||
{0xa9,0x12},
|
||||
{0xaa,0x12},
|
||||
{0xab,0x16},
|
||||
{0xac,0xb1},
|
||||
{0xba,0x12},
|
||||
{0xbb,0x12},
|
||||
{0xad,0x12},
|
||||
{0xae,0x56},
|
||||
{0xaf,0x0a},
|
||||
{0x3b,0x30},
|
||||
{0x3c,0x12},
|
||||
{0x3d,0x22},
|
||||
{0x3e,0x3f},
|
||||
{0x3f,0x28},
|
||||
{0xb8,0xc3},
|
||||
{0xb9,0xa3},
|
||||
{0x39,0x47}, // pure color threshold
|
||||
{0x26,0x13},
|
||||
{0x27,0x16},
|
||||
{0x28,0x14},
|
||||
{0x29,0x18},
|
||||
{0xee,0x0d},
|
||||
|
||||
|
||||
{0x13,0x05},
|
||||
{0x24,0x3C},
|
||||
{0x81,0x20},
|
||||
{0x82,0x40},
|
||||
{0x83,0x30},
|
||||
{0x84,0x58},
|
||||
{0x85,0x30},
|
||||
{0x92,0x08},
|
||||
{0x86,0x80},
|
||||
{0x8a,0x96},
|
||||
{0x91,0xff},
|
||||
{0x94,0x62},
|
||||
{0x9a,0x18}, // outdoor threshold
|
||||
{0xf0,0x45}, // integral time control, important for framerate(choice: 0x46\0x45\0x44..)
|
||||
{0x51,0x17}, // color normal
|
||||
{0x52,0x03},
|
||||
{0x53,0x5F},
|
||||
{0x54,0x47},
|
||||
{0x55,0x66},
|
||||
{0x56,0x0F},
|
||||
{0x7e,0x14},
|
||||
{0x57,0x36}, // color
|
||||
{0x58,0x2A},
|
||||
{0x59,0xAA},
|
||||
{0x5a,0xA8},
|
||||
{0x5b,0x43},
|
||||
{0x5c,0x10},
|
||||
{0x5d,0x00},
|
||||
{0x7d,0x36},
|
||||
{0x5e,0x10},
|
||||
|
||||
{0xd6,0x88}, // contrast
|
||||
{0xd5,0x20}, // bright
|
||||
{0xb0,0x84}, // low light ctrl in gray section
|
||||
{0xb5,0x08}, // the threshold of GLB_GAIN
|
||||
{0xb1,0xc8}, // saturation
|
||||
{0xb2,0xc0},
|
||||
{0xb3,0xd0},
|
||||
{0xb4,0xB0},
|
||||
|
||||
{0x32,0x10},
|
||||
// {0x8a,0x00},
|
||||
// {0x8b,0x10},
|
||||
{0xa0,0x09},
|
||||
{0x00,0x03},
|
||||
{0x0b,0x02},
|
||||
{REGLIST_TAIL, 0x00},
|
||||
};
|
||||
@@ -3,10 +3,9 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define REG_DLY 0xffff
|
||||
#define REGLIST_TAIL 0x0000 /* Array end token */
|
||||
#define REG_DLY 0xff
|
||||
|
||||
static const uint16_t gc0308_sensor_default_regs[][2] = {
|
||||
static const uint8_t gc0308_sensor_default_regs[][2] = {
|
||||
{0xfe, 0x00},
|
||||
{0xec, 0x20},
|
||||
{0x05, 0x00},
|
||||
@@ -239,7 +238,21 @@ static const uint16_t gc0308_sensor_default_regs[][2] = {
|
||||
{0x65, 0xd3},
|
||||
{0x66, 0x60},
|
||||
{0xfe, 0x00},
|
||||
{REGLIST_TAIL, 0x00},
|
||||
|
||||
{0x01, 0x32}, //frame setting
|
||||
{0x02, 0x0c},
|
||||
{0x0f, 0x01},
|
||||
{0xe2, 0x00},
|
||||
{0xe3, 0x78},
|
||||
{0xe4, 0x00},
|
||||
{0xe5, 0xfe},
|
||||
{0xe6, 0x01},
|
||||
{0xe7, 0xe0},
|
||||
{0xe8, 0x01},
|
||||
{0xe9, 0xe0},
|
||||
{0xea, 0x01},
|
||||
{0xeb, 0xe0},
|
||||
{0xfe, 0x00},
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,8 @@ static const DRAM_ATTR uint16_t sensor_default_regs[][2] = {
|
||||
{ISP_CONTROL_01, 0x83}, // turn color matrix, awb and SDE
|
||||
|
||||
//sys reset
|
||||
{0x3000, 0x00},
|
||||
{0x3000, 0x20}, // reset MCU
|
||||
{REG_DLY, 10}, // delay 10ms
|
||||
{0x3002, 0x1c},
|
||||
|
||||
//clock enable
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
*
|
||||
* SC030IOT DVP driver.
|
||||
*
|
||||
*/
|
||||
#ifndef __SC030IOT_H__
|
||||
#define __SC030IOT_H__
|
||||
|
||||
#include "sensor.h"
|
||||
|
||||
/**
|
||||
* @brief Detect sensor pid
|
||||
*
|
||||
* @param slv_addr SCCB address
|
||||
* @param id Detection result
|
||||
* @return
|
||||
* 0: Can't detect this sensor
|
||||
* Nonzero: This sensor has been detected
|
||||
*/
|
||||
int sc030iot_detect(int slv_addr, sensor_id_t *id);
|
||||
|
||||
/**
|
||||
* @brief initialize sensor function pointers
|
||||
*
|
||||
* @param sensor pointer of sensor
|
||||
* @return
|
||||
* Always 0
|
||||
*/
|
||||
int sc030iot_init(sensor_t *sensor);
|
||||
|
||||
#endif // __SC030IOT_H__
|
||||
@@ -0,0 +1,491 @@
|
||||
//version: V01P00_20220303
|
||||
//Preview Type:0:DVP Raw 10 bit// 1:Raw 8 bit// 2:YUV422// 3:RAW16
|
||||
//Preview Type:4:RGB565// 5:Pixart SPI// 6:MIPI 10bit// 7:MIPI 12bit// 8: MTK SPI
|
||||
//port 0:MIPI// 1:Parallel// 2:MTK// 3:SPI// 4:TEST// 5: HISPI// 6 : Z2P/Z4P
|
||||
//I2C Mode :0:Normal 8Addr,8Data// 1:Samsung 8 Addr,8Data// 2:Micron 8 Addr,16Data
|
||||
//I2C Mode :3:Stmicro 16Addr,8Data//4:Micron2 16 Addr,16Data
|
||||
//Out Format :0:YCbYCr/RG_GB// 1:YCrYCb/GR_BG// 2:CbYCrY/GB_RG// 3:CrYCbY/BG_GR
|
||||
//MCLK Speed :0:6M//1:8M//2:10M//3:11.4M//4:12M//5:12.5M//6:13.5M//7:15M//8:18M//9:24M
|
||||
//pin :BIT0 pwdn// BIT1:reset
|
||||
//avdd 0:3.3V// 1:2.5V// 2:1.8V
|
||||
//dovdd 0:2.8V// 1:2.5V// 2:1.8V
|
||||
//dvdd 0:1.8V// 1:1.5V// 2:1.2V
|
||||
|
||||
/*
|
||||
[DataBase]
|
||||
DBName=Dothinkey
|
||||
|
||||
[Vendor]
|
||||
VendorName=SmartSens
|
||||
|
||||
[Sensor]
|
||||
SensorName=SC031IOT
|
||||
width=640
|
||||
height=480
|
||||
port=1
|
||||
type=2
|
||||
pin=3
|
||||
SlaveID=0xd0
|
||||
mode=0
|
||||
FlagReg=0xf7
|
||||
FlagMask=0xff
|
||||
FlagData=0xfa
|
||||
FlagReg1=0xf8
|
||||
FlagMask1=0xff
|
||||
FlagData1=0x46
|
||||
outformat=0
|
||||
mclk=20
|
||||
avdd=2.80000
|
||||
dovdd=2.800000
|
||||
dvdd=1.5
|
||||
|
||||
Ext0=0
|
||||
Ext1=0
|
||||
Ext2=0
|
||||
AFVCC=0.0000
|
||||
VPP=0.000000
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t sc030iot_default_init_regs[][2] = {
|
||||
{0xf0, 0x30},
|
||||
{0x01, 0xff},
|
||||
{0x02, 0xff},
|
||||
{0x22, 0x07},
|
||||
{0x19, 0xff},
|
||||
{0x3f, 0x82},
|
||||
{0x30, 0x02},
|
||||
{0xf0, 0x01},
|
||||
{0x70, 0x00},
|
||||
{0x71, 0x80},
|
||||
{0x72, 0x20},
|
||||
{0x73, 0x00},
|
||||
{0x74, 0xe0},
|
||||
{0x75, 0x10},
|
||||
{0x76, 0x81},
|
||||
{0x77, 0x88},
|
||||
{0x78, 0xe1},
|
||||
{0x79, 0x01},
|
||||
{0xf5, 0x01},
|
||||
{0xf4, 0x0a},
|
||||
{0xf0, 0x36},
|
||||
{0x37, 0x79},
|
||||
{0x31, 0x82},
|
||||
{0x3e, 0x60},
|
||||
{0x30, 0xf0},
|
||||
{0x33, 0x33},
|
||||
{0xf0, 0x32},
|
||||
{0x48, 0x02},
|
||||
{0xf0, 0x33},
|
||||
{0x02, 0x12},
|
||||
{0x7c, 0x02},
|
||||
{0x7d, 0x0e},
|
||||
{0xa2, 0x04},
|
||||
{0x5e, 0x06},
|
||||
{0x5f, 0x0a},
|
||||
{0x0b, 0x58},
|
||||
{0x06, 0x38},
|
||||
{0xf0, 0x32},
|
||||
{0x48, 0x02},
|
||||
{0xf0, 0x39},
|
||||
{0x02, 0x70},
|
||||
{0xf0, 0x45},
|
||||
{0x09, 0x1c},
|
||||
{0xf0, 0x37},
|
||||
{0x22, 0x0d},
|
||||
{0xf0, 0x33},
|
||||
{0x33, 0x10},
|
||||
{0xb1, 0x80},
|
||||
{0x34, 0x40},
|
||||
{0x0b, 0x54},
|
||||
{0xb2, 0x78},
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x30},
|
||||
{0x38, 0x44},
|
||||
{0xf0, 0x33},
|
||||
{0xb3, 0x51},
|
||||
{0x01, 0x10},
|
||||
{0x0b, 0x6c},
|
||||
{0x06, 0x24},
|
||||
{0xf0, 0x36},
|
||||
{0x31, 0x82},
|
||||
{0x3e, 0x60},
|
||||
{0x30, 0xf0},
|
||||
{0x33, 0x33},
|
||||
{0xf0, 0x34},
|
||||
{0x9f, 0x02},
|
||||
{0xa6, 0x40},
|
||||
{0xa7, 0x47},
|
||||
{0xe8, 0x5f},
|
||||
{0xa8, 0x51},
|
||||
{0xa9, 0x44},
|
||||
{0xe9, 0x36},
|
||||
{0xf0, 0x33},
|
||||
{0xb3, 0x51},
|
||||
{0x64, 0x17},
|
||||
{0x90, 0x01},
|
||||
{0x91, 0x03},
|
||||
{0x92, 0x07},
|
||||
{0x01, 0x10},
|
||||
{0x93, 0x10},
|
||||
{0x94, 0x10},
|
||||
{0x95, 0x10},
|
||||
{0x96, 0x01},
|
||||
{0x97, 0x07},
|
||||
{0x98, 0x1f},
|
||||
{0x99, 0x10},
|
||||
{0x9a, 0x20},
|
||||
{0x9b, 0x28},
|
||||
{0x9c, 0x28},
|
||||
{0xf0, 0x36},
|
||||
{0x70, 0x54},
|
||||
{0xb6, 0x40},
|
||||
{0xb7, 0x41},
|
||||
{0xb8, 0x43},
|
||||
{0xb9, 0x47},
|
||||
{0xba, 0x4f},
|
||||
{0xb0, 0x8b},
|
||||
{0xb1, 0x8b},
|
||||
{0xb2, 0x8b},
|
||||
{0xb3, 0x9b},
|
||||
{0xb4, 0xb8},
|
||||
{0xb5, 0xf0},
|
||||
{0x7e, 0x41},
|
||||
{0x7f, 0x47},
|
||||
{0x77, 0x80},
|
||||
{0x78, 0x84},
|
||||
{0x79, 0x8a},
|
||||
{0xa0, 0x47},
|
||||
{0xa1, 0x5f},
|
||||
{0x96, 0x43},
|
||||
{0x97, 0x44},
|
||||
{0x98, 0x54},
|
||||
{0xf0, 0x00},
|
||||
{0xf0, 0x01},
|
||||
{0x73, 0x00},
|
||||
{0x74, 0xe0},
|
||||
{0x70, 0x00},
|
||||
{0x71, 0x80},
|
||||
{0xf0, 0x36},
|
||||
{0x37, 0x74},
|
||||
{0xf0, 0x3f},
|
||||
{0x03, 0xa1},
|
||||
{0xf0, 0x36},//cvbs_off
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x01},
|
||||
{0x79, 0xc1},
|
||||
{0xf0, 0x37},
|
||||
{0x24, 0x21},
|
||||
{0xf0, 0x36},
|
||||
{0x41, 0x00},
|
||||
{0xea, 0x09},
|
||||
{0xeb, 0x03},
|
||||
{0xec, 0x19},
|
||||
{0xed, 0x38},
|
||||
{0xe9, 0x30},
|
||||
{0xf0, 0x33},
|
||||
{0x33, 0x00},
|
||||
{0x34, 0x00},
|
||||
{0xb1, 0x00},
|
||||
{0xf0, 0x00},
|
||||
{0xe0, 0x04},
|
||||
{0xf0, 0x01},
|
||||
{0x73, 0x00},
|
||||
{0x74, 0xe0},
|
||||
{0x70, 0x00},
|
||||
{0x71, 0x80},
|
||||
{0xf0, 0x36},
|
||||
{0x32, 0x44},
|
||||
{0xf0, 0x36},
|
||||
{0x3e, 0xe0},
|
||||
{0x70, 0x56},
|
||||
{0x7c, 0x43},
|
||||
{0x7d, 0x47},
|
||||
{0x74, 0x00},
|
||||
{0x75, 0x00},
|
||||
{0x76, 0x00},
|
||||
{0xa0, 0x47},
|
||||
{0xa1, 0x5f},
|
||||
{0x96, 0x22},
|
||||
{0x97, 0x22},
|
||||
{0x98, 0x22},
|
||||
{0xf0, 0x00},
|
||||
{0x72, 0x38},
|
||||
{0x7a, 0x80},
|
||||
{0x85, 0x18},
|
||||
{0x9b, 0x35},
|
||||
{0x9e, 0x20},
|
||||
{0xd0, 0x66},
|
||||
{0xd1, 0x34},
|
||||
{0Xd3, 0x44},
|
||||
{0xd6, 0x44},
|
||||
{0xb0, 0x41},
|
||||
{0xb2, 0x48},
|
||||
{0xb3, 0xf4},
|
||||
{0xb4, 0x0b},
|
||||
{0xb5, 0x78},
|
||||
{0xba, 0xff},
|
||||
{0xbb, 0xc0},
|
||||
{0xbc, 0x90},
|
||||
{0xbd, 0x3a},
|
||||
{0xc1, 0x67},
|
||||
{0xf0, 0x01},
|
||||
{0x20, 0x11},
|
||||
{0x23, 0x90},
|
||||
{0x24, 0x15},
|
||||
{0x25, 0x87},
|
||||
{0xbc, 0x9f},
|
||||
{0xbd, 0x3a},
|
||||
{0x48, 0xe6},
|
||||
{0x49, 0xc0},
|
||||
{0x4a, 0xd0},
|
||||
{0x4b, 0x48},
|
||||
|
||||
// [cvbs_on]
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x00},
|
||||
{0xf0, 0x01},
|
||||
{0x79, 0xf1},
|
||||
|
||||
// [cvbs_off]
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x01},
|
||||
{0x79, 0xc1},
|
||||
};
|
||||
|
||||
/*
|
||||
[Sensor]
|
||||
SensorName=SC031IOT
|
||||
width=640
|
||||
height=480
|
||||
port=1
|
||||
type=2
|
||||
pin=3
|
||||
SlaveID=0xd0
|
||||
mode=0
|
||||
FlagReg=0xf7
|
||||
FlagMask=0xff
|
||||
FlagData=0xfa
|
||||
FlagReg1=0xf8
|
||||
FlagMask1=0xff
|
||||
FlagData1=0x46
|
||||
outformat=0
|
||||
mclk=27
|
||||
avdd=2.80000
|
||||
dovdd=2.800000
|
||||
dvdd=1.5
|
||||
|
||||
Ext0=0
|
||||
Ext1=0
|
||||
Ext2=0
|
||||
AFVCC=0.0000
|
||||
VPP=0.000000
|
||||
*/
|
||||
/* 27M MCLK, 30fps
|
||||
static const uint8_t sc030iot_default_init_regs[][2] = {
|
||||
{0xf0, 0x30},
|
||||
{0x01, 0xff},
|
||||
{0x02, 0xff},
|
||||
{0x22, 0x07},
|
||||
{0x19, 0xff},
|
||||
{0x3f, 0x82},
|
||||
{0x30, 0x02},
|
||||
{0xf0, 0x01},
|
||||
{0x70, 0x00},
|
||||
{0x71, 0x80},
|
||||
{0x72, 0x20},
|
||||
{0x73, 0x00},
|
||||
{0x74, 0xe0},
|
||||
{0x75, 0x10},
|
||||
{0x76, 0x81},
|
||||
{0x77, 0x88},
|
||||
{0x78, 0xe1},
|
||||
{0x79, 0x01},
|
||||
{0xf5, 0x01},
|
||||
{0xf4, 0x0a},
|
||||
{0xf0, 0x36},
|
||||
{0x37, 0x79},
|
||||
{0x31, 0x82},
|
||||
{0x3e, 0x60},
|
||||
{0x30, 0xf0},
|
||||
{0x33, 0x33},
|
||||
{0xf0, 0x32},
|
||||
{0x48, 0x02},
|
||||
{0xf0, 0x33},
|
||||
{0x02, 0x12},
|
||||
{0x7c, 0x02},
|
||||
{0x7d, 0x0e},
|
||||
{0xa2, 0x04},
|
||||
{0x5e, 0x06},
|
||||
{0x5f, 0x0a},
|
||||
{0x0b, 0x58},
|
||||
{0x06, 0x38},
|
||||
{0xf0, 0x32},
|
||||
{0x48, 0x02},
|
||||
{0xf0, 0x39},
|
||||
{0x02, 0x70},
|
||||
{0xf0, 0x45},
|
||||
{0x09, 0x1c},
|
||||
{0xf0, 0x37},
|
||||
{0x22, 0x0d},
|
||||
{0xf0, 0x33},
|
||||
{0x33, 0x10},
|
||||
{0xb1, 0x80},
|
||||
{0x34, 0x40},
|
||||
{0x0b, 0x54},
|
||||
{0xb2, 0x78},
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x30},
|
||||
{0x38, 0x44},
|
||||
{0xf0, 0x33},
|
||||
{0xb3, 0x51},
|
||||
{0x01, 0x10},
|
||||
{0x0b, 0x6c},
|
||||
{0x06, 0x24},
|
||||
{0xf0, 0x36},
|
||||
{0x31, 0x82},
|
||||
{0x3e, 0x60},
|
||||
{0x30, 0xf0},
|
||||
{0x33, 0x33},
|
||||
{0xf0, 0x34},
|
||||
{0x9f, 0x02},
|
||||
{0xa6, 0x40},
|
||||
{0xa7, 0x47},
|
||||
{0xe8, 0x5f},
|
||||
{0xa8, 0x51},
|
||||
{0xa9, 0x44},
|
||||
{0xe9, 0x36},
|
||||
{0xf0, 0x33},
|
||||
{0xb3, 0x51},
|
||||
{0x64, 0x17},
|
||||
{0x90, 0x01},
|
||||
{0x91, 0x03},
|
||||
{0x92, 0x07},
|
||||
{0x01, 0x10},
|
||||
{0x93, 0x10},
|
||||
{0x94, 0x10},
|
||||
{0x95, 0x10},
|
||||
{0x96, 0x01},
|
||||
{0x97, 0x07},
|
||||
{0x98, 0x1f},
|
||||
{0x99, 0x10},
|
||||
{0x9a, 0x20},
|
||||
{0x9b, 0x28},
|
||||
{0x9c, 0x28},
|
||||
{0xf0, 0x36},
|
||||
{0x70, 0x54},
|
||||
{0xb6, 0x40},
|
||||
{0xb7, 0x41},
|
||||
{0xb8, 0x43},
|
||||
{0xb9, 0x47},
|
||||
{0xba, 0x4f},
|
||||
{0xb0, 0x8b},
|
||||
{0xb1, 0x8b},
|
||||
{0xb2, 0x8b},
|
||||
{0xb3, 0x9b},
|
||||
{0xb4, 0xb8},
|
||||
{0xb5, 0xf0},
|
||||
{0x7e, 0x41},
|
||||
{0x7f, 0x47},
|
||||
{0x77, 0x80},
|
||||
{0x78, 0x84},
|
||||
{0x79, 0x8a},
|
||||
{0xa0, 0x47},
|
||||
{0xa1, 0x5f},
|
||||
{0x96, 0x43},
|
||||
{0x97, 0x44},
|
||||
{0x98, 0x54},
|
||||
{0xf0, 0x00},
|
||||
{0xf0, 0x01},
|
||||
{0x73, 0x00},
|
||||
{0x74, 0xe0},
|
||||
{0x70, 0x00},
|
||||
{0x71, 0x80},
|
||||
{0xf0, 0x36},
|
||||
{0x37, 0x74},
|
||||
{0xf0, 0x3f},
|
||||
{0x03, 0x93},
|
||||
{0xf0, 0x36},//cvbs_off
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x01},
|
||||
{0x79, 0xc1},
|
||||
{0xf0, 0x37},
|
||||
{0x24, 0x21},
|
||||
{0xf0, 0x36},
|
||||
{0x41, 0x00},
|
||||
{0xe9, 0x2c},
|
||||
{0xf0, 0x33},
|
||||
{0x33, 0x00},
|
||||
{0x34, 0x00},
|
||||
{0xb1, 0x00},
|
||||
{0xf0, 0x00},
|
||||
{0xe0, 0x04},
|
||||
{0xf0, 0x01},
|
||||
{0x73, 0x00},
|
||||
{0x74, 0xe0},
|
||||
{0x70, 0x00},
|
||||
{0x71, 0x80},
|
||||
{0xf0, 0x36},
|
||||
{0x32, 0x44},
|
||||
{0xf0, 0x36},
|
||||
{0x3e, 0xe0},
|
||||
{0x70, 0x56},
|
||||
{0x7c, 0x43},
|
||||
{0x7d, 0x47},
|
||||
{0x74, 0x00},
|
||||
{0x75, 0x00},
|
||||
{0x76, 0x00},
|
||||
{0xa0, 0x47},
|
||||
{0xa1, 0x5f},
|
||||
{0x96, 0x22},
|
||||
{0x97, 0x22},
|
||||
{0x98, 0x22},
|
||||
{0xf0, 0x00},
|
||||
{0x72, 0x38},
|
||||
{0x7a, 0x80},
|
||||
{0x85, 0x18},
|
||||
{0x9b, 0x35},
|
||||
{0x9e, 0x20},
|
||||
{0xd0, 0x66},
|
||||
{0xd1, 0x34},
|
||||
{0Xd3, 0x44},
|
||||
{0xd6, 0x44},
|
||||
{0xb0, 0x41},
|
||||
{0xb2, 0x48},
|
||||
{0xb3, 0xf4},
|
||||
{0xb4, 0x0b},
|
||||
{0xb5, 0x78},
|
||||
{0xba, 0xff},
|
||||
{0xbb, 0xc0},
|
||||
{0xbc, 0x90},
|
||||
{0xbd, 0x3a},
|
||||
{0xc1, 0x67},
|
||||
{0xf0, 0x01},
|
||||
{0x20, 0x11},
|
||||
{0x23, 0x90},
|
||||
{0x24, 0x15},
|
||||
{0x25, 0x87},
|
||||
{0xbc, 0x9f},
|
||||
{0xbd, 0x3a},
|
||||
{0x48, 0xe6},
|
||||
{0x49, 0xc0},
|
||||
{0x4a, 0xd0},
|
||||
{0x4b, 0x48},
|
||||
|
||||
// [cvbs_on]
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x00},
|
||||
{0xf0, 0x01},
|
||||
{0x79, 0xf1},
|
||||
|
||||
// [cvbs_off]
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x01},
|
||||
{0x79, 0xc1},
|
||||
};
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
*
|
||||
* SC101IOT DVP driver.
|
||||
*
|
||||
*/
|
||||
#ifndef __SC101IOT_H__
|
||||
#define __SC101IOT_H__
|
||||
|
||||
#include "sensor.h"
|
||||
|
||||
/**
|
||||
* @brief Detect sensor pid
|
||||
*
|
||||
* @param slv_addr SCCB address
|
||||
* @param id Detection result
|
||||
* @return
|
||||
* 0: Can't detect this sensor
|
||||
* Nonzero: This sensor has been detected
|
||||
*/
|
||||
int sc101iot_detect(int slv_addr, sensor_id_t *id);
|
||||
|
||||
/**
|
||||
* @brief initialize sensor function pointers
|
||||
*
|
||||
* @param sensor pointer of sensor
|
||||
* @return
|
||||
* Always 0
|
||||
*/
|
||||
int sc101iot_init(sensor_t *sensor);
|
||||
|
||||
#endif // __SC101IOT_H__
|
||||
@@ -0,0 +1,257 @@
|
||||
//Preview Type:0:DVP Raw 10 bit// 1:Raw 8 bit// 2:YUV422// 3:RAW16
|
||||
//Preview Type:4:RGB565// 5:Pixart SPI// 6:MIPI 10bit// 7:MIPI 12bit// 8: MTK SPI
|
||||
//port 0:MIPI// 1:Parallel// 2:MTK// 3:SPI// 4:TEST// 5: HISPI// 6 : Z2P/Z4P
|
||||
//I2C Mode :0:Normal 8Addr,8Data// 1:Samsung 8 Addr,8Data// 2:Micron 8 Addr,16Data
|
||||
//I2C Mode :3:Stmicro 16Addr,8Data//4:Micron2 16 Addr,16Data
|
||||
//Out Format :0:YCbYCr/RG_GB// 1:YCrYCb/GR_BG// 2:CbYCrY/GB_RG// 3:CrYCbY/BG_GR
|
||||
//MCLK Speed :0:6M//1:8M//2:10M//3:11.4M//4:12M//5:12.5M//6:13.5M//7:15M//8:18M//9:24M
|
||||
//pin :BIT0 pwdn// BIT1:reset
|
||||
//avdd 0:2.8V// 1:2.5V// 2:1.8V
|
||||
//dovdd 0:2.8V// 1:2.5V// 2:1.8V
|
||||
//dvdd 0:1.8V// 1:1.5V// 2:1.2V
|
||||
/*
|
||||
[DataBase]
|
||||
DBName=DemoSens
|
||||
|
||||
[Vendor]
|
||||
VendorName=SmartSens
|
||||
I2C_CRC=0
|
||||
|
||||
[Sensor]
|
||||
SensorName=SC101AP_raw
|
||||
width=1280
|
||||
height=720
|
||||
port=1
|
||||
type=2
|
||||
pin=3
|
||||
SlaveID=0xd0
|
||||
mode=0
|
||||
FlagReg=0xf7
|
||||
FlagMask=0xff
|
||||
FlagData=0xda
|
||||
FlagReg1=0xf8
|
||||
FlagMask1=0xff
|
||||
FlagData1=0x4a
|
||||
outformat=0
|
||||
mclk=20
|
||||
avdd=2.800000
|
||||
dovdd=2.800000
|
||||
dvdd=1.200000
|
||||
|
||||
Ext0=0
|
||||
Ext1=0
|
||||
Ext2=0
|
||||
AFVCC=0.00
|
||||
VPP=0.000000
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t sc101iot_default_init_regs[][2] = {
|
||||
#if CONFIG_SC101IOT_720P_15FPS_ENABLED // 720P+YUV422+15FPS sensor default regs
|
||||
/* Here are some test results:
|
||||
# size xclk fps pic pclk
|
||||
# ------- ------- ------ --------- ------- --- --- --- --- ---
|
||||
# 720p 4 3 err
|
||||
# 720p 8 5 normal 15
|
||||
# 720p 10 7.8 normal 19
|
||||
# 720p 20 15 warning 37.5
|
||||
# VGA 8 6 normal
|
||||
# VGA 20 16 normal
|
||||
|
||||
*/
|
||||
{0xf0, 0x30},
|
||||
{0x01, 0xff},
|
||||
{0x02, 0xe0},
|
||||
{0x30, 0x10},
|
||||
{0x3f, 0x81},
|
||||
{0xf0, 0x00},
|
||||
{0x70, 0x6b},
|
||||
{0x72, 0x30},
|
||||
{0x84, 0xb4},
|
||||
{0x8b, 0x00},
|
||||
{0x8c, 0x20},
|
||||
{0x8d, 0x02},
|
||||
{0x8e, 0xec},
|
||||
{0x9e, 0x10},
|
||||
{0xb0, 0xc1},
|
||||
{0xc8, 0x10},
|
||||
{0xc9, 0x10},
|
||||
{0xc6, 0x00},
|
||||
{0xe0, 0x0f},
|
||||
{0xb5, 0xf0},
|
||||
{0xde, 0x80},
|
||||
{0xb5, 0xf0},
|
||||
{0xde, 0x80},
|
||||
{0xb2, 0x50},
|
||||
{0xb3, 0xfc},
|
||||
{0xb4, 0x40},
|
||||
{0xb5, 0xc0},
|
||||
{0xb6, 0x50},
|
||||
{0xb7, 0xfc},
|
||||
{0xb8, 0x40},
|
||||
{0xb9, 0xc0},
|
||||
{0xba, 0xff},
|
||||
{0xbb, 0xcc},
|
||||
{0xbc, 0xa9},
|
||||
{0xbd, 0x7d},
|
||||
{0xc1, 0x77},
|
||||
{0xf0, 0x01},
|
||||
{0x70, 0x02},
|
||||
{0x71, 0x02},
|
||||
{0x72, 0x50},
|
||||
{0x73, 0x02},
|
||||
{0x74, 0xd2},
|
||||
{0x75, 0x20},
|
||||
{0x76, 0x81},
|
||||
{0x77, 0x8c},
|
||||
{0x78, 0x81},
|
||||
{0xf4, 0x01},
|
||||
{0xf5, 0x00},
|
||||
{0xf6, 0x00},
|
||||
{0xf0, 0x36},
|
||||
{0x40, 0x03},
|
||||
{0x41, 0x01},
|
||||
{0xf0, 0x39},
|
||||
{0x02, 0x70},
|
||||
{0xf0, 0x32},
|
||||
{0x41, 0x00},
|
||||
{0x43, 0x01},
|
||||
{0x48, 0x02},
|
||||
{0xf0, 0x45},
|
||||
{0x09, 0x20},
|
||||
{0xf0, 0x33},
|
||||
{0x33, 0x10},
|
||||
{0xf0, 0x30},
|
||||
{0x38, 0x44},
|
||||
{0xf0, 0x39},
|
||||
{0x07, 0x00},
|
||||
{0x08, 0x19},
|
||||
{0x47, 0x00},
|
||||
{0x48, 0x00},
|
||||
{0xf0, 0x37},
|
||||
{0x24, 0x31},
|
||||
{0xf0, 0x34},
|
||||
{0x9f, 0x02},
|
||||
{0xa6, 0x51},
|
||||
{0xa7, 0x57},
|
||||
{0xe8, 0x5f},
|
||||
{0xa8, 0x50},
|
||||
{0xa9, 0x50},
|
||||
{0xe9, 0x50},
|
||||
{0xf0, 0x33},
|
||||
{0xb3, 0x58},
|
||||
{0xb2, 0x78},
|
||||
{0xf0, 0x34},
|
||||
{0x9f, 0x03},
|
||||
{0xa6, 0x51},
|
||||
{0xa7, 0x57},
|
||||
{0xaa, 0x01},
|
||||
{0xab, 0x28},
|
||||
{0xac, 0x01},
|
||||
{0xad, 0x38},
|
||||
{0xf0, 0x33},
|
||||
{0x0a, 0x01},
|
||||
{0x0b, 0x28},
|
||||
{0xf0, 0x33},
|
||||
{0x64, 0x0f},
|
||||
{0xec, 0x51},
|
||||
{0xed, 0x57},
|
||||
{0x06, 0x58},
|
||||
{0xe9, 0x58},
|
||||
{0xeb, 0x68},
|
||||
{0xf0, 0x33},
|
||||
{0x64, 0x0f},
|
||||
{0xf0, 0x36},
|
||||
{0x70, 0xdf},
|
||||
{0xb6, 0x40},
|
||||
{0xb7, 0x51},
|
||||
{0xb8, 0x53},
|
||||
{0xb9, 0x57},
|
||||
{0xba, 0x5f},
|
||||
{0xb0, 0x84},
|
||||
{0xb1, 0x82},
|
||||
{0xb2, 0x84},
|
||||
{0xb3, 0x88},
|
||||
{0xb4, 0x90},
|
||||
{0xb5, 0x90},
|
||||
{0xf0, 0x36},
|
||||
{0x7e, 0x50},
|
||||
{0x7f, 0x51},
|
||||
{0x77, 0x81},
|
||||
{0x78, 0x86},
|
||||
{0x79, 0x89},
|
||||
{0xf0, 0x36},
|
||||
{0x70, 0xdf},
|
||||
{0x9c, 0x51},
|
||||
{0x9d, 0x57},
|
||||
{0x90, 0x54},
|
||||
{0x91, 0x54},
|
||||
{0x92, 0x56},
|
||||
{0xf0, 0x36},
|
||||
{0xa0, 0x51},
|
||||
{0xa1, 0x57},
|
||||
{0x96, 0x33},
|
||||
{0x97, 0x43},
|
||||
{0x98, 0x43},
|
||||
{0xf0, 0x36},
|
||||
{0x70, 0xdf},
|
||||
{0x7c, 0x40},
|
||||
{0x7d, 0x53},
|
||||
{0x74, 0xd0},
|
||||
{0x75, 0xf0},
|
||||
{0x76, 0xf0},
|
||||
{0xf0, 0x37},
|
||||
{0x0f, 0xd5},
|
||||
{0x7a, 0x40},
|
||||
{0x7b, 0x57},
|
||||
{0x71, 0x09},
|
||||
{0x72, 0x09},
|
||||
{0x73, 0x05},
|
||||
{0xf0, 0x33},
|
||||
{0x01, 0x44},
|
||||
{0xf0, 0x36},
|
||||
{0x37, 0xfb},
|
||||
{0xf0, 0x36},
|
||||
{0x3c, 0x0d},
|
||||
{0xf0, 0x33},
|
||||
{0x14, 0x95},
|
||||
{0xf0, 0x33},
|
||||
{0x8f, 0x80},
|
||||
{0xf0, 0x37},
|
||||
{0x27, 0x14},
|
||||
{0x28, 0x03},
|
||||
{0xf0, 0x36},
|
||||
{0x37, 0xf4},
|
||||
{0xf0, 0x33},
|
||||
{0x01, 0x44},
|
||||
{0xf0, 0x36},
|
||||
{0x79, 0x89},
|
||||
{0xf0, 0x34},
|
||||
{0xac, 0x01},
|
||||
{0xad, 0x40},
|
||||
{0xf0, 0x33},
|
||||
{0xeb, 0x70},
|
||||
{0xf0, 0x34},
|
||||
{0xa8, 0x50},
|
||||
{0xa9, 0x50},
|
||||
{0xf0, 0x33},
|
||||
{0xb3, 0x58},
|
||||
{0xf0, 0x36},
|
||||
{0x11, 0x80},
|
||||
{0xf0, 0x36},
|
||||
{0x41, 0x51},
|
||||
{0xf0, 0x3f},
|
||||
{0x03, 0x09},
|
||||
{0xf0, 0x32},
|
||||
{0x0c, 0x06},
|
||||
{0x0d, 0x82},
|
||||
{0x0e, 0x02},
|
||||
{0x0f, 0xee},
|
||||
{0xf0, 0x36},
|
||||
{0xea, 0x09},
|
||||
{0xeb, 0xf5},
|
||||
{0xec, 0x11},
|
||||
{0xed, 0x27},
|
||||
{0xe9, 0x20},
|
||||
#endif
|
||||
};
|
||||
Reference in New Issue
Block a user