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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? caminterface.c

?? The AVRcam source files were built using the WinAVR distribution (version 3.3.1 of GCC). I haven t
?? C
字號:
/***********************************************************
    Module Name: CamInterface.c
    Module Date: 04/12/2004
    Module Auth: John Orlando 
    Copyright (c) 2004 John Orlando  All Rights Reserved 

    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.
    ***********************************************************/

/*	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 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)
{
    /* 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 */

    /* set up Timer1 to count and be clocked from an external pulse source
        (PCLK) on rising edges...also, we don't want
        to enable this counting until after we go into the "acquire line" mode...
        i.e., we'll have to enable the interrupt itself in TIMSK */
    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);

    CamInt_resetCam();
}

/***********************************************************
    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
    ***********************************************************/
void CamInt_resetCam(void)
{
    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);
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩中文国产| 亚欧色一区w666天堂| 亚洲狠狠爱一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 国产美女在线观看一区| 欧美日韩精品三区| 国产精品国产a级| 黑人精品欧美一区二区蜜桃| 欧美视频在线一区| 中文字幕中文字幕一区| 精品在线免费视频| 3d动漫精品啪啪一区二区竹菊| 亚洲天堂免费在线观看视频| 国产精品一线二线三线精华| 宅男噜噜噜66一区二区66| 亚洲综合丝袜美腿| 91丝袜高跟美女视频| 久久蜜臀中文字幕| 美日韩一区二区| 91精品国产综合久久久久久漫画 | 99久久免费精品| 2020国产精品| 精品亚洲成av人在线观看| 欧美视频一区二| 亚洲线精品一区二区三区| 97国产精品videossex| 国产精品网站导航| 国产成人aaa| 国产精品久久久久aaaa| 成人在线综合网站| 国产精品网曝门| 成人国产精品免费网站| 国产精品日韩成人| 99视频热这里只有精品免费| 国产精品久久久久天堂| bt欧美亚洲午夜电影天堂| 中文字幕av一区 二区| 成人激情午夜影院| 国产精品成人免费精品自在线观看| 国产成人av网站| 国产精品看片你懂得| 色老汉一区二区三区| 亚洲一区二区三区自拍| 欧美日韩国产综合视频在线观看| 午夜精品久久久久久久久| 日韩午夜三级在线| 国产一区二区三区久久久| 国产欧美日韩精品一区| 北岛玲一区二区三区四区| 亚洲欧美一区二区久久| 欧美日韩中文精品| 激情综合网激情| 国产精品久久久久久亚洲伦 | 日韩一区二区三| 韩国毛片一区二区三区| 国产欧美在线观看一区| 色综合一区二区| 午夜精品福利一区二区三区av | 亚洲人成电影网站色mp4| 在线观看国产日韩| 日本系列欧美系列| 国产欧美日韩在线视频| 色88888久久久久久影院按摩| 秋霞影院一区二区| 久久免费看少妇高潮| 91黄色在线观看| 精品午夜一区二区三区在线观看| 国产精品色噜噜| 欧美日韩不卡视频| 粗大黑人巨茎大战欧美成人| 亚洲chinese男男1069| 久久―日本道色综合久久 | 国产在线视频精品一区| 综合电影一区二区三区| 日韩亚洲欧美在线| 成人网在线免费视频| 日韩电影一区二区三区| 国产精品欧美一区喷水| 欧美精品色一区二区三区| 风流少妇一区二区| 青草av.久久免费一区| ㊣最新国产の精品bt伙计久久| 91麻豆精品国产自产在线| 91首页免费视频| 国产在线麻豆精品观看| 午夜精品福利在线| 亚洲日穴在线视频| 国产亚洲美州欧州综合国| 欧美日韩亚州综合| 91免费国产在线观看| 日韩欧美二区三区| 日韩av中文字幕一区二区| 国产欧美日韩久久| 777xxx欧美| 一本大道久久a久久精二百| 国产一区日韩二区欧美三区| 日韩国产欧美三级| 亚洲影院理伦片| 亚洲精品国产一区二区精华液 | 欧美挠脚心视频网站| 99re66热这里只有精品3直播| 久久超碰97中文字幕| 视频在线观看一区二区三区| 夜夜夜精品看看| 亚洲美女偷拍久久| 自拍av一区二区三区| 综合在线观看色| 日韩一区二区三区三四区视频在线观看 | 亚洲色欲色欲www在线观看| 欧美大片在线观看一区| 欧美区一区二区三区| 欧美曰成人黄网| 色综合天天视频在线观看| 国产精品99久久久久久有的能看 | 亚洲国产精品久久久久婷婷884| 国产精品视频一二三| 国产精品理伦片| 亚洲欧洲在线观看av| 中文字幕佐山爱一区二区免费| 中文字幕亚洲综合久久菠萝蜜| 国产精品久久久久久久久免费樱桃 | 久久精品免费在线观看| 欧美性猛交xxxx乱大交退制版| 成人动漫中文字幕| 成人精品国产福利| 97aⅴ精品视频一二三区| 99精品国产99久久久久久白柏| 91在线视频观看| 91麻豆6部合集magnet| 色先锋资源久久综合| 日本电影欧美片| 欧美日韩在线播放三区| 67194成人在线观看| 久久夜色精品国产噜噜av| 久久久精品国产免费观看同学| 国产亚洲成av人在线观看导航| 国产精品日韩精品欧美在线| 亚洲一区中文日韩| 日韩**一区毛片| 亚洲欧美激情在线| 亚洲一二三四区不卡| 日本亚洲三级在线| 丁香婷婷综合五月| 日本韩国视频一区二区| 在线播放日韩导航| 国产亚洲精品bt天堂精选| 亚洲伊人伊色伊影伊综合网| 六月丁香婷婷久久| 91视频精品在这里| 欧美精品三级日韩久久| 久久九九久久九九| 亚洲成av人片在线观看无码| 国产精品91一区二区| 在线观看免费一区| 久久一夜天堂av一区二区三区| 国产精品丝袜久久久久久app| 亚洲国产成人av好男人在线观看| 精品亚洲国产成人av制服丝袜| 91色porny在线视频| 日韩欧美国产三级电影视频| 亚洲精品水蜜桃| 国产在线精品免费| 欧美日韩一区成人| 国产精品欧美极品| 蜜桃精品视频在线| 色老汉av一区二区三区| 久久看人人爽人人| 亚洲国产wwwccc36天堂| 成人av网址在线| 欧美xxxx老人做受| 天天色天天操综合| 不卡一区中文字幕| 久久久亚洲精品石原莉奈| 亚洲成av人片在线| 91丨九色丨尤物| 国产精品水嫩水嫩| 韩国三级中文字幕hd久久精品| 在线观看日韩精品| 1024精品合集| 丁香啪啪综合成人亚洲小说 | 欧美日韩在线播| 亚洲免费av网站| 成人亚洲一区二区一| 欧美精品一区二区三区在线 | 五月激情六月综合| 欧美探花视频资源| 综合激情成人伊人| 成人国产精品免费观看动漫| 精品国产精品网麻豆系列| 亚洲大片免费看| 一本大道久久a久久精二百| 亚洲欧洲99久久| 成人av综合一区| 欧美国产一区视频在线观看| 国产一区二区伦理| 这里只有精品免费| 日本视频免费一区| 日韩免费视频线观看| 欧美aaa在线| 精品少妇一区二区三区免费观看|