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

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

?? caminterface.c

?? he AVRcam source files were built using the WinAVR distribution (version 3.3.1 of GCC). I haven t t
?? 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: CamInterface.c
	Module Date: 04/12/2004
	Module Auth: John Orlando
	
	Description: This file is responsible for providing an
	interface to the OV6620 camera hardware.  This includes
	an interface to CamInterface.S for certain low-level,
	optimized camera access routines.
    
    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     ifdef'd out the resetCam routine, since
                           resetting the cam now causes the OV6620's
                           clock to not be output (we have to start
                           it up after each reset with the external
                           tiny12 processor).
    1/16/2005      1.4     Ensure that the TCCR1B register is set so
                           nothing is clocking timer1 at startup.                             
***********************************************************/

/*	Includes */
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <avr/sleep.h>
#include <avr/eeprom.h>
#include <stdlib.h>
#include <string.h>
#include "CommonDefs.h"
#include "CamInterface.h"
#include "Utility.h"
#include "UIMgr.h"
#include "Executive.h"
#include "UartInterface.h"

/*  Local Variables */

/* 	Local Structures and Typedefs */

/*  Definitions */
//#define OUTPUT_INITIAL_COLOR_MAP 1

#define FAST_ACQUIRE 1
#define CAM_G_BUS          	PINB
#define CAM_G_BUS_DIR      	DDRB
#define CAM_RB_BUS          PINC
#define CAM_RB_BUS_DIR 		DDRC

#define CAM_CONTROL_PORT     PORTD
#define CAM_CONTROL_PORT_DIR DDRD
#define CAM_RESET_LINE       BIT7
#define CAM_PIXEL_CLK_COUNT  BIT5
#define CAM_HREF             BIT4
#define CAM_PIXEL_CLK_INT    BIT3
#define CAM_VSYNC            BIT2

/*  Global Variables */
/* NOTE: This file MUST appear first in the Makefile for these variables to
be placed properly in RAM */

/* The colorMap[] table provides the membership lookup table to convert 
RGB or YUV pixel values into actual colors.  The membership table contains
16 elements for each color channel, concatenated together.  The Red (or Y)
value is located in the first 16 bytes, the G (or U) value is located in
the second 16 bytes, and the B (or V) value is located in the last 16 bytes:

    ----------------------------------------------------------------------------------
    |red0|red1|red2|...|red15|green0|green1|green2|...|green15|blue0|blue1|...|blue15|
mem:|0x00 0x01 0x02     0x15   0x16   0x17   0x18       0x31   0x32  0x33       0x47 |
    ---------------------------------------------------------------------------------
Thus, the red lookup is accessed at colorMap+0, the green lookup is accessed 
at colorMap+16, and the blue lookup is accessed at colorMap+32.  */	
unsigned char colorMap[NUM_ELEMENTS_IN_COLOR_MAP] __attribute__ ((section (".noinit")));

/*  Extern Variables */
/* These two buffers hold the current and previous lines
of pixel data.  They are sized to the worst case scenario,
where the color changes between every pixel (unrealistic).
The format of each buffer is for all the even bytes to hold
the run-length, and the odd bytes to hold the color data. */

/* In addition, if we are in frameDump mode, we use these buffers
to store the acquired line data...we are actually grabbing ALL of the
pixels in a line (176) instead of the 88 we get normally during tracking.
But since we have enough to hold 88-RLE blocks, we already have the 176
allocated for this... */
unsigned char currentLineBuffer[LENGTH_OF_LINE_BUFFER];
unsigned char previousLineBuffer[LENGTH_OF_LINE_BUFFER];

/*  Extern Functions */
/* These functions are located in assembly files, and thus
must be externed here so they can be referenced in the source below. */
extern void CamIntAsm_waitForNewTrackingFrame(unsigned char *pBuffer, unsigned char *pMemLookup);
extern void CamIntAsm_waitForNewDumpFrame(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer);
extern void CamIntAsm_acquireTrackingLine(unsigned char *pBuffer, unsigned char *pMemLookup);
extern void CamIntAsm_acquireDumpLine(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer);

/***********************************************************
	Function Name: CamInt_init
	Function Description: This function is responsible
	for initializing the camera interface.  This includes
	setting up the i/o ports that are used to read the
	camera busses, as well as resetting the camera.
	Inputs:  none
	Outputs: none
***********************************************************/	
void CamInt_init(void)
{
#if OUTPUT_INITIAL_COLOR_MAP
	unsigned char asciiBuffer[5];
    unsigned char i;
#endif    
    
	/* set up the mega8 ports that will be interfacing
	with the camera */	
	CAM_CONTROL_PORT_DIR |= (1<<CAM_RESET_LINE); /* cam reset is output */
	CAM_CONTROL_PORT_DIR |= 0x80;   /* set just the MSB as an output */
	CAM_CONTROL_PORT_DIR &= 0xFB;   /* make sure bit2 is clear (input) */
	CAM_CONTROL_PORT &= 0x7F;   /* set reset line low */
	CAM_G_BUS_DIR &= 0xF0;  /* 4-bit G bus all inputs */
    CAM_G_BUS_DIR |= 0xF0;  /* disable the pull-up on PB4 and PB5 */
	CAM_RB_BUS_DIR &= 0xF0;  /* 4-bit RB bus all inputs */
	
    /* ensure that timer1 is disabled to start...eventually, when PCLK needs
    to feed timer1 through the external counter, it will be enabled on an
    "as needed" basis...*/
	TCCR1B &= ~( (1<<CS12)|(1<<CS11)|(1<<CS10) );
	
	/* we'll turn on the interrupt after we assign the initial TCNT value */
	
	/* set up External Interrupt1 to interrupt us on rising edges (HREF)...
	this is needed to indicate when the first pixel of each line is about to start, so
	we can synch up with it...this interrupt will be disabled once HREF goes high */
	
	MCUCR |= (1<<ISC11) | (1<<ISC10);  /* rising edge interrupt */
	/* the interrupt will be enabled when we are ready to detect the rising edge of
	HREF...its now primed and ready to go */
	
	/* set up External Interrupt0 to interrupt us on rising edges (VSYNC) */
	MCUCR |= (1<<ISC01) | (1<<ISC00);	/* rising edge interrupt */ 
	GICR  |= (1<<INT0);    /* interrupt request enabled */
	
	/* set up TimerO to count and be clocked from an external pulse source
	(HREF) on falling edges...eventually, we need to enable the interrupt
	for this!  FIX THIS */
	TCCR0 = (1<<CS02)|(1<<CS01)|(0<<CS00);
	
	/* setting up the PCLK counter with Timer1 will be done right after
	we start receiving pixels in each line...we sacrifice the first pixel
	in each line, but we'll account for it...*/
	
	/* set up the mega8 so that its sleep mode puts it in an IDLE sleep
	mode, where it can wake up as fast as possible */
	set_sleep_mode(SLEEP_MODE_IDLE);
	/* umm....we need to actually enable the sleep mode...*/
	MCUCR |= 0x80;
	
	/* initialize the memLookup table */
	memset(colorMap,0x00,NUM_ELEMENTS_IN_COLOR_MAP);   
	
	/* read the color map out of EEPROM */
	eeprom_read_block(colorMap, (unsigned char*)0x01,NUM_ELEMENTS_IN_COLOR_MAP);

#if OUTPUT_INITIAL_COLOR_MAP    
    UIMgr_txBuffer("\r\n",2);
    for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++)
	{
		memset(asciiBuffer,0x00,5);
		itoa(colorMap[i],asciiBuffer,10);
		UIMgr_txBuffer(asciiBuffer,3);
		UIMgr_txBuffer(" ",1);
		if (i==15 || i == 31)
		{
			/* break up the output */
			UIMgr_txBuffer("\r\n",2);
		}
	}
#endif    

#ifndef NO_CRYSTAL
	CamInt_resetCam();	
#endif    
}

/***********************************************************
	Function Name: CamInt_resetCam
	Function Description: This function is responsible
	for resetting the camera.  This is accomplished by
	toggling the reset line on the OV6620 for ~100 mS.
	Inputs:  none
	Outputs: none
    IMPORTANT NOTE: This function has effectively been removed
    since resetting the camera now causes the camera to not
    output the clock signal.  Thus, if we reset the cam, the
    AVR has no clock, and thus doesn't run...
***********************************************************/	
void CamInt_resetCam(void)
{

#if 0
	CAM_CONTROL_PORT |= (1<<CAM_RESET_LINE); /* cam reset line high */
	Utility_delay(500);
	CAM_CONTROL_PORT &= (0<<CAM_RESET_LINE); /* cam reset line low */
	Utility_delay(100);
#endif    
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲春色中文字幕久久久| 国产精品欧美精品| 久久精品综合网| 亚洲线精品一区二区三区八戒| 国内精品写真在线观看| 欧美视频一区二区三区| 亚洲国产精品成人综合| 天堂午夜影视日韩欧美一区二区| 成人性生交大片| 欧美mv日韩mv| 日欧美一区二区| 色综合久久综合| 中文字幕欧美国产| 国产一区在线观看视频| 在线成人小视频| 亚洲欧美日韩国产一区二区三区 | 国产日韩一级二级三级| 亚洲国产成人porn| 在线视频综合导航| 亚洲情趣在线观看| 成人av网站免费观看| 欧美电影免费观看高清完整版| 亚洲电影第三页| 色哟哟亚洲精品| 亚洲男同1069视频| 一本色道久久综合亚洲精品按摩| 国产亚洲综合在线| 国产激情一区二区三区| 精品sm在线观看| 国产一本一道久久香蕉| 久久综合久久鬼色中文字| 青娱乐精品在线视频| 欧美日韩国产一二三| 亚洲成a人v欧美综合天堂| 欧美色图在线观看| 亚洲成a人片综合在线| 欧美午夜寂寞影院| 午夜精品久久久久久久| 777亚洲妇女| 男女男精品视频网| 精品乱码亚洲一区二区不卡| 免费观看一级欧美片| 日韩精品一区国产麻豆| 激情综合网激情| 国产欧美一区二区在线| 91欧美激情一区二区三区成人| 综合久久久久久久| 91福利小视频| 免播放器亚洲一区| 久久久精品天堂| 99re6这里只有精品视频在线观看| 亚洲视频香蕉人妖| 欧美日韩免费观看一区二区三区| 亚洲成人av免费| 欧美本精品男人aⅴ天堂| 国产麻豆成人传媒免费观看| 国产精品久久久久久久蜜臀 | 麻豆一区二区在线| 久久精品这里都是精品| 91蝌蚪porny成人天涯| 日韩高清中文字幕一区| 久久久久久亚洲综合| 91亚洲精品乱码久久久久久蜜桃| 亚洲国产精品视频| 精品国产欧美一区二区| 91视频国产资源| 美女视频一区二区| 亚洲欧洲另类国产综合| 91麻豆精品国产91久久久资源速度| 狠狠久久亚洲欧美| 一区二区三区四区不卡在线| 日韩一区二区精品| 成人av免费在线播放| 视频一区视频二区中文| 国产精品国产三级国产aⅴ原创 | 99久久亚洲一区二区三区青草| 亚洲国产婷婷综合在线精品| 2020国产成人综合网| 色域天天综合网| 国产一区视频在线看| 亚洲国产精品人人做人人爽| 国产欧美日韩不卡| 欧美一区二区三区的| 91亚洲精品久久久蜜桃| 久久精品国产免费| 亚洲va韩国va欧美va精品| 中文字幕不卡在线播放| 精品三级在线看| 欧美日韩一区三区| www.欧美精品一二区| 乱一区二区av| 亚洲gay无套男同| 国产精品不卡视频| 久久亚洲春色中文字幕久久久| 欧美日本韩国一区二区三区视频 | 久久婷婷一区二区三区| 欧美剧情电影在线观看完整版免费励志电影 | 91在线高清观看| 国产精品资源在线看| 日韩av电影免费观看高清完整版 | 成人一区在线观看| 韩国毛片一区二区三区| 午夜久久久影院| 亚洲精品视频在线观看网站| 亚洲国产精品黑人久久久| 久久婷婷一区二区三区| 欧美不卡一区二区三区| 7777女厕盗摄久久久| 欧美日韩日日夜夜| 欧美日韩一区不卡| 欧美少妇bbb| 欧美色图天堂网| 欧美日韩三级在线| 欧美日韩第一区日日骚| 欧洲亚洲精品在线| 欧美性xxxxx极品少妇| 在线精品亚洲一区二区不卡| 99久免费精品视频在线观看| 成人午夜伦理影院| 成人综合婷婷国产精品久久蜜臀 | 国产精品亲子乱子伦xxxx裸| 久久久午夜精品| 国产亚洲视频系列| 亚洲视频在线一区观看| 伊人一区二区三区| 一区二区三区精品在线| 亚洲成人黄色小说| 日韩中文字幕麻豆| 精久久久久久久久久久| 国产精品99久久久久久久vr| 成人精品免费网站| 色噜噜久久综合| 欧美日韩国产免费一区二区| 欧美高清一级片在线| 欧美一区二区三区成人| 国产亚洲人成网站| 亚洲男人天堂av网| 一区二区久久久久久| 日韩精品一级二级 | 欧美一区二区三区在线观看视频| 欧美一区二区三区的| 日本一区二区三区在线观看| 亚洲人成精品久久久久| 水野朝阳av一区二区三区| 日本午夜一本久久久综合| 国产盗摄女厕一区二区三区| av亚洲精华国产精华精华| 欧美熟乱第一页| 欧美精品一区二区三区蜜桃视频| 国产欧美日产一区| 偷拍与自拍一区| 国产九色精品成人porny| av中文字幕亚洲| 欧美一区二区网站| 国产精品国产自产拍高清av| 亚洲国产精品一区二区久久恐怖片| 麻豆成人免费电影| 99久久免费国产| 欧美精品亚洲一区二区在线播放| 久久亚洲综合色| 亚洲成人av福利| 不卡视频在线看| 日韩一区二区精品葵司在线| 中文字幕在线观看一区| 久久精品国产亚洲aⅴ| 91免费观看国产| 久久久精品免费观看| 亚洲国产精品久久人人爱蜜臀| 国产精品资源在线观看| 欧美精品免费视频| 专区另类欧美日韩| 国产精品资源网| 9191久久久久久久久久久| 亚洲欧洲av色图| 国产乱子伦视频一区二区三区 | 884aa四虎影成人精品一区| 日本一区二区电影| 国内精品视频一区二区三区八戒| 日本黄色一区二区| 国产精品不卡视频| 国产不卡视频在线播放| 精品蜜桃在线看| 日本三级亚洲精品| 欧美视频在线观看一区二区| 国产精品美女一区二区在线观看| 激情综合亚洲精品| 欧美成人一区二区三区片免费| 亚洲国产精品久久久久秋霞影院| eeuss鲁片一区二区三区| 久久久蜜桃精品| 国产在线视频一区二区| 日韩三级视频中文字幕| 日韩不卡一二三区| 欧美日韩国产综合草草| 亚洲午夜久久久久中文字幕久| 99久久精品免费观看| 成人免费一区二区三区在线观看| 国产成人8x视频一区二区| 欧美高清在线一区| 成人免费视频播放|