#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/isp.h" #if DEV_SENSOR_GC1084 #define SLAVE_MODE 0 SENSOR_INIT_SECTION const unsigned char GC1084InitTable[CMOS_INIT_LEN]= { 0x03, 0xfe, 0xf0, 0x03, 0xfe, 0xf0, 0x03, 0xfe, 0xf0, 0x03, 0xfe, 0x00, 0x03, 0xf2, 0x00, 0x03, 0xf3, 0x0f, 0x03, 0xf4, 0x36, 0x03, 0xf5, 0xc0, 0x03, 0xf6, 0x13, 0x03, 0xf7, 0x01, 0x03, 0xf8, 0x12, //10 0x03, 0xf9, 0x43, 0x03, 0xfa, 0x00, 0x03, 0xfc, 0x8e, 0x0d, 0x05, 0x07, 0x0d, 0x06, 0xd0, //hb=2000 0x0d, 0x08, 0x10, 0x0d, 0x0a, 0x02, 0x00, 0x0c, 0x03, 0x0d, 0x0d, 0x02, 0x0d, 0x0e, 0xd4, 0x00, 0x0f, 0x05, 0x00, 0x10, 0x08, 0x00, 0x17, 0x08, 0x0d, 0x73, 0x92, 0x0d, 0x76, 0x00, 0x0d, 0x41, 0x02, 0x0d, 0x42, 0xee, 0x0d, 0x7a, 0x0a, 0x00, 0x6b, 0x18, 0x0d, 0xb0, 0x9d, 0x0d, 0xb1, 0x00, 0x0d, 0xb2, 0xac, 0x0d, 0xb3, 0xd5, 0x0d, 0xb4, 0x00, 0x0d, 0xb5, 0x97, 0x0d, 0xb6, 0x09, 0x00, 0xd2, 0xfc, 0x0d, 0x19, 0x31, 0x0d, 0x20, 0x40, 0x0d, 0x25, 0xcb, 0x0d, 0x27, 0x03, 0x0d, 0x29, 0x40, 0x0d, 0x43, 0x20, 0x00, 0x58, 0x60, 0x00, 0xd6, 0x66, 0x00, 0xd7, 0x19, 0x00, 0x93, 0x02, 0x00, 0xd9, 0x14, 0x00, 0xda, 0xc1, 0x0d, 0x2a, 0x00, 0x0d, 0x28, 0x04, 0x0d, 0x53, 0x12, 0x0d, 0xc2, 0x84, 0x00, 0x50, 0x30, 0x00, 0x80, 0x07, 0x00, 0x8c, 0x05, 0x00, 0x8d, 0xa8, 0x00, 0x77, 0x01, 0x00, 0x78, 0xee, 0x00, 0x79, 0x02, 0x00, 0x67, 0xc0, 0x00, 0x54, 0x40, //ff 0x00, 0x55, 0x01,//02 0x00, 0x56, 0x00, 0x00, 0x57, 0x04, 0x00, 0x5a, 0xff, 0x00, 0x5b, 0x07, 0x00, 0xd5, 0x03, 0x01, 0x02, 0xa9, 0x0d, 0x03, 0x02, 0x0d, 0x04, 0xe0, 0x00, 0x7a, 0x60, 0x04, 0xe0, 0xff, 0x04, 0x14, 0x75, 0x04, 0x15, 0x75, 0x04, 0x16, 0x75, 0x04, 0x17, 0x75, 0x01, 0x22, 0x00, 0x01, 0x21, 0x80, 0x04, 0x28, 0x10, 0x04, 0x29, 0x10, 0x04, 0x2a, 0x10, 0x04, 0x2b, 0x10, 0x04, 0x2c, 0x14, 0x04, 0x2d, 0x14, 0x04, 0x2e, 0x18, 0x04, 0x2f, 0x18, 0x04, 0x30, 0x05, 0x04, 0x31, 0x05, 0x04, 0x32, 0x05, 0x04, 0x33, 0x05, 0x04, 0x34, 0x05, 0x04, 0x35, 0x05, 0x04, 0x36, 0x05, 0x04, 0x37, 0x05, 0x01, 0x53, 0x00, 0x01, 0x90, 0x01, 0x01, 0x92, 0x02, 0x01, 0x94, 0x04, 0x01, 0x95, 0x02, 0x01, 0x96, 0xd0, 0x01, 0x97, 0x05, 0x01, 0x98, 0x00, 0x00, 0xdc, 0x05, 0x00, 0xdd, 0xea, 0x02, 0x90, 0x0b, 0x02, 0x3e, 0x44, //40=raw10//44=raw8 0x02, 0x11, 0x2a, //raw8=2a//raw10=2b 0x03, 0x1e, 0x3e, 0x01, 0x04, 0x0f, 0x01, 0x89, 0x03, //【5】bit=0 dpc enable on 0x01, 0x01, 0x0c, //【7】bit=0 auto //【7】bit=1 manual 0x04, 0x28, 0xff, //[7:0]越小越强 0x04, 0x29, 0xff, 0x04, 0x2a, 0xff, 0x04, 0x2b, 0xff, 0x04, 0x2c, 0xff, 0x04, 0x2d, 0xff, 0x04, 0x2e, 0xff, 0x04, 0x2f, 0xff, 0x04, 0x30, 0x01, //[3:0]越大越强 0x04, 0x31, 0x01, 0x04, 0x32, 0x01, 0x04, 0x33, 0x01, 0x04, 0x34, 0x01, 0x04, 0x35, 0x01, 0x04, 0x36, 0x01, 0x04, 0x37, 0x01, 0x04, 0x38, 0x01, //[7:0]越大越强 0x04, 0x39, 0x01, 0x04, 0x3a, 0x01, 0x04, 0x3b, 0x01, 0x04, 0x3c, 0x01, 0x04, 0x3d, 0x01, 0x04, 0x3e, 0x01, 0x04, 0x3f, 0x01, 0xff, 0xff, 0xff, }; const _Sensor_CCM gc1084_ccm_init = { // 5500k, gamma2p2 // 0x21e, 0xf85, 0xfe9, // 0xee5, 0x1bf, 0xf2a, // 0xff2, 0xfc5, 0x1d1, // 0xffd, 0xffa, 0xffe, // 550, -105, -9, //-284, 440, -223, 480, -124, -71, -202, 496, -266, -53, -131, 548, 0, 0, 0, }; const _Sensor_BLC gc1084_blc_init = { 17*16, 17*16, 17*16, 17*16, }; const _Sensor_AWB gc1084_awb_init = { // r, gr, gb, b 488, 256, 256, 488, // default 340, 256, 256, 488, // min 488, 256, 256, 720, // max }; const _Sensor_AE gc1084_ae_init = { .max_analog_gain = (32<<8), .min_analog_gain = (1<<8), .default_exposure_line = 0x2ee, .max_exposure_line = 750, .min_exposure_line = 10, .row_time_us = 83, .expo_frame_interval = 2, .to_day_bv = 2010800, .to_night_bv = 2630800, }; const _Sensor_CSUPP gc1084_csupp_init = { // u8 U_luma_thr_lo, U_luma_slop_lo, U_luma_shfb_lo, U_luma_gmin_lo, // u8 U_luma_thr_hi, U_luma_slop_hi, U_luma_shfb_hi, U_luma_gmin_hi, // u8 V_luma_thr_lo, V_luma_slop_lo, V_luma_shfb_lo, V_luma_gmin_lo, // u8 V_luma_thr_hi, V_luma_slop_hi, V_luma_shfb_hi, V_luma_gmin_hi, // u8 chroma_thr_lo, chroma_slop_lo, chroma_shfb_lo, chroma_gmin_lo, 31, 4, 0, 0, 209, 4, 0, 0, 31, 4, 0, 0, 209, 4, 0, 0, 31, 4, 0, 0, }; const _Sensor_SHARP gc1084_sharp_init = { #if 0 128 , //smooth_filt_alpha 0 , //shrink_thr 60 , //filt_clip_hi 127 , //filt_clip_lo 10 , //sp_thr2 5 , //sp_thr1 60 , //enha_clip_hi 127 , //enha_clip_lo 10 ,15 ,20 ,//e1,e2,e3 0 ,64 , 64 , 64 ,//k0,k1,k2,k3 0 ,10 ,20 ,//y1,y2,y3 -6 ,-3 ,-1 , //filt_w11,filt_w12,filt_w13 -3 ,3 ,7 , //filt_w21,filt_w22,filt_w23 -1 ,7 ,12 , //filt_w31,filt_w32,filt_w33 0 , //filt_type 4 , //filt_sbit 0 , // lpf scale #else 128 , //smooth_filt_alpha 0 , //shrink_thr 127 , //filt_clip_hi 127 , //filt_clip_lo 10 , //sp_thr2 5 , //sp_thr1 30 , //enha_clip_hi 127 , //enha_clip_lo 5 ,10 ,15 ,//e1,e2,e3 0 ,128 ,128 ,128,//k0,k1,k2,k3 0 ,20 ,40 ,//y1,y2,y3 7 ,9 ,10 , //filt_w11,filt_w12,filt_w13 9 ,12 ,13 , //filt_w21,filt_w22,filt_w23 10 ,13 ,16 , //filt_w31,filt_w32,filt_w33 1 , //filt_type 8 , //filt_sbit 1 , // lpf scale #endif }; const _Sensor_YUVNR gc1084_yuvnr_init = { 20,20,20,20,20,20,20,20, 205,255,0, }; const _Sensor_COLENH_BV gc1084_ce_map[BV2COLENH_ARRAY_NUM] = { {.bv = 48664, .hue = 0, .luma = 50, .contrast = 56, .saturation = 70}, {.bv = 5993, .hue = 0, .luma = 50, .contrast = 56, .saturation = 70}, {.bv = 3022, .hue = 0, .luma = 50, .contrast = 56, .saturation = 70}, {.bv = 1638, .hue = 0, .luma = 50, .contrast = 56, .saturation = 70}, {.bv = 381, .hue = 0, .luma = 50, .contrast = 56, .saturation = 50}, {.bv = 369, .hue = 0, .luma = 50, .contrast = 56, .saturation = 50}, {.bv = 184, .hue = 0, .luma = 50, .contrast = 56, .saturation = 50}, {.bv = 90, .hue = 0, .luma = 50, .contrast = 56, .saturation = 50}, }; const _Sensor_COLENH gc1084_colenh_init = { .yuv_range = 1, .luma = 50, // range: 0 ~ 100 .contrast = 50, // range: 0 ~ 100 .saturation = 70, // range: 0 ~ 100 .hue = 0, // range: -180 ~ 180 .ce_in_ofs_y = 128, .ce_in_ofs_cb = 128, .ce_in_ofs_cr = 128, // range: -128 ~ 128 .ce_out_ofs_y = 128, .ce_out_ofs_cb = 128, .ce_out_ofs_cr = 128, // range: -128 ~ 128 .adj_by_bv_en = 1, .bv2colenh_map = (void *)gc1084_ce_map, }; const _Sensor_BV2NR gc1084_bv2nr_init[BV2RAWNR_ARRAY_NUM] = { // ev, bnr_range_weight_index, bnr_invksigma, bnr_intensity_threshold, yuvnr_idx, csupp_idx { 46, 14, 511, 45, 0, 0}, // 646lux { 124, 14, 407, 45, 0, 0}, // 240lux { 1469, 14, 407, 45, 0, 0}, // 20lux { 2959, 14, 244, 45, 0, 0}, // 10lux { 5906, 16, 244, 45, 1, 0}, // 5p03lux { 11864, 16, 122, 35, 2, 1}, // 2p5lux { 23752, 16, 81, 35, 2, 1}, // 1p25lux { 47277, 18, 48, 35, 3, 1}, // 0p62lux { 94554, 18, 48, 35, 3, 1}, // 0p31lux { 283662, 18, 48, 35, 4, 1}, // 0p1lux { 2836620, 31, 40, 35, 5, 1}, // 0p01lux }; const uint32 gc1084_lsc_tbl[] = { //R channel 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, //GR channel 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, //GB channel 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, //B channel 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, 0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100,0x00040100, }; const _Sensor_LSC gc1084_lsc_init = { .p_lsc_tbl = gc1084_lsc_tbl, }; uint8 gc1084_regValTable[25][6] = { // 00d1 00d0 0dc1 00b8 00b9 0155 { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}, { 0x0A, 0x00, 0x00, 0x01, 0x0c, 0x00}, { 0x00, 0x01, 0x00, 0x01, 0x1a, 0x00}, { 0x0A, 0x01, 0x00, 0x01, 0x2a, 0x00}, { 0x00, 0x02, 0x00, 0x02, 0x00, 0x00}, { 0x0A, 0x02, 0x00, 0x02, 0x18, 0x00}, { 0x00, 0x03, 0x00, 0x02, 0x33, 0x00}, { 0x0A, 0x03, 0x00, 0x03, 0x14, 0x00}, { 0x00, 0x04, 0x00, 0x04, 0x00, 0x02}, { 0x0A, 0x04, 0x00, 0x04, 0x2f, 0x02}, { 0x00, 0x05, 0x00, 0x05, 0x26, 0x02}, { 0x0A, 0x05, 0x00, 0x06, 0x29, 0x02}, { 0x00, 0x06, 0x00, 0x08, 0x00, 0x02}, { 0x0A, 0x06, 0x00, 0x09, 0x1f, 0x04}, { 0x12, 0x46, 0x00, 0x0b, 0x0d, 0x04}, { 0x19, 0x66, 0x00, 0x0d, 0x12, 0x06}, { 0x00, 0x04, 0x01, 0x10, 0x00, 0x06}, { 0x0A, 0x04, 0x01, 0x12, 0x3e, 0x08}, { 0x00, 0x05, 0x01, 0x16, 0x1a, 0x0a}, { 0x0A, 0x05, 0x01, 0x1a, 0x23, 0x0c}, { 0x00, 0x06, 0x01, 0x20, 0x00, 0x0c}, { 0x0A, 0x06, 0x01, 0x25, 0x3b, 0x0f}, { 0x12, 0x46, 0x01, 0x2c, 0x33, 0x12}, { 0x19, 0x66, 0x01, 0x35, 0x06, 0x14}, { 0x20, 0x06, 0x01, 0x3f, 0x3f, 0x15}, }; uint32 gc1084_gainLevelTable[26] = { 64, 76, 90, 106, 128, 152, 179, 212, 256, 303, 358, 425, 512, 607, 717, 849, 1024, 1213, 1434, 1699, 2048, 2427, 2867, 3398, 4096, 0xffffffff, }; void GC1084_ae_adjust(struct isp_exposure_opt *p_cfg) { uint32 i = 0; uint32 index = 0; uint32 total = sizeof(gc1084_gainLevelTable) / sizeof(uint32); uint32 tol_dig_gain = 0; uint32 gain = p_cfg->analog_gain >> 2; uint8 *addr = (uint8 *)p_cfg->data.addr; for(i = 0; i < total; i++) { if((gc1084_gainLevelTable[i] <= gain)&&(gain < gc1084_gainLevelTable[i+1])) break; } tol_dig_gain = (gain)*64/gc1084_gainLevelTable[i]; addr[index++] = 0x00; addr[index++] = 0xd1; addr[index++] = gc1084_regValTable[i][0]; addr[index++] = 0x00; addr[index++] = 0xd0; addr[index++] = gc1084_regValTable[i][1]; addr[index++] = 0x03; addr[index++] = 0x1d; addr[index++] = 0x2e; addr[index++] = 0x0d; addr[index++] = 0xc1; addr[index++] = gc1084_regValTable[i][2]; addr[index++] = 0x03; addr[index++] = 0x1d; addr[index++] = 0x28; addr[index++] = 0x00; addr[index++] = 0xb8; addr[index++] = gc1084_regValTable[i][3]; addr[index++] = 0x00; addr[index++] = 0xb9; addr[index++] = gc1084_regValTable[i][4]; addr[index++] = 0x01; addr[index++] = 0x55; addr[index++] = gc1084_regValTable[i][5]; addr[index++] = 0x00; addr[index++] = 0xb1; addr[index++] = (uint8)(tol_dig_gain>>6); addr[index++] = 0x00; addr[index++] = 0xb2; addr[index++] = (uint8)((tol_dig_gain&0x3f)<<2); addr[index++] = 0x0d; addr[index++] = 0x03; addr[index++] = (uint8)(p_cfg->exposure_line >> 8); addr[index++] = 0x0d; addr[index++] = 0x04; addr[index++] = (p_cfg->exposure_line & 0xff); p_cfg->data.size = index; p_cfg->cmd_len = 2+1; } const _Sensor_ISP_Init gc1084_isp_init = { .type = ISP_INPUT_DAT_SRC_MIPI0, .pixel_h = 720, .pixel_w = 1280, .bayer_patten = ISP_BAYER_FORMAT_GRBG, .input_format = ISP_INPUT_DAT_FORMAT_RAW10, .adjust_func = (isp_ae_func )GC1084_ae_adjust, .p_blc = (_Sensor_BLC *)&gc1084_blc_init, .p_ccm = (_Sensor_CCM *)&gc1084_ccm_init, .p_awb = (_Sensor_AWB *)&gc1084_awb_init, .p_ae = (_Sensor_AE *)&gc1084_ae_init, .p_csupp = (_Sensor_CSUPP *)&gc1084_csupp_init, .p_sharp = (_Sensor_SHARP *)&gc1084_sharp_init, .p_yuvnr = (_Sensor_YUVNR *)&gc1084_yuvnr_init, .p_colenh = (_Sensor_COLENH *)&gc1084_colenh_init, .p_bv2nr = (_Sensor_BV2NR *)gc1084_bv2nr_init, .p_lsc = (_Sensor_LSC *)&gc1084_lsc_init, }; SENSOR_OP_SECTION const _Sensor_Adpt_ gc1084_cmd = { .typ = 1, //YUV .pixelw = 1280, .pixelh= 720, .hsyn = 1, .vsyn = 0, .rduline = 0,// .rawwide = 1,//10bit .colrarray = 1,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_ .init = (uint8 *)GC1084InitTable, .init_len = sizeof(GC1084InitTable), .rotate_adapt = {0}, //.hvb_adapt = {0x6a,0x12,0x6a,0x12}, . mclk = 8000000, .p_fun_adapt = {NULL,NULL,NULL}, }; const _Sensor_Ident_ gc1084_init = { 0x84, 0x6e, 0x6f, 0x02, 0x01, 0x03f1 }; #endif