📄 sensor.c
字号:
/*************************************************************************/
/* FILE NAME : 346app.c */
/* VERSION : 0.9 */
/* DATE : 2003. 05. 13 */
/* DESCRIPTION */
/* Basic Library Functions for CLC346 */
/* */
/* DATA STRUCTURES */
/* */
/* FUNCTIONS : Basic Library Functions for CLC346 Sensor Handling. */
/* Refer to clc346i.h */
/* DEPENDENCIES */
/* */
/* Revision History : */
/* 2003.05.13 kbs : First Revised */
/* */
/*************************************************************************/
#include "portab_new.h"
#include "camconfig.h"
#include "346reg.h"
/////////////////////////////////////////////////////////////////////////////////
void IIC_Write(U16 Addr, U16 Data)
{
CamSensorAccessAddressPointer(Addr); //0x29
CamSensorAccessDataPointer(Data); //0x2A
WaitTime_us(300000);
}
void IIC_Read(U16 Addr, U16 *Data)
{
CamSensorAccessAddressPointer(Addr);
WaitTime_us(300000);
ReadAsicCommand_Escape(CISACCEDATA,Data);
}
#if(defined(HYNIX_7131))
UINT16 sensorid;
void CamSensorInit(void)
{
CamInputPixelRatio(0); //0x23
CamVsyncShapeRegister(0, 0); //0x2b
CamInputClockControl(1, 0); //0x25
CamIICClockDirectionRegister(0); //0x27
CamSensorIICID(0x22);
CamSensorAccessControl(1, 0, 0); //0x28 1byteData 1byteAddress write
CamSensorPowerSupply(HIGH);
WaitTime_us(50000);
IIC_Write( 0x01,0x03 );
IIC_Write( 0x6a,0x01 );
IIC_Write( 0x6b,0x86 );
IIC_Write( 0x6c,0xa0 );
IIC_Write( 0x6d,0x06 );
IIC_Write( 0x6e,0x1a );
IIC_Write( 0x6f,0x80 );
IIC_Write( 0x60,0xbd );
IIC_Write(0x66,0x60);
IIC_Write( 0x12,0x02);
CamSensorAccessControl(1, 0, 1);
IIC_Read(0x0,&sensorid);
sensorid = sensorid & 0xff;
CamSensorAccessControl(1, 0, 0);
}
void CamChangeBright(UINT8 Data)
{
IIC_Write(0x66,Data);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -