⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ov7660_hw.c

📁 wince 6.0 摄像头(ov7670)驱动,已在ce6测试通过
💻 C
📖 第 1 页 / 共 5 页
字号:
//
// 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_ov7660_hw.c $

Abstract:  
     contains all hardware related functions for OV7660

Notes:Only valid for processor code named Monahans.

--*/

//#include "xllp_camera_os_depend.h"
#include "Camera_SOC.h"
#include "ost.h"
#include "ov7660_hw.h"
#include "GPX_API.h"
#include "I2C_DRV.h"

//#include "BSP_CommonDefs.h"

UINT8 bg = 0x80;
UINT8 rg = 0x24;

/***********************************************************************
*  Attention: This is platform related!
***********************************************************************/


/***********************************************************************
*  Register Settings
***********************************************************************/
const static UINT8 gRAW_CIF_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x81,
    0x9e, 0x29,
    0x3b, 0x02,
    0x13, 0xf2,
    0x00, 0x00,
    0x10, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x25,
    0x04, 0x00,
    0x0c, 0x04,
    0x18, 0x7c,
    0x17, 0x24,
    0x32, 0xbf,
    0x1a, 0x4a,
    0x19, 0x02,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x02,
    0x34, 0x00,
    0x35, 0x84,
    0x36, 0x03,
    0x38, 0x13,
    0x39, 0x43,
    0x3c, 0x28,
    0x3d, 0x19,
    0x40, 0xc1,
    0x69, 0x80,
    0x6b, 0x0d,
    0xa1, 0x08,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x14, 0x2e,
    0x25, 0x58,
    0x24, 0x68,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRAW_QCIF_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x81,
    0x9e, 0x29,
    0x3b, 0x02,
    0x13, 0xf2,
    0x00, 0x00,
    0x10, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x0d,
    0x04, 0x04,
    0x0c, 0x0c,
    0x18, 0x7c,
    0x17, 0x24,
    0x32, 0xbf,
    0x1a, 0x4a,
    0x19, 0x02,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x02,
    0x34, 0x00,
    0x35, 0x84,
    0x36, 0x03,
    0x38, 0x13,
    0x39, 0x43,
    0x3c, 0x28,
    0x3d, 0x19,
    0x40, 0xc1,
    0x69, 0x80,
    0x6b, 0x0d,
    0xa1, 0x08,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x14, 0x2e,
    0x25, 0x58,
    0x24, 0x68,
    0x2a, 0x30,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRAW_QQCIF_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x81,
    0x9e, 0x29,
    0x3b, 0x02,
    0x13, 0xf2,
    0x00, 0x00,
    0x10, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x0d,
    0x04, 0x24,
    0x0c, 0x0c,
    0x18, 0x7c,
    0x17, 0x24,
    0x32, 0xbf,
    0x1a, 0x4a,
    0x19, 0x02,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x02,
    0x34, 0x00,
    0x35, 0x84,
    0x36, 0x03,
    0x38, 0x13,
    0x39, 0x43,
    0x3c, 0x28,
    0x3d, 0x19,
    0x40, 0xc1,
    0x69, 0x80,
    0x6b, 0x0f,
    0xa1, 0x08,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x14, 0x2e,
    0x25, 0x58,
    0x24, 0x68,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRAW_QQVGA_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x83,
    0x9e, 0x29,
    0x3b, 0x02,
    0x13, 0xf2,
    0x00, 0x00,
    0x10, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x15,
    0x04, 0x24,
    0x0c, 0x0c,
    0x18, 0x4a,
    0x17, 0x22,
    0x32, 0x92,
    0x19, 0x02,
    0x1a, 0x7a,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x34, 0x07,
    0x35, 0x84,
    0x36, 0x00,
    0x38, 0x13,
    0x39, 0x43,
    0x3c, 0x68,
    0x3d, 0x19,
    0x40, 0xc1,
    0x69, 0x80,
    0x6b, 0x0a,
    0xa1, 0x08,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x14, 0x4e,
    0x25, 0x58,
    0x24, 0x68,
    0x92, 0xd8,
    0x93, 0x01,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRAW_QVGA_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x83,
    0x9e, 0x29,
    0x3b, 0x02,
    0x13, 0xf2,
    0x00, 0x00,
    0x10, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x15,
    0x04, 0x00,
    0x0c, 0x04,
    0x18, 0x4a,
    0x17, 0x22,
    0x32, 0x89,
    0x19, 0x02,
    0x1a, 0x7a,
    0x03, 0x05,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x00,
    0x34, 0x07,
    0x35, 0x84,
    0x36, 0x00,
    0x38, 0x13,
    0x39, 0x43,
    0x3c, 0x68,
    0x3d, 0x19,
    0x40, 0xc1,
    0x69, 0x80,
    0x6b, 0x0a,
    0xa1, 0x08,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x14, 0x2e,
    0x25, 0x58,
    0x24, 0x68,
    0x92, 0x48,
    0x93, 0x00,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRAW_VGA_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x81,
    0x9e, 0x3f,
    0x3b, 0x02,
    0x13, 0xf2,
    0x00, 0x00,
    0x10, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x05,
    0x04, 0x00,
    0x0c, 0x00,
    0x18, 0x61,
    0x17, 0x11,
    0x32, 0x89,
    0x19, 0x02,
    0x1a, 0x7a,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x00,
    0x34, 0x07,
    0x35, 0x84,
    0x36, 0x00,
    0x38, 0x13,
    0x39, 0x43,
    0x3c, 0x68,
    0x3d, 0x19,
    0x40, 0xc1,
    0x69, 0x80,
    0x6b, 0x0a,
    0xa1, 0x08,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x14, 0x2e,
    0x25, 0x58,
    0x24, 0x68,
    0x2a, 0x10,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRGB565_CIF_15fps_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x81,
    0x92, 0x48,
    0x93, 0x00,
    0x9d, 0x31,
    0x9e, 0x29,
    0x3b, 0x02,
    0x13, 0xf2,
    0x10, 0x00,
    0x00, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x24,
    0x04, 0x00,
    0x18, 0x80,
    0x17, 0x28,
    0x32, 0x12,
    0x19, 0x02,
    0x1a, 0x7a,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x16, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x02,
    0x34, 0x00,
    0x35, 0x84,
    0x36, 0x03,
    0x38, 0x13,
    0x39, 0x43,
    0x3a, 0x00,
    0x3c, 0x6c,
    0x3d, 0x90,
    0x3f, 0x29,
    0x40, 0xd1,
    0x41, 0x20,
    0x6b, 0x0f,
    0xa1, 0xc8,
    0x69, 0x80,
    0x43, 0xf0,
    0x44, 0x10,
    0x45, 0x78,
    0x46, 0xa8,
    0x47, 0x60,
    0x48, 0x80,
    0x59, 0xba,
    0x5a, 0x9a,
    0x5b, 0x22,
    0x5c, 0xb9,
    0x5d, 0x9b,
    0x5e, 0x10,
    0x5f, 0xe0,
    0x60, 0x85,
    0x61, 0x60,
    0x9f, 0x9d,
    0xa0, 0xa0,
    0x4f, 0xae,
    0x50, 0x26,
    0x51, 0x08,
    0x52, 0x1a,
    0x53, 0xa9,
    0x54, 0x0f,
    0x55, 0x05,
    0x56, 0x46,
    0x57, 0xcb,
    0x58, 0x77,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x6c, 0x40,
    0x6d, 0x30,
    0x6e, 0x4b,
    0x6f, 0x60,
    0x70, 0x70,
    0x71, 0x70,
    0x72, 0x70,
    0x73, 0x70,
    0x74, 0x60,
    0x75, 0x60,
    0x76, 0x50,
    0x77, 0x48,
    0x78, 0x3a,
    0x79, 0x2e,
    0x7a, 0x28,
    0x7b, 0x22,
    0x7c, 0x04,
    0x7d, 0x07,
    0x7e, 0x10,
    0x7f, 0x28,
    0x80, 0x36,
    0x81, 0x44,
    0x82, 0x52,
    0x83, 0x60,
    0x84, 0x6c,
    0x85, 0x78,
    0x86, 0x8c,
    0x87, 0x9e,
    0x88, 0xbb,
    0x89, 0xd2,
    0x8a, 0xe6,
    0x14, 0x2e,
    0x24, 0x68,
    0x25, 0x58,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRGB565_CIF_5fps_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x82,
    0x92, 0x48,
    0x93, 0x01,
    0x9d, 0x21,
    0x9e, 0x1b,
    0x3b, 0x02,
    0x13, 0xf2,
    0x10, 0x00,
    0x00, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x24,
    0x04, 0x00,
    0x18, 0x80,
    0x17, 0x28,
    0x32, 0x12,
    0x19, 0x02,
    0x1a, 0x7a,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x16, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x02,
    0x34, 0x00,
    0x35, 0x84,
    0x36, 0x03,
    0x38, 0x13,
    0x39, 0x43,
    0x3a, 0x00,
    0x3c, 0x6c,
    0x3d, 0x90,
    0x3f, 0x3c,
    0x40, 0xd1,
    0x41, 0x00,
    0x6b, 0x0f,
    0xa1, 0xc8,
    0x69, 0x80,
    0x43, 0xf0,
    0x44, 0x10,
    0x45, 0x78,
    0x46, 0xa8,
    0x47, 0x60,
    0x48, 0x80,
    0x59, 0xba,
    0x5a, 0x9a,
    0x5b, 0x22,
    0x5c, 0xb9,
    0x5d, 0x9b,
    0x5e, 0x10,
    0x5f, 0xe0,
    0x60, 0x85,
    0x61, 0x60,
    0x9f, 0x9d,
    0xa0, 0xe0,
    0x4f, 0x6c,
    0x50, 0x02,
    0x51, 0x12,
    0x52, 0x09,
    0x53, 0x6a,
    0x54, 0x0d,
    0x55, 0x12,
    0x56, 0x0d,
    0x57, 0x7b,
    0x58, 0x40,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x6c, 0x40,
    0x6d, 0x30,
    0x6e, 0x4b,
    0x6f, 0x60,
    0x70, 0x70,
    0x71, 0x70,
    0x72, 0x70,
    0x73, 0x70,
    0x74, 0x60,
    0x75, 0x60,
    0x76, 0x50,
    0x77, 0x48,
    0x78, 0x3a,
    0x79, 0x2e,
    0x7a, 0x28,
    0x7b, 0x22,
    0x7c, 0x04,
    0x7d, 0x07,
    0x7e, 0x10,
    0x7f, 0x28,
    0x80, 0x36,
    0x81, 0x44,
    0x82, 0x52,
    0x83, 0x60,
    0x84, 0x6c,
    0x85, 0x78,
    0x86, 0x8c,
    0x87, 0x9e,
    0x88, 0xbb,
    0x89, 0xd2,
    0x8a, 0xe6,
    0x14, 0x4e,
    0x24, 0x68,
    0x25, 0x58,
    OV7660_REGEND, 0x00        // End of list delimiter.
};

const static UINT8 gRGB565_QCIF_15fps_INITIALIZE[] =
{
    0x12, 0x80,
    0x11, 0x80,
    0x92, 0x48,
    0x93, 0x06,
    0x9d, 0x62,
    0x9e, 0x52,
    0x3b, 0x02,
    0x13, 0xf2,
    0x10, 0x00,
    0x00, 0x00,
    0x01, 0x80,
    0x02, 0x80,
    0x13, 0xf7,
    0x12, 0x0c,
    0x04, 0x04,
    0x18, 0x80,
    0x17, 0x28,
    0x32, 0x92,
    0x19, 0x02,
    0x1a, 0x4a,
    0x03, 0x00,
    0x0e, 0x84,
    0x0f, 0x62,
    0x15, 0x02,
    0x16, 0x02,
    0x1b, 0x01,
    0x1e, 0x01,
    0x29, 0x3c,
    0x33, 0x02,
    0x34, 0x00,
    0x35, 0x84,
    0x36, 0x03,
    0x38, 0x13,
    0x39, 0x43,
    0x3a, 0x00,
    0x3c, 0x6c,
    0x3d, 0x90,
    0x3f, 0x29,
    0x40, 0xd1,
    0x41, 0x20,
    0x6b, 0x0f,
    0xa1, 0xc8,
    0x69, 0x80,
    0x43, 0xf0,
    0x44, 0x10,
    0x45, 0x78,
    0x46, 0xa8,
    0x47, 0x60,
    0x48, 0x80,
    0x59, 0xba,
    0x5a, 0x9a,
    0x5b, 0x22,
    0x5c, 0xb9,
    0x5d, 0x9b,
    0x5e, 0x10,
    0x5f, 0xe0,
    0x60, 0x85,
    0x61, 0x60,
    0x9f, 0x9d,
    0xa0, 0xa0,
    0x4f, 0xae,
    0x50, 0x26,
    0x51, 0x08,
    0x52, 0x1a,
    0x53, 0xa9,
    0x54, 0x0f,
    0x55, 0x05,
    0x56, 0x46,
    0x57, 0xcb,
    0x58, 0x77,
    0x8b, 0xcc,
    0x8c, 0xcc,
    0x8d, 0xcf,
    0x6c, 0x40,
    0x6d, 0x30,
    0x6e, 0x4b,
    0x6f, 0x60,
    0x70, 0x70,
    0x71, 0x70,
    0x72, 0x70,
    0x73, 0x70,
    0x74, 0x60,
    0x75, 0x60,
    0x76, 0x50,
    0x77, 0x48,
    0x78, 0x3a,
    0x79, 0x2e,
    0x7a, 0x28,
    0x7b, 0x22,
    0x7c, 0x04,
    0x7d, 0x07,
    0x7e, 0x10,
    0x7f, 0x28,
    0x80, 0x36,
    0x81, 0x44,
    0x82, 0x52,
    0x83, 0x60,
    0x84, 0x6c,
    0x85, 0x78,
    0x86, 0x8c,
    0x87, 0x9e,
    0x88, 0xbb,
    0x89, 0xd2,
    0x8a, 0xe6,
    0x14, 0x2e,
    0x24, 0x68,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -