//ov8825 the same with ov14825
/******************************************************************************
*
* Copyright 2010, Dream Chip Technologies GmbH. All rights reserved.
* No part of this work may be reproduced, modified, distributed, transmitted,
* transcribed, or translated into any language or computer format, in any form
* or by any means without written permission of:
* Dream Chip Technologies GmbH, Steinriede 10, 30827 Garbsen / Berenbostel,
* Germany
*
*****************************************************************************/
/**
* @file XC6130.c
*
* @brief
* ADD_DESCRIPTION_HERE
*
*****************************************************************************/
#include <ebase/types.h>
#include <ebase/trace.h>
#include <ebase/builtins.h>
#include <common/return_codes.h>
#include <common/misc.h>
#include "isi.h"
#include "isi_iss.h"
#include "isi_priv.h"
#include "XC6130_priv.h"
#define CC_OFFSET_SCALING 2.0f
#define I2C_COMPLIANT_STARTBIT 1U
/******************************************************************************
* local macro definitions
*****************************************************************************/
CREATE_TRACER( XC6130_INFO , "XC6130: ", INFO, 1U );
CREATE_TRACER( XC6130_WARN , "XC6130: ", WARNING, 1U );
CREATE_TRACER( XC6130_ERROR, "XC6130: ", ERROR, 1U );
CREATE_TRACER( XC6130_DEBUG, "XC6130: ", INFO, 1U );
CREATE_TRACER( XC6130_REG_INFO , "XC6130: ", INFO, 1);
CREATE_TRACER( XC6130_REG_DEBUG, "XC6130: ", INFO, 0U );
#define XC6130_SLAVE_ADDR 0x36U //0x20 /**< i2c slave address of the XC6130 camera sensor */
#define XC6130_SLAVE_ADDR2 0x20
#define XC6130_SLAVE_AF_ADDR 0x00U /**< i2c slave address of the XC6130 integrated AD5820 */
/******************************************************************************
* local variable declarations
*****************************************************************************/
const char XC6130_g_acName[] = "XC6130_ SOC_PARREL";
extern const IsiRegDescription_t XC6130_g_aRegDescription[];
extern const IsiRegDescription_t OV2710_g_aRegDescription[];
extern const IsiRegDescription_t XC6130_bypass_off[];
extern const IsiRegDescription_t XC6130_bypass_on[];
//extern const IsiRegDescription_t XC6130_g_svga[];
//extern const IsiRegDescription_t XC6130_g_1600x1200[];
const IsiSensorCaps_t XC6130_g_IsiSensorDefaultConfig;
#define XC6130_I2C_START_BIT (I2C_COMPLIANT_STARTBIT) // I2C bus start condition
#define XC6130_I2C_NR_ADR_BYTES (2U) // 1 byte base address and 2 bytes sub address
#define XC6130_I2C_NR_DAT_BYTES (1U) // 8 bit registers
static uint16_t g_suppoted_mipi_lanenum_type = SUPPORT_MIPI_TWO_LANE;
#define DEFAULT_NUM_LANES SUPPORT_MIPI_TWO_LANE
/******************************************************************************
* local function prototypes
*****************************************************************************/
static RESULT XC6130_IsiCreateSensorIss( IsiSensorInstanceConfig_t *pConfig );
static RESULT XC6130_IsiReleaseSensorIss( IsiSensorHandle_t handle );
static RESULT XC6130_IsiGetCapsIss( IsiSensorHandle_t handle, IsiSensorCaps_t *pIsiSensorCaps );
static RESULT XC6130_IsiSetupSensorIss( IsiSensorHandle_t handle, const IsiSensorConfig_t *pConfig );
static RESULT XC6130_IsiSensorSetStreamingIss( IsiSensorHandle_t handle, bool_t on );
static RESULT XC6130_IsiSensorSetPowerIss( IsiSensorHandle_t handle, bool_t on );
static RESULT XC6130_IsiCheckSensorConnectionIss( IsiSensorHandle_t handle );
static RESULT XC6130_IsiGetSensorRevisionIss( IsiSensorHandle_t handle, uint32_t *p_value);
static RESULT XC6130_IsiGetGainLimitsIss( IsiSensorHandle_t handle, float *pMinGain, float *pMaxGain);
static RESULT XC6130_IsiGetIntegrationTimeLimitsIss( IsiSensorHandle_t handle, float *pMinIntegrationTime, float *pMaxIntegrationTime );
static RESULT XC6130_IsiExposureControlIss( IsiSensorHandle_t handle, float NewGain, float NewIntegrationTime, uint8_t *pNumberOfFramesToSkip, float *pSetGain, float *pSetIntegrationTime );
static RESULT XC6130_IsiGetCurrentExposureIss( IsiSensorHandle_t handle, float *pSetGain, float *pSetIntegrationTime );
static RESULT XC6130_IsiGetAfpsInfoIss ( IsiSensorHandle_t handle, uint32_t Resolution, IsiAfpsInfo_t* pAfpsInfo);
static RESULT XC6130_IsiGetGainIss( IsiSensorHandle_t handle, float *pSetGain );
static RESULT XC6130_IsiGetGainIncrementIss( IsiSensorHandle_t handle, float *pIncr );
static RESULT XC6130_IsiSetGainIss( IsiSensorHandle_t handle, float NewGain, float *pSetGain );
static RESULT XC6130_IsiGetIntegrationTimeIss( IsiSensorHandle_t handle, float *pSetIntegrationTime );
static RESULT XC6130_IsiGetIntegrationTimeIncrementIss( IsiSensorHandle_t handle, float *pIncr );
static RESULT XC6130_IsiSetIntegrationTimeIss( IsiSensorHandle_t handle, float NewIntegrationTime, float *pSetIntegrationTime, uint8_t *pNumberOfFramesToSkip );
static RESULT XC6130_IsiGetResolutionIss( IsiSensorHandle_t handle, uint32_t *pSetResolution );
static RESULT XC6130_IsiRegReadIss( IsiSensorHandle_t handle, const uint32_t address, uint32_t *p_value );
static RESULT XC6130_IsiRegWriteIss( IsiSensorHandle_t handle, const uint32_t address, const uint32_t value );
static RESULT XC6130_IsiGetCalibKFactor( IsiSensorHandle_t handle, Isi1x1FloatMatrix_t **pIsiKFactor );
static RESULT XC6130_IsiGetCalibPcaMatrix( IsiSensorHandle_t handle, Isi3x2FloatMatrix_t **pIsiPcaMatrix );
static RESULT XC6130_IsiGetCalibSvdMeanValue( IsiSensorHandle_t handle, Isi3x1FloatMatrix_t **pIsiSvdMeanValue );
static RESULT XC6130_IsiGetCalibCenterLine( IsiSensorHandle_t handle, IsiLine_t **ptIsiCenterLine);
static RESULT XC6130_IsiGetCalibClipParam( IsiSensorHandle_t handle, IsiAwbClipParm_t **pIsiClipParam );
static RESULT XC6130_IsiGetCalibGlobalFadeParam( IsiSensorHandle_t handle, IsiAwbGlobalFadeParm_t **ptIsiGlobalFadeParam);
static RESULT XC6130_IsiGetCalibFadeParam( IsiSensorHandle_t handle, IsiAwbFade2Parm_t **ptIsiFadeParam);
static RESULT XC6130_IsiGetIlluProfile( IsiSensorHandle_t handle, const uint32_t CieProfile, IsiIlluProfile_t **ptIsiIlluProfile );
static RESULT XC6130_IsiMdiInitMotoDriveMds( IsiSensorHandle_t handle );
static RESULT XC6130_IsiMdiSetupMotoDrive( IsiSensorHandle_t handle, uint32_t *pMaxStep );
static RESULT XC6130_IsiMdiFocusSet( IsiSensorHandle_t handle, const uint32_t Position );
static RESULT XC6130_IsiMdiFocusGet( IsiSensorHandle_t handle, uint32_t *pAbsStep );
static RESULT XC6130_IsiMdiFocusCalibrate( IsiSensorHandle_t handle );
static RESULT XC6130_IsiGetSensorMipiInfoIss( IsiSensorHandle_t handle, IsiSensorMipiInfo *ptIsiSensorMipiInfo);
static RESULT XC6130_IsiGetSensorIsiVersion( IsiSensorHandle_t handle, unsigned int* pVersion);
/*****************************************************************************/
/**
* XC6130_IsiRegReadIss
*
* @brief grants user read access to the camera register
*
* @param handle pointer to sensor description struct
* @param address sensor register to write
* @param p_value pointer to value
*
* @return Return the result of the function call.
* @retval RET_SUCCESS
* @retval RET_WRONG_HANDLE
* @retval RET_NULL_POINTER
*
*****************************************************************************/
static RESULT OV2710_IsiRegReadIss
(
IsiSensorHandle_t handle,
const uint32_t address,
uint32_t *p_value
)
{
IsiSensorContext_t *pSensorCtx = (IsiSensorContext_t *)handle;
pSensorCtx->SlaveAddress = 0x6c;
RESULT result = RET_SUCCESS;
//ALOGD("------------------------test%s-------------------", __func__);
// TRACE( XC6130_INFO, "%s (enter)\n", __FUNCTION__);
if ( pSensorCtx == NULL )
{
return ( RET_WRONG_HANDLE );
}
if ( p_value == NULL )
{
return ( RET_NULL_POINTER );
xc6130_ov2710_driver.tar.gz_RK3288_android_ov2710_xc6130
版权申诉
5星 · 超过95%的资源 2 浏览量
2022-07-14
16:07:43
上传
评论
收藏 26KB GZ 举报
钱亚锋
- 粉丝: 90
- 资源: 1万+
最新资源
- IMG_20240529_122750.jpg
- 基于Java的职工工资管理系统设计源码 - salary management system
- 张律师〈人民路街道)-2405291432.awb
- Editplus 4GL Progress 高亮配色方案
- 回调函数的定义和应用场景
- meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的3/3
- 基于Javascript和微信小程序的CC校友名片小程序设计源码 - CC校友名片小程序
- docker-ce-cli-18.09.6-3.el7.x86-64.rpm
- 基于自回归移动平均模型建立风电功率预测模型,利用区间分布表征预测误差的分布,通过Matlab实现模型表达和仿真程序,最终通过仿真
- Test_IOStream.java
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈