mirror of
https://github.com/thead-yocto-mirror/vi-sensor
synced 2026-06-21 08:52:36 +02:00
242 lines
9.2 KiB
C
242 lines
9.2 KiB
C
/******************************************************************************\
|
|
|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *|
|
|
|* All Rights Reserved. *|
|
|
|* *|
|
|
|* The material in this file is confidential and contains trade secrets of *|
|
|
|* of VeriSilicon. This is proprietary information owned or licensed by *|
|
|
|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *|
|
|
|* transmitted, or used in any way for any purpose, without the express *|
|
|
|* written permission of VeriSilicon. *|
|
|
|* *|
|
|
\******************************************************************************/
|
|
/**
|
|
* @file GC02M1B_priv.h
|
|
*
|
|
* @brief Interface description for image sensor specific implementation (iss).
|
|
*
|
|
*****************************************************************************/
|
|
/**
|
|
* @page module_name_page Module Name
|
|
* Describe here what this module does.
|
|
*
|
|
* For a detailed list of functions and implementation detail refer to:
|
|
* - @ref module_name
|
|
*
|
|
* @defgroup GC02M1B_priv
|
|
* @{
|
|
*
|
|
*/
|
|
#ifndef __GC02M1B_PRIV_H__
|
|
#define __GC02M1B_PRIV_H__
|
|
|
|
#include <ebase/types.h>
|
|
#include <common/return_codes.h>
|
|
#include <hal/hal_api.h>
|
|
#include <isi/isi_common.h>
|
|
#include "vvsensor.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
* SC control registers
|
|
*****************************************************************************/
|
|
#define GC02M1B_PIDH (0x300A) //R - Product ID High Byte MSBs
|
|
#define GC02M1B_PIDL (0x300B) //R - Product ID Low Byte LSBs
|
|
|
|
/*****************************************************************************
|
|
* Default values
|
|
*****************************************************************************/
|
|
|
|
// Make sure that these static settings are reflecting the capabilities defined
|
|
// in IsiGetCapsIss (further dynamic setup may alter these default settings but
|
|
// often does not if there is no choice available).
|
|
|
|
/*****************************************************************************
|
|
* SC control registers
|
|
*****************************************************************************/
|
|
#define GC02M1B_PIDH_DEFAULT (0x27) //read only
|
|
#define GC02M1B_PIDL_DEFAULT (0x70) //read only
|
|
|
|
typedef struct GC02M1B_Context_s
|
|
{
|
|
IsiSensorContext_t IsiCtx; /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
|
|
|
|
struct vvcam_mode_info SensorMode;
|
|
uint32_t KernelDriverFlag;
|
|
char SensorRegCfgFile[128];
|
|
|
|
uint32_t HdrMode;
|
|
uint32_t Resolution;
|
|
uint32_t MaxFps;
|
|
uint32_t MinFps;
|
|
uint32_t CurrFps;
|
|
//// modify below here ////
|
|
|
|
IsiSensorConfig_t Config; /**< sensor configuration */
|
|
bool_t Configured; /**< flags that config was applied to sensor */
|
|
bool_t Streaming; /**< flags that csensor is streaming data */
|
|
bool_t TestPattern; /**< flags that sensor is streaming test-pattern */
|
|
|
|
bool_t isAfpsRun; /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
|
|
|
|
float one_line_exp_time;
|
|
uint16_t MaxIntegrationLine;
|
|
uint16_t MinIntegrationLine;
|
|
uint32_t gain_accuracy;
|
|
|
|
uint16_t FrameLengthLines; /**< frame line length */
|
|
uint16_t CurFrameLengthLines;
|
|
|
|
float AecMinGain;
|
|
float AecMaxGain;
|
|
float AecMinIntegrationTime;
|
|
float AecMaxIntegrationTime;
|
|
|
|
float AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
|
|
float AecGainIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
|
|
|
|
float AecCurIntegrationTime;
|
|
float AecCurVSIntegrationTime;
|
|
float AecCurLongIntegrationTime;
|
|
float AecCurGain;
|
|
float AecCurVSGain;
|
|
float AecCurLongGain;
|
|
|
|
uint32_t LastExpLine;
|
|
uint32_t LastVsExpLine;
|
|
uint32_t LastLongExpLine;
|
|
|
|
uint32_t LastGain;
|
|
uint32_t LastVsGain;
|
|
uint32_t LastLongGain;
|
|
|
|
bool GroupHold;
|
|
uint32_t OldGain;
|
|
uint32_t OldVsGain;
|
|
uint32_t OldIntegrationTime;
|
|
uint32_t OldVsIntegrationTime;
|
|
uint32_t OldGainHcg;
|
|
uint32_t OldAGainHcg;
|
|
uint32_t OldGainLcg;
|
|
uint32_t OldAGainLcg;
|
|
int subdev;
|
|
uint8_t pattern;
|
|
|
|
float CurHdrRatio;
|
|
} GC02M1B_Context_t;
|
|
|
|
static RESULT GC02M1B_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
|
|
pConfig);
|
|
|
|
static RESULT GC02M1B_IsiInitSensorIss(IsiSensorHandle_t handle);
|
|
|
|
static RESULT GC02M1B_IsiReleaseSensorIss(IsiSensorHandle_t handle);
|
|
|
|
static RESULT GC02M1B_IsiGetCapsIss(IsiSensorHandle_t handle,
|
|
IsiSensorCaps_t * pIsiSensorCaps);
|
|
|
|
static RESULT GC02M1B_IsiSetupSensorIss(IsiSensorHandle_t handle,
|
|
const IsiSensorConfig_t *
|
|
pConfig);
|
|
|
|
static RESULT GC02M1B_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
|
|
bool_t on);
|
|
|
|
static RESULT GC02M1B_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
|
|
bool_t on);
|
|
|
|
static RESULT GC02M1B_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
|
|
uint32_t * p_value);
|
|
|
|
static RESULT GC02M1B_IsiSetBayerPattern(IsiSensorHandle_t handle,
|
|
uint8_t pattern);
|
|
|
|
static RESULT GC02M1B_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
|
|
float *pMinGain,
|
|
float *pMaxGain);
|
|
|
|
static RESULT GC02M1B_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
|
|
handle,
|
|
float
|
|
*pMinIntegrationTime,
|
|
float
|
|
*pMaxIntegrationTime);
|
|
|
|
static RESULT GC02M1B_IsiExposureControlIss(IsiSensorHandle_t handle,
|
|
float NewGain,
|
|
float NewIntegrationTime,
|
|
uint8_t *
|
|
pNumberOfFramesToSkip,
|
|
float *pSetGain,
|
|
float *pSetIntegrationTime,
|
|
float *hdr_ratio);
|
|
|
|
static RESULT GC02M1B_IsiGetGainIss(IsiSensorHandle_t handle,
|
|
float *pSetGain);
|
|
|
|
static RESULT GC02M1B_IsiGetVSGainIss(IsiSensorHandle_t handle,
|
|
float *pSetGain);
|
|
|
|
static RESULT GC02M1B_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
|
|
float *pIncr);
|
|
|
|
static RESULT GC02M1B_IsiSetGainIss(IsiSensorHandle_t handle,
|
|
float NewGain, float *pSetGain,
|
|
float *hdr_ratio);
|
|
|
|
static RESULT GC02M1B_IsiSetVSGainIss(IsiSensorHandle_t handle,
|
|
float NewIntegrationTime,
|
|
float NewGain, float *pSetGain,
|
|
float *hdr_ratio);
|
|
|
|
static RESULT GC02M1B_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
|
|
float
|
|
*pSetIntegrationTime);
|
|
|
|
static RESULT GC02M1B_IsiGetVSIntegrationTimeIss(IsiSensorHandle_t
|
|
handle,
|
|
float
|
|
*pSetIntegrationTime);
|
|
|
|
static RESULT GC02M1B_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
|
|
float *pIncr);
|
|
|
|
static RESULT GC02M1B_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
|
|
float NewIntegrationTime,
|
|
float
|
|
*pSetIntegrationTime,
|
|
uint8_t *
|
|
pNumberOfFramesToSkip,
|
|
float *hdr_ratio);
|
|
|
|
static RESULT GC02M1B_IsiSetVSIntegrationTimeIss(IsiSensorHandle_t
|
|
handle,
|
|
float
|
|
NewIntegrationTime,
|
|
float
|
|
*pSetIntegrationTime,
|
|
uint8_t *
|
|
pNumberOfFramesToSkip,
|
|
float *hdr_ratio);
|
|
|
|
RESULT GC02M1B_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
|
|
|
|
static RESULT GC02M1B_IsiResetSensorIss(IsiSensorHandle_t handle);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/* @} GC02M1Bpriv */
|
|
|
|
#endif /* __GC02M1BPRIV_H__ */
|
|
|