• 大小: 19KB
    文件类型: .7z
    金币: 1
    下载: 0 次
    发布日期: 2021-05-28
  • 语言: 其他
  • 标签: IMX307  驱动源码  

资源简介

switch(genSensorMode)
{
default:
case WDR_MODE_NONE:
pstAeSnsDft->u32LinesPer500ms = gu32FullLinesStd*30/2;
pstAeSnsDft->au8HistThresh[0] = 0xd;
pstAeSnsDft->au8HistThresh[1] = 0x28;
pstAeSnsDft->au8HistThresh[2] = 0x60;
pstAeSnsDft->au8HistThresh[3] = 0x80;

pstAeSnsDft->u32MaxAgain = 62564;
pstAeSnsDft->u32MinAgain = 1024;
pstAeSnsDft->u32MaxAgainTarget = pstAeSnsDft->u32MaxAgain;
pstAeSnsDft->u32MinAgainTarget = pstAeSnsDft->u32MinAgain;

pstAeSnsDft->u32MaxDgain = 4096;
pstAeSnsDft->u32MinDgain = 1024;
pstAeSnsDft->u32MaxDgainTarget = pstAeSnsDft->u32MaxDgain;
pstAeSnsDft->u32MinDgainTarget = pstAeSnsDft->u32MinDgain;

pstAeSnsDft->u8AeCompensation = 0x38;
pstAeSnsDft->u32InitExposure = 76151;

pstAeSnsDft->u32MaxIntTime = gu32FullLinesStd - 2;
pstAeSnsDft->u32MinIntTime = 1;
pstAeSnsDft->u32MaxIntTimeTarget = 65535;
pstAeSnsDft->u32MinIntTimeTarget = 1;
break;

case WDR_MODE_2To1_LINE:
pstAeSnsDft->u32LinesPer500ms = gu32FullLinesStd*25/2;
pstAeSnsDft->au8HistThresh[0] = 0xC;
pstAeSnsDft->au8HistThresh[1] = 0x18;
pstAeSnsDft->au8HistThresh[2] = 0x60;
pstAeSnsDft->au8HistThresh[3] = 0x80;

pstAeSnsDft->u32MaxIntTime = gu32FullLinesStd - 2;
pstAeSnsDft->u32MinIntTime = 2;
pstAeSnsDft->u32MaxIntTimeTarget = 65535;
pstAeSnsDft->u32MinIntTimeTarget = pstAeSnsDft->u32MinIntTime;

pstAeSnsDft->u32MaxAgain = 62564;
pstAeSnsDft->u32MinAgain = 1024;
pstAeSnsDft->u32MaxAgainTarget = 62

资源截图

代码片段和文件信息

#if !defined(__IMX307_CMOS_H_)
#define __IMX307_CMOS_H_

#include 
#include 
#include 
#include “hi_comm_sns.h“
#include “hi_comm_video.h“
#include “hi_sns_ctrl.h“
#include “mpi_isp.h“
#include “mpi_ae.h“
#include “mpi_awb.h“
#include “mpi_af.h“

#ifdef __cplusplus
#if __cplusplus
extern “C“{
#endif
#endif /* End of #ifdef __cplusplus */


#define IMX307_ID 307

#define SENSOR_IMX307_WIDTH 1920
#define SENSOR_IMX307_HEIGHT 1080
/****************************************************************************
 * local variables                                                            *
 ****************************************************************************/

static HI_U16 g_au16InitWBGain[ISP_MAX_DEV_NUM][3] = {{0}};
static HI_U16 g_au16SampleRgain[ISP_MAX_DEV_NUM] = {0};
static HI_U16 g_au16SampleBgain[ISP_MAX_DEV_NUM] = {0};

extern const unsigned int sensor_i2c_addr;
extern unsigned int sensor_addr_byte;
extern unsigned int sensor_data_byte;
#define FULL_LINES_MAX  (0x3FFFF)
#define FULL_LINES_MAX_2TO1_WDR (0x8AA)

/*****Imx307 Register Address*****/
#define SHS1_ADDR (0x3020)
#define SHS2_ADDR (0x3024)
#define GAIN_ADDR (0x3014)
#define HCG_ADDR  (0x3009)
#define VMAX_ADDR (0x3018)
#define HMAX_ADDR (0x301c)
#define RHS1_ADDR (0x3030)
#define RHS2_ADDR (0x3034)
#define Y_OUT_SIZE_ADDR (0x3418)

#define INCREASE_LINES (1) /* make real fps less than stand fps because NVR require*/
#define IMX307_VMAX_1080P30_LINEAR  (1125+INCREASE_LINES)
//#define IMX307_VMAX_1080P60TO30_WDR (1125+INCREASE_LINES)
#define IMX307_VMAX_1080P60TO30_WDR (1350+INCREASE_LINES)
#define IMX307_VMAX_1080P120TO30_WDR (1125+INCREASE_LINES)

/* sensor fps mode */
#define IMX307_SENSOR_1080P_30FPS_LINEAR_MODE  (1)
#define IMX307_SENSOR_1080P_30FPS_WDR_MODE     (2)
#define IMX307_SENSOR_1080P_60FPS_WDR_MODE     (3)

/* global variables */
static HI_BOOL bInit = HI_FALSE;
HI_BOOL bSensorInit = HI_FALSE;

static HI_U8 gu8HCGReg = 0x2;
HI_U8 gu8SensorImageMode = IMX307_SENSOR_1080P_30FPS_LINEAR_MODE;
HI_U8 genSensorMode = WDR_MODE_NONE;

static HI_U32 gu32BRL = 1109;
static HI_U32 gu32RHS1_Max = (IMX307_VMAX_1080P60TO30_WDR - 1109) * 2 - 21;
static HI_U32 gu32FullLinesStd = IMX307_VMAX_1080P30_LINEAR;
static HI_U32 gu32FullLines = IMX307_VMAX_1080P30_LINEAR;
static HI_U32 gu32PreFullLines = IMX307_VMAX_1080P30_LINEAR;

ISP_SNS_REGS_INFO_S g_stSnsRegsInfo = {0};
ISP_SNS_REGS_INFO_S g_stPreSnsRegsInfo = {0};

static HI_U32 au32WDRIntTime[4] = {0};
static ISP_FSWDR_MODE_E genFSWDRMode = ISP_FSWDR_NORMAL_MODE;
static HI_U32 gu32MaxTimeGetCnt = 0;

/* Piris attr */
static ISP_PIRIS_ATTR_S gstPirisAttr=
{
    0      // bStepFNOTableChange
    1      // bZeroIsMax
    94     // u16TotalStep
    62     // u16StepCount
    /* Step-F number mapping table. Must be from small to large. F1.0 is 1024 and F32.0 is 1 */
    {303540455056616773798592981051121201271351431501581661741831912002082172252342432522612702792892983

评论

共有 条评论