📄 ov2630_hw.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//
/*
** INTEL CONFIDENTIAL
** Copyright 2000-2006 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors. Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.
**
** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
*/
/*++
Module Name: $Workfile: xllp_ov2630_hw.h $
Abstract:
contains all OV2630 specific macros, typedefs, and prototypes.
Declares no storage.
Notes:Only valid for processor code named Monahans.
--*/
//#include "BSP_CommonDefs.h"
#ifndef _PXA_OV2630_HW_H__
#define _PXA_OV2630_HW_H__
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************
*
* Constants & Structures
*
**********************************************************************/
// Revision constants
#define PIDH_OV2630 0x26
#define PIDL_OV2630 0x33
// Return codes
#define OV_ERR_NONE 0x00
#define OV_ERR_TIMEOUT -1
#define OV_ERR_PARAMETER -2
#define OV_COMM_ERR -3
/*OV2630 Mode*/
typedef enum {
OV2630_UXGA = 0,
OV2630_CIF,
OV2630_SVGA,
OV2630_INVALID
}OV2630_MODE;
// Camera Mode
#define VIEWFINDER_MODE 0x10
#define STILLFRAME_MODE 0x20
// Others
#define OV2630_TIMEOUT 1000 // ms to timeout.
#define OV2630_GAIN 0x00 // AGC Gain Control
#define OV2630_BLUE_GAIN 0x01 // Blue Gain Control
#define OV2630_RED_GAIN 0x02 // Red Gain Control
#define OV2630_COMA 0x03 // Common Control A
#define OV2630_COMB 0x04 // Common Control B
#define OV2630_BAVG 0x05 // B Channel Average
#define OV2630_GbAVE 0x06 // G Channel Average - Picked G pixels in the same line with B pixels
#define OV2630_GrAVE 0x07 // G Channel Average - Picked G pixels in the same line with R pixels
#define OV2630_RAVG 0x08 // R Channel Average
#define OV2630_COMC 0x09 // Common control C
#define OV2630_PIDH 0x0A // Product ID Number MSBs
#define OV2630_PIDL 0x0B // Product ID Number LSBs
#define OV2630_COMD 0x0C // Common control D
#define OV2630_COME 0x0D // Common control E
#define OV2630_COMF 0x0E // Common control F
#define OV2630_COMG 0x0F // Common control G
#define OV2630_AEC 0x10 // Automatic Exposure [10:3]
#define OV2630_CLKRC 0x11 // Clock Rate Control
#define OV2630_COMH 0x12 // Common Control H
#define OV2630_COMI 0x13 // Common control I
#define OV2630_COMJ 0x14 // Common Control J
#define OV2630_COMK 0x15 // Common Control K
#define OV2630_HREFST 0x17 // Horizontal Window Start
#define OV2630_HREFEND 0x18 // Horizontal window End
#define OV2630_VSTRT 0x19 // Vertical Window Line Start
#define OV2630_VEND 0x1A // Vertical Window Line End
#define OV2630_PSHFT 0x1B // Pixel Shift
#define OV2630_MIDH 0x1C // Manufacturer ID Byte - High
#define OV2630_MIDL 0x1D // Manufacturer ID Byte - Low
#define OV2630_BOFF 0x20 // B Channel Offset Adjustment
#define OV2630_GbOFF 0x21 // Gb Channel Offset Adjustment
#define OV2630_GrOFF 0x22 // Gr Channel Offset Adjustment
#define OV2630_ROFF 0x23 // R Channel Offset Adjustment
#define OV2630_AEW 0x24 // Luminance Signal High Range for AEC/AGC Operation
#define OV2630_AEB 0x25 // Luminance Signal Low Range for AEC/AGC Operation
#define OV2630_VV 0x26 // Fast Mode Large Step Range Threshold
#define OV2630_BBIAS 0x27 // B Channel Offset Manual Adjustment Value
#define OV2630_GbBIAS 0x28 // Gb Channel Offset Manual Adjustment Value
#define OV2630_GrBIAS 0x29 // Gr Channel Offset Manual Adjustment Value
#define OV2630_COML 0x2A // Common Control L
#define OV2630_FRARL 0x2B // Line Interval Adjustment Value LSB 8 bits
#define OV2630_RBIAS 0x2C // R Channel Offset Manual Adjustment Value
#define OV2630_ADVSL 0x2D // VSYNC Pulse Width LSB 8 bits
#define OV2630_ADVSH 0x2E // VSYNC Pulse Width MSB 8 bits
#define OV2630_YAVG 0x2F // Luminance Average
#define OV2630_HSDY 0x30 // HSYNC Position and Width Start Point LSB 8 bits
#define OV2630_HENY 0x31 // HSYNC Position and Width End Lower 8 bits
#define OV2630_COMM 0x32 // Common Control M
#define OV2630_REG33 0x33 // Current Control
#define OV2630_VCHG 0x36 // Sensor Precharge Voltage Control
#define OV2630_ADC 0x37 // ADC Reference Control
#define OV2630_ACOM 0x38 // Analog Common Control
#define OV2630_REG39 0x39 // R39
#define OV2630_REG3A 0x3A // Sensor Internal Reference Control
#define OV2630_REG3C 0x3C // Sensor Internal Reference Control
#define OV2630_DKOFFBR 0x3E // Gb/Gr Channel Manual Offset Compensation
#define OV2630_REG3F 0x3F // Sensor Offset Control
#define OV2630_BBLC 0x40 // B Channel Black Level Value
#define OV2630_RBLC 0x41 // R Channel Black Level Value
#define OV2630_GbBLC 0x42 // Gb Channel Black Level Value
// End of OV2630 register
#define OV2630_REGEND ( 0x8D + 1 )
/**********************************************************************
*
* Function Prototype
*
**********************************************************************/
PXA_STATUS_T OV2630SetRegs( const UINT8 *regP );
PXA_STATUS_T OV2630ReadAllRegs( UINT8 *bufP, UINT32 numRegs );
void OV2630PowerDown(UINT8 powerMode );
void OV2630Reset(void);
void OV2630Wait( int ms );
int OV2630VersionRevision(UINT8 * pCmRevision, UINT8 *pSensorRevision);
void OV2630SetHSYNC(void);
void OV2630AutoFunctionOn(void);
void OV2630AutoFunctionOff(void);
int OV2630ViewfinderOn(void);
int OV2630ViewfinderOff(void);
int OV2630HaltVideoOutput(void);
int OV2630ResumetoFullOutputMode(void);
int OV2630GetSingleImage(void);
PXA_STATUS_T OV2630SetFormat(UINT32 captureWidth,
UINT32 captureHeight,
UINT32 *winStartX,
UINT32 *winStartY,
UINT32 *winEndX,
UINT32 *winEndY);
int OV2630ReadSensorReg( const UINT8 subAddress, UINT8 *bufP );
int OV2630WriteSensorReg( const UINT8 subAddress, UINT8 *bufP );
PXA_STATUS_T OV2630SetContrast(UINT32 value);
PXA_STATUS_T OV2630SetExposure(UINT32 value);
PXA_STATUS_T OV2630SetWhiteBalance(UINT32 value);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -