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

📄 l1_initspca533.c

📁 台湾凌阳方案300万数码相机源代码
💻 C
字号:
/*++

Copyright (c) 2001 Sunplus Technology Co., Ltd.

Module Name:

        L1_Init.c

Abstract:

        Initial all modules, including GLOBAL, CPU, SDRAM, FRONT, LCDTV, AUDIO

Environment:

        Keil C51 Compiler

Revision History:

        11/12/2001      YPWang    created

--*/

//=============================================================================
//Header file
//=============================================================================
#include "general.h"

//=============================================================================
//Symbol
//=============================================================================
//-----------------------------------------------------------------------------
//Constant
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//Variable
//-----------------------------------------------------------------------------

//=============================================================================
//Program
//=============================================================================

//-----------------------------------------------------------------------------
//L1_Init
//-----------------------------------------------------------------------------
/*
routine description:
        Initialization of the SPCA533 chip in various operation mode
arguments:
        cammode - 0: power-on initialization
                  1: preview mode initialization
                  2: DSC mode
                  3: VideoClip mode
                  4: PC-camera mode
                  5: Playback mode
return value:
        0x00    - success
        0x01    - module 'GLOBAL' initialization error
        0x02    - module 'CPU'    initialization error
        0x03    - module 'SDRAM'  initialization error
        0x04    - module 'FRONT'  initialization error
        0x05    - module 'LCDTV'  initialization error
        0x06    - module 'Audio'  initialization error
*/
UCHAR L1_InitSPCA533(UCHAR CamMode)
{
	UCHAR error, i, k, j;
	error=0;

	if(!L2_InitGlobal(CamMode)) error = 0x01;
        if(!L2_InitCPU(CamMode))	error = 0x02;
        if(!L2_InitSDRAM(CamMode))	error = 0x03;

	//Joe@2003.2.27 15:33 mask begin
	/*
	///////////Enable 5 Volt, Let GPIO 15 = 1///////////////////////
        //powe on 5V
        //PRINT_L1("Power On 5 Volt !!! \n");
	XBYTE[0x2039] = XBYTE[0x2039] | 0x80;
        XBYTE[0x2031] = XBYTE[0x2031] | 0x80;
 	//power on 18 V  (for STNLCD)
        //PRINT_L1("Power On 18 Volt for STNLCD!!! \n");
	XBYTE[0x2032] = 0x01;
	XBYTE[0x203A] |= 0x01;
	*/
	//Joe@2003.2.27 15:33 mask end

	XBYTE[0x201C] = 0x00;

        for (i=0; i<25;i++)        //Delay
                for (j=0; j<255;j++)
                        for (k=0; k<255; k++);


        ////////////////////////////////////////////////////////////////
	if(!L2_InitFront(CamMode))	error = 0x04;
	if(!L2_InitCDSP(CamMode))	error = 0x05;
	if(!L2_InitLCDTV(CamMode))	error = 0x06;
	if(!L2_InitAudio(CamMode))	error = 0x07;
	if(!L2_InitUSB(CamMode))	error = 0x08;

	return error;
}

⌨️ 快捷键说明

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