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

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

?? caminterfaceasm.s

?? 基于avr單片機的嵌入式攝像機的源程序
?? S
?? 第 1 頁 / 共 2 頁
字號:
;
;    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: CanInterfaceAsm.S
;       Module Date: 04/14/2004
;       Module Auth: John Orlando
;
;       Description: This module provides the low-level interface
;       to the OV6620 camera hardware.  It is responsible for
;   	acquiring each pixel block (R,G,B), performing the mapping
;       into an actual color (orange, purple, etc), run-length
;       encoding the data, and storing the info off to the appropriate
;       line buffer.  This routine is synchronized with the pixel data
;       so that no polling of the camera data needs to be done (the
;       OV6620 is clocked off of the same crystal source as the mega8,
;       thus providing inherent synchronization between the two).
;
;       Revision History:
;       Date        Rel Ver.    Notes
;       4/10/2004      0.1     Module created
;       6/30/2004      1.0     Initial release for Circuit Cellar
;                              contest.
;       1/16/2005      1.4     Fixed issue with the TCCR1B register
;                              where PCLK was getting routed to the
;                              timer1 even when it wasn't needed.
;                              This caused excessive counter overflow
;                              interrupts, and caused problems.  Now,
;                              the "PCLK" pipe feeds timer1 when needed,
;                              and is turned off when it isn't needed.

#include <avr/io.h>
#include "Events.h"
		
		.extern fastEventBitmask    ; This is the flag used to indicate to the rest
									; of the system that the line is complete
								
#define HREF_INTERRUPT_ENABLE_MASK   0x80
#define HREF_INTERRUPT_DISABLE_MASK  0x7F
#define ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK  0x04
#define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB
#define G_PORT						_SFR_IO_ADDR(PINC)  
#define RB_PORT						_SFR_IO_ADDR(PINB)  
#define PIXEL_RUN_START_INITIAL     0x50     	; This value causes our pixel counter (TCNT1)
												; to overflow after 176 (horizontal) pixels

#define RED_MEM_OFFSET				0x00
#define GREEN_MEM_OFFSET			0x10
#define BLUE_MEM_OFFSET				0x20

; A pixelBlock is defined as a contiguous group of 4 pixels that are combined 
; together to form a specific color.  Typically, this is formed by sampling a
; a green value, followed by a red and blue value (since we are dealing
; with Bayer color data).  We could optionally sample a second green with
; the red and average the greens, because the eye is more sensitive to
; green, but for speed we don't do this.  These three values (RGB) are then
; used as indices into the color membership lookup table (memLookup) to
; determine which color the pixelBlock maps into.  The memLookup table is
; manually generated for now (though it will hopefully be modified over
; the serial interface eventually).
;
; Here is a pixel block:
; ...G  G  G  G...  (row x)
; ...B  R  B  R...  (row x+1)
;    |  |  |  |--this is skipped 
;    |  |  |--this is skipped
;    |  |--this is sampled
;    |--this is sampled

; As pixel blocks are sampled, the red, green, and blue values are
; used to index into their respective color maps.  The color maps
; return values that can be logically ANDed together so that a 
; particular RGB triplet will result in a single bit being set
; after the AND operation.  This single bit indicates which color
; the RGB triplet represents.  It is also possible for no bits to
; be set after the AND process, indicating that the RGB triplet
; does not map to any of the colors configured in the color map.
; This isn't quite as fast as a pure RGB lookup table, but
; it then again it doesn't require 2^12 (4-bits for each color
; channel) bytes to store the lookup table.  It takes just a few
; more cycles, and only requires 48 bytes of precious RAM (16
; per color channel, since our resolution on each color channel
; is only 4-bits).  Not bad....for more information, see:
; http://www.cs.cmu.edu/~trb/papers/wirevision00.pdf for more
; information on this color segmentation technique.

; One other note: this code does depend on the colorMap residing
; at a well-defined position in memory; specifically, it mus
; start at a 256-byte boundary so that the lowest byte in the
; map is set to 0x00.  Currently, the colorMap is forced to
; start at RAM location 0x300.  This could potentially be changed
; by the developer if needed, but offsets would have to be added
; in to the colorMap look-up code below to make it work.


; These are the registers that will be used throughout this
; module for acquiring each line of pixel data
pixelCount			= 16
pixelRunStart		= 17
lastColor     		= 18
tmp1				= 19	; be sure to not use tmp1 and color simultaneously
tmp2				= 20
color           	= 19
greenData       	= 20
blueData        	= 21
colorMapLow	  		= 22
colorMapHigh		= 23
prevLineBuffLow  	= 22  	; overlaps with memLookupLow (but orthogonal)
prevLineBuffHigh	= 23	; overlaps with memLookupHigh (but orthogonal)
currLineBuffLow     = 24
currLineBuffHigh  	= 25

        .section .text

; These are the global assembly function names that are accessed via other
; C functions
        .global CamIntAsm_waitForNewTrackingFrame
		.global CamIntAsm_waitForNewDumpFrame
		.global CamIntAsm_acquireDumpLine
		.global CamIntAsm_acquireTrackingLine
		.global SIG_INTERRUPT0
		.global SIG_INTERRUPT1
		.global SIG_OVERFLOW0
		.global SIG_OVERFLOW1
		
;*****************************************************************		
;   	Function Name: CamIntAsm_waitForNewTrackingFrame
;       Function Description: This function is responsible for
;       going to sleep until a new frame begins (indicated by
;    	VSYNC transitioning from low to high.  This will wake
;       the "VSYNC sleep" up and allow it to continue with 
;       the acquireLine function, where the system waits for
;       an "HREF sleep" that we use to synchronize with the
;       data.  
;       Inputs:  r25 - MSB of currentLineBuffer
;                r24 - LSB of currentLineBuffer
;				 r23 - MSB of colorMap
; 				 r22 - LSB of colorMap
;       Outputs: none
;       NOTES: This function doesn't really return...it sorta just
;       floats into the acquireLine function after the "VSYNC sleep"
;       is awoken, then begins processing the line data.  Once
;		176 pixels are sampled (and the counter overflows), then
;		an interrupt will occur, the 'T' bit in the SREG will be
;		set, and the function will return.
;*****************************************************************
		
CamIntAsm_waitForNewTrackingFrame:
		sbi		_SFR_IO_ADDR(PORTD),PD6  ; For testing...
		cbi		_SFR_IO_ADDR(PORTD),PD6		
		sleep

;*****************************************************************
; REMEMBER...everything from here on out is critically timed to be
; synchronized with the flow of pixel data from the camera...
;*****************************************************************

CamIntAsm_acquireTrackingLine:
		brts	_cleanUp
		;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
		;cbi		_SFR_IO_ADDR(PORTD),PD6
        
        in      tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
        ori     tmp1, 0x07                 ; feed Timer1
        out     _SFR_IO_ADDR(TCCR1B),tmp1 
										; The line is about to start...		
		ldi     pixelCount,0			; Initialize the RLE stats...
		ldi		pixelRunStart,PIXEL_RUN_START_INITIAL  	; Remember, we always calculate
														; the pixel run length as
														; TCNT1L - pixelRunStart
		
		ldi		lastColor,0x00				; clear out the last color before we start
		
		mov   	XH,currLineBuffHigh    	; Load the pointer to the current line
		mov		XL,currLineBuffLow		; buffer into the X pointer regs		 
		
		mov   	ZH,colorMapHigh      	; Load the pointers to the membership
		mov		ZL,colorMapLow			; lookup tables (ZL and YL will be overwritten
		mov 	YH,colorMapHigh	 		; as soon as we start reading data) to Z and Y
		
		in		tmp1, _SFR_IO_ADDR(TIMSK)			; enable TIMER1 to start counting
		ori		tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses and interrupt on 
		out		_SFR_IO_ADDR(TIMSK),tmp1			; overflow
		
		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
		out 	_SFR_IO_ADDR(TCNT1L),tmp1				
		
		mov		YL,colorMapLow		
		
		in 		tmp1, _SFR_IO_ADDR(GICR)	; enable the HREF interrupt...remember, we
											; only use this interrupt to synchronize
											; the beginning of the line
		ori 	tmp1, HREF_INTERRUPT_ENABLE_MASK
		out		_SFR_IO_ADDR(GICR), tmp1
		
;*******************************************************************************************
;   Track Frame handler 
;*******************************************************************************************		
		
_trackFrame:		
		sbi		_SFR_IO_ADDR(PORTD),PD6
		sleep   ; ...And we wait...
		
	; Returning from the interrupt/sleep wakeup will consume
	; 14 clock cycles (7 to wakeup from idle sleep, 3 to vector, and 4 to return)	

	; Disable the HREF interrupt
		cbi		_SFR_IO_ADDR(PORTD),PD6
		in 		tmp1, _SFR_IO_ADDR(GICR)
		andi 	tmp1, HREF_INTERRUPT_DISABLE_MASK
		out		_SFR_IO_ADDR(GICR), tmp1
		
	; A couple of NOPs are needed here to sync up the pixel data...the number (2)
	; of NOPs was determined emperically by trial and error.
		nop
		nop
_acquirePixelBlock:							;							Clock Cycle Count
		in		ZL,RB_PORT         			; sample the red value (PINB)		(1)
		in		YL,G_PORT         			; sample the green value (PINC)		(1)
		andi	YL,0x0F            			; clear the high nibble				(1)
		ldd		color,Z+RED_MEM_OFFSET  	; lookup the red membership			(2)
		in		ZL,RB_PORT         			; sample the blue value (PINB)		(1)
		ldd		greenData,Y+GREEN_MEM_OFFSET; lookup the green membership		(2)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美自拍偷拍午夜视频| 成人丝袜高跟foot| 亚洲精品国产精华液| 久久免费电影网| 久久日韩粉嫩一区二区三区| 日韩女优av电影在线观看| 欧美美女一区二区三区| 在线电影欧美成精品| 欧美一区二区观看视频| 精品少妇一区二区三区免费观看| 日韩一区二区三| 2023国产精品视频| 久久精品亚洲精品国产欧美| 久久精品亚洲一区二区三区浴池 | 国产亚洲欧美日韩在线一区| 日韩一级片网址| 欧美电影免费观看高清完整版在 | 日韩福利电影在线观看| 亚洲va韩国va欧美va| 蜜臀久久99精品久久久久宅男| 日本成人在线不卡视频| 国产精品99久久久| 91在线视频播放地址| 91久久精品国产91性色tv| 欧美三级中文字| 精品1区2区在线观看| 18欧美亚洲精品| 亚洲chinese男男1069| 久久99九九99精品| 91香蕉国产在线观看软件| 欧美人与z0zoxxxx视频| 国产日韩欧美精品在线| 亚洲午夜久久久久久久久久久 | 夜夜精品视频一区二区| 日本欧美韩国一区三区| 粉嫩一区二区三区性色av| 91久久国产最好的精华液| 日韩欧美的一区| 国产精品福利一区二区三区| 日本麻豆一区二区三区视频| 国产成人亚洲精品狼色在线| 欧美日韩精品三区| 国产精品免费网站在线观看| 日本成人在线一区| 在线免费观看日韩欧美| 久久这里只有精品首页| 婷婷中文字幕一区三区| kk眼镜猥琐国模调教系列一区二区| 欧美日韩三级一区二区| 国产精品久久久久久一区二区三区| 免费欧美在线视频| 欧美在线一区二区| 国产精品久久夜| 麻豆91精品视频| 欧美老人xxxx18| 亚洲情趣在线观看| 成人国产一区二区三区精品| 日韩免费看网站| 亚洲成av人片一区二区| 色欧美片视频在线观看在线视频| 久久久久久久久伊人| 奇米影视一区二区三区| 欧美日韩中文字幕一区| 亚洲精品免费一二三区| 99re成人在线| 亚洲欧美在线观看| 大美女一区二区三区| xfplay精品久久| 紧缚捆绑精品一区二区| 日韩精品中文字幕在线不卡尤物| 日韩和欧美的一区| 精品视频一区二区不卡| 亚洲国产成人精品视频| 91成人看片片| 亚洲国产va精品久久久不卡综合| 成人av在线播放网址| 国产精品美女一区二区三区| 豆国产96在线|亚洲| 国产欧美一区二区精品性色| 韩国女主播成人在线| 欧美精品一区二区三区视频| 国内成人精品2018免费看| 久久综合九色综合97婷婷| 国产91对白在线观看九色| 国产日韩亚洲欧美综合| 99久久99久久免费精品蜜臀| 国产精品伦理一区二区| 色综合网站在线| 性做久久久久久免费观看| 欧美一区二区三区公司| 国产成人在线网站| 中文字幕一区二区不卡| 在线国产亚洲欧美| 午夜成人免费电影| 欧美大片拔萝卜| 风间由美性色一区二区三区| 国产精品久久久久影院老司| 99精品欧美一区二区三区小说| 一区二区三区四区在线免费观看| 欧美日本国产一区| 国产盗摄一区二区三区| 又紧又大又爽精品一区二区| 91精品国产综合久久小美女| 国产一区亚洲一区| 亚洲男同1069视频| 欧美三级日韩在线| 国产1区2区3区精品美女| 一区二区三区四区中文字幕| 精品国产乱子伦一区| 一本色道久久综合亚洲91| 蜜臀99久久精品久久久久久软件| 久久久久久久久免费| 欧美日韩美少妇| 成人综合在线视频| 午夜日韩在线电影| 国产精品久久久爽爽爽麻豆色哟哟 | 国内精品久久久久影院一蜜桃| 18欧美亚洲精品| 26uuu亚洲| 91精品国产综合久久精品性色| 成人一区二区在线观看| 日韩av一区二区三区四区| 亚洲欧美另类小说视频| 久久影视一区二区| 666欧美在线视频| 色婷婷综合久久久中文一区二区| 极品少妇xxxx偷拍精品少妇| 亚洲精品菠萝久久久久久久| 久久免费偷拍视频| 日韩三级在线观看| 欧美日韩国产免费一区二区| 成人精品在线视频观看| 国内一区二区在线| 日本不卡中文字幕| 亚洲一二三专区| 日韩码欧中文字| 国产日本欧洲亚洲| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 欧美mv日韩mv| 日韩色视频在线观看| 欧美日韩免费电影| 欧美视频一区二| 欧洲中文字幕精品| 91蝌蚪国产九色| 色哟哟一区二区在线观看| 国产乱妇无码大片在线观看| 激情六月婷婷综合| 韩国午夜理伦三级不卡影院| 久久99精品国产.久久久久久| 午夜精品视频一区| 无码av中文一区二区三区桃花岛| 一区二区三区.www| 亚洲一区二区三区四区的| 亚洲一区二区三区免费视频| 一区二区三区中文在线| 依依成人精品视频| 亚洲妇女屁股眼交7| 偷拍日韩校园综合在线| 日本sm残虐另类| 韩国女主播成人在线观看| 国产专区欧美精品| 成人毛片在线观看| 色综合色狠狠综合色| 欧美视频在线观看一区二区| 欧美久久久久久久久中文字幕| 欧美日韩国产影片| 欧美精品电影在线播放| 91精品国产日韩91久久久久久| 日韩免费视频一区二区| 国产日韩精品一区二区三区 | 精品无码三级在线观看视频| 国内精品伊人久久久久av影院| 国产乱淫av一区二区三区| 成人av午夜影院| 欧洲激情一区二区| 91精品国产欧美日韩| 国产欧美久久久精品影院| 亚洲视频一二区| 日韩成人伦理电影在线观看| 精品一区二区综合| 成人亚洲一区二区一| 欧美三级资源在线| 久久久精品综合| 亚洲伦理在线精品| 青青草视频一区| www.亚洲精品| 欧美一卡2卡3卡4卡| 国产精品日韩成人| 婷婷丁香激情综合| 国产精品亚洲人在线观看| 在线观看三级视频欧美| 欧美成人性战久久| 亚洲视频在线一区二区| 久久精品国产一区二区三区免费看| 成人免费观看男女羞羞视频| 欧美日韩国产高清一区二区三区 | 97久久超碰精品国产| 日韩精品一区二区三区中文不卡| 国产精品色在线观看| 蜜臂av日日欢夜夜爽一区|