亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? camconfig.c

?? AVR與圖像傳感器OVA6620的接口程序 通過I2C總線進行通信對圖像進行采集和預處理
?? C
字號:
/*
    Copyright (C) 2004    John Orlando
    
   AVRcam: a small real-time image processing engine.

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public
    License along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

   For more information on the AVRcam, please contact:

   john@jrobot.net

   or go to www.jrobot.net for more details regarding the system.
*/
/**********************************************************
	Module Name: CamConfig.c
	Module Date: 04/10/2004
    Module Auth: John Orlando 
	
	Description: This module is responsible for the 
	high-level configuration activities of the OV6620
	camera module.  This module interfaces with the
	I2CInterface module to perform this configuration.
    
    Revision History:
    Date        Rel Ver.    Notes
    4/10/2004      0.1     Module created
    6/30/2004      1.0     Initial release for Circuit Cellar
                           contest.
    11/15/2004     1.2     Added code to un-tri-state the
                           OV6620's pixel data busses at
                           startup after four seconds.  
                           This was added in to 
                           allow the user to re-program the
                           mega8 at startup if needed.
***********************************************************/

/*  Includes */
#include <avr/io.h>
#include "CamConfig.h"
#include "I2CInterface.h"
#include "CommonDefs.h"
#include "Utility.h"

/**********************************************************/
/*  Definitions */
/* The length of an I2C command is made up of a register address
plus the actual value of the register */
#define SIZE_OF_I2C_CMD 2
#define MAX_NUM_CONFIG_CMDS 8
#define CAM_CONFIG_TX_FIFO_SIZE MAX_NUM_CONFIG_CMDS 
#define CAM_CONFIG_TX_FIFO_MASK CAM_CONFIG_TX_FIFO_SIZE-1

/*  Local Variables */

/*  Local Structures and Typedefs */

/*  Local Function Prototypes */
static i2cCmd_t CamConfig_readTxFifo(void);

/*  Extern Variables */
i2cCmd_t 		CamConfig_txFifo[CAM_CONFIG_TX_FIFO_SIZE];
unsigned char CamConfig_txFifoHead=0;
unsigned char CamConfig_txFifoTail=0;

/***********************************************************
	Function Name: CamConfig_init
	Function Description: This function is responsible for
	performing the initial configuration of the camera.
	Inputs:  none
	Outputs: none
***********************************************************/	
void CamConfig_init(void)
{
	CamConfig_setCamReg(0x14,0x20);  /* reduce frame size */
	CamConfig_setCamReg(0x39,0x40);  /* gate PCLK with HREF */
	CamConfig_setCamReg(0x12,0x28);  /* set RGB mode, with no AWB */
	CamConfig_setCamReg(0x28,0x05);  /* set color sequencer */
    CamConfig_setCamReg(0x13,0x01);  /* un-tri-state the Y/UV lines */
	
	/* send the first four cmds in the I2C fifo */
	CamConfig_sendFifoCmds();	
}


/***********************************************************
	Function Name: CamConfig_setCamReg
	Function Description: This function is responsible for
	creating an I2C cmd structure and placing it into the
	cmd fifo.
	Inputs:  reg - the register to modify
	         val - the new value of the register
	Outputs: none
***********************************************************/	
void CamConfig_setCamReg(unsigned char reg, unsigned char val)
{
	i2cCmd_t cmd;
	
	cmd.configReg = reg;
	cmd.data = val;
#ifndef SIMULATION	
	CamConfig_writeTxFifo(cmd);
#endif	
}
/***********************************************************
	Function Name: CamConfig_sendFifoCmds
	Function Description: This function is responsible for
	sending the entire contents of the config fifo.  This
	function won't return until the configuration process
	is complete (or an error is encountered).
	Inputs:  none
	Outputs: none
	Note: Since this function is written to use the TWI
	interrupt in the I2CInterface module, there will be 
	some busy-waiting here...no big deal, since we end up
	having to trash the frame that we are executing this
	slave write in anyway (since we can't meet the strict
	timing requirements and write i2c at the same time).
***********************************************************/	
void CamConfig_sendFifoCmds(void)
{
	i2cCmd_t cmd;
	
	while (CamConfig_txFifoHead != CamConfig_txFifoTail)
	{
		cmd = CamConfig_readTxFifo();
		I2CInt_writeData(CAM_ADDRESS,&cmd.configReg,SIZE_OF_I2C_CMD);
		Utility_delay(100);		
		/* wait for the I2C transaction to complete */
		while(I2CInt_isI2cBusy() == TRUE);
	} 
}

/***********************************************************
	Function Name: CamConfig_writeTxFifo
	Function Description: This function is responsible for
	adding a new command to the tx fifo.  It adjusts all
	needed pointers.
	Inputs:  cmd - the i2cCmd_t to add to the fifo
	Outputs: bool_t - indicating if writing to the fifo
	         causes it to wrap
***********************************************************/	
bool_t CamConfig_writeTxFifo(i2cCmd_t cmd)
{
	unsigned char tmpHead;
	bool_t retVal = TRUE;
 	
	CamConfig_txFifo[CamConfig_txFifoHead] = cmd;
		
	/* see if we need to wrap */
	tmpHead = (CamConfig_txFifoHead+1) & (CAM_CONFIG_TX_FIFO_MASK);
	CamConfig_txFifoHead = tmpHead;
	
	/* check to see if we have filled up the queue */
	if (CamConfig_txFifoHead == CamConfig_txFifoTail)
	{
		/* we wrapped the fifo...return false */
		retVal = FALSE;
	}
	return(retVal);
}

/***********************************************************
	Function Name: CamConfig_readTxFifo
	Function Description: This function is responsible for
	reading a cmd out of the tx fifo.
	Inputs:  none
	Outputs: i2cCmd_t - the cmd read from the fifo
***********************************************************/	
static i2cCmd_t CamConfig_readTxFifo(void)
{
	i2cCmd_t cmd;
	unsigned char tmpTail;
	
	/* just return the current tail from the rx fifo */
	cmd = CamConfig_txFifo[CamConfig_txFifoTail];	
	tmpTail = (CamConfig_txFifoTail+1) & (CAM_CONFIG_TX_FIFO_MASK);
	CamConfig_txFifoTail = tmpTail;
	
	return(cmd);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草国产精品97视觉盛宴| 亚洲乱码国产乱码精品精98午夜| 91免费观看在线| 国内精品久久久久影院一蜜桃| 日日欢夜夜爽一区| 视频在线观看91| 日本免费在线视频不卡一不卡二| 无码av免费一区二区三区试看 | 成人一区二区三区中文字幕| 韩国女主播一区二区三区| 精品一区二区在线看| 经典三级一区二区| 国产精品主播直播| a级精品国产片在线观看| 91视频国产资源| 欧美日韩一区国产| 精品国产伦一区二区三区观看体验 | 久久不见久久见中文字幕免费| 免费在线欧美视频| 国产一区激情在线| 波多野结衣中文一区| 91久久精品一区二区三| 91精品国产一区二区三区| 精品毛片乱码1区2区3区| 国产欧美日韩视频在线观看| 亚洲人成在线观看一区二区| 亚洲国产日韩a在线播放| 免费高清不卡av| av综合在线播放| 91精品欧美久久久久久动漫| 久久影院午夜片一区| 一区二区三区欧美久久| 蜜臀久久99精品久久久久久9| 丰满亚洲少妇av| 欧美日韩在线不卡| 久久免费国产精品| 亚洲国产综合91精品麻豆| 久久精品国产精品亚洲精品 | 亚洲综合色婷婷| 麻豆91在线播放免费| aa级大片欧美| 日韩欧美精品在线视频| 樱花影视一区二区| 国产福利一区二区三区| 8v天堂国产在线一区二区| 国产精品国产精品国产专区不蜜| 日韩高清不卡一区| 色综合天天综合在线视频| 精品国产91亚洲一区二区三区婷婷| 亚洲欧美日韩精品久久久久| 国产在线日韩欧美| 欧美一级二级在线观看| 亚洲欧洲中文日韩久久av乱码| 国产一区二区三区香蕉| 7777精品伊人久久久大香线蕉 | 国产亚洲欧美日韩日本| 视频一区在线视频| 一本色道久久综合亚洲精品按摩| 精品理论电影在线| 午夜精品aaa| 欧美在线999| 亚洲精品欧美综合四区| www.爱久久.com| 国产午夜精品福利| 国产综合色精品一区二区三区| 欧美日本一区二区三区| 亚洲福利视频一区| 91久久精品一区二区三区| 中文字幕在线不卡视频| 成人h动漫精品一区二区| 欧美激情一区二区三区全黄| 韩国v欧美v日本v亚洲v| 久久午夜色播影院免费高清| 精品写真视频在线观看| 91精品国产入口| 青娱乐精品视频| 91麻豆精品国产自产在线观看一区| 亚洲图片欧美视频| 欧美日韩国产一区二区三区地区| 亚洲香蕉伊在人在线观| 欧美网站一区二区| 亚洲国产日韩一级| 欧美一区二区三级| 久久精品国产一区二区三区免费看| 欧美一级片免费看| 国产在线不卡一卡二卡三卡四卡| 精品国产免费视频| 国产成人av电影在线| 国产精品久久久久久久岛一牛影视 | 久久97超碰国产精品超碰| 日韩视频一区在线观看| 国产一区欧美二区| 中文字幕一区日韩精品欧美| 日本高清免费不卡视频| 午夜精品福利在线| 精品国产乱码久久久久久1区2区 | 国产亚洲精品超碰| 91蜜桃视频在线| 香蕉久久夜色精品国产使用方法 | 国产毛片精品视频| 国产精品国产三级国产aⅴ无密码| 日本高清不卡一区| 蜜桃视频在线一区| 中文字幕一区二| 9191国产精品| 成人综合婷婷国产精品久久| 亚洲综合色成人| 久久综合色8888| 日本乱码高清不卡字幕| 美日韩一区二区| 最新不卡av在线| 欧美一级淫片007| 99re66热这里只有精品3直播 | 亚洲特级片在线| 4438成人网| 成人av网在线| 麻豆精品在线观看| 亚洲精品伦理在线| 久久综合九色欧美综合狠狠| 欧美中文字幕一二三区视频| 国产美女精品在线| 亚洲成年人网站在线观看| 国产欧美一区二区三区网站| 欧美日韩国产成人在线免费| 成人动漫在线一区| 美女精品一区二区| 午夜精彩视频在线观看不卡| 国产精品二区一区二区aⅴ污介绍| 日韩一区二区精品葵司在线| 在线免费亚洲电影| 成人a免费在线看| 国产一区三区三区| 老汉av免费一区二区三区| 亚洲午夜在线观看视频在线| 成人免费在线播放视频| 国产日本亚洲高清| 日韩一级高清毛片| 555www色欧美视频| 欧美亚洲动漫制服丝袜| 91视视频在线观看入口直接观看www| 黑人巨大精品欧美黑白配亚洲| 天天av天天翘天天综合网| 亚洲激情图片一区| 亚洲激情综合网| 成人免费一区二区三区在线观看| 中文字幕欧美国产| 久久久99精品免费观看不卡| 精品久久久久久综合日本欧美| 欧美一区二区三区在| 777奇米四色成人影色区| 欧美日韩精品一区二区三区蜜桃| 在线观看国产一区二区| 欧美性一区二区| 欧美性三三影院| 欧美日韩免费不卡视频一区二区三区| 色诱亚洲精品久久久久久| av高清久久久| 91毛片在线观看| 欧美四级电影在线观看| 欧美人妇做爰xxxⅹ性高电影| 欧美精品日韩综合在线| 91精品麻豆日日躁夜夜躁| 欧美成人一区二区三区片免费 | 日本免费在线视频不卡一不卡二| 蜜臀av亚洲一区中文字幕| 免费欧美在线视频| 国产一区二区三区四区五区入口| 国产在线精品国自产拍免费| 成人综合婷婷国产精品久久| 91小视频在线免费看| 欧美日韩在线三级| 日韩一区二区三区视频| 国产三级三级三级精品8ⅰ区| 国产精品家庭影院| 亚洲国产精品尤物yw在线观看| 日韩一区欧美二区| 国产精品18久久久久久久久久久久| av资源站一区| 欧美日韩电影一区| 久久免费午夜影院| 亚洲美女屁股眼交| 久久精品国产秦先生| 99久久国产免费看| 91精品国产综合久久久久久久久久| 欧美电影免费观看高清完整版| 国产精品萝li| 日本系列欧美系列| 99久久久久免费精品国产| 欧美日韩视频专区在线播放| 久久精品水蜜桃av综合天堂| 亚洲另类一区二区| 国内外成人在线| 欧美丝袜第三区| 中日韩av电影| 卡一卡二国产精品| 欧美视频一区二区三区在线观看| 久久色.com| 免费观看在线综合| 日本高清不卡视频| 亚洲国产精品精华液2区45|