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

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

?? caminterfaceasm.s

?? mg128+Ov7620實(shí)現(xiàn)圖象采集
?? S
字號:
;**********************************************************************
;       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).

#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   0x08   ; int3
#define HREF_INTERRUPT_DISABLE_MASK  0xF7
#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(PINA)  
#define PIXEL_RUN_START_INITIAL     0x50     	; This value causes our pixel counter (TCNT1)
												; to overflow after 176 (horizontal) pixels



; 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



; 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
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_waitForNewDumpFrame
		.global CamIntAsm_acquireDumpLine
		.global SIG_INTERRUPT0
		.global SIG_INTERRUPT1
		.global SIG_OVERFLOW1
		

_cleanUpDumpLine:		
		; NOTE: If serial data is received, to interrupt the tracking of a line, we'll
		; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the
		; line's processing...however, the PCLK will keep on ticking for the rest of
		; the frame/line, which will cause the TCNT to eventually overflow and
		; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event.  We don't want
		; this, so we need to actually turn off the PCLK counting each time we exit
		; this loop, and only turn it on when we begin acquiring lines....
        ; NOT NEEDED FOR NOW...
		;in		tmp1, _SFR_IO_ADDR(TIMSK)			; disable TIMER1 to stop counting
		;andi	tmp1, DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses
		;out		_SFR_IO_ADDR(TIMSK),tmp1
		
		

_cleanUp:
        ; Disable the external clocking of the Timer1 counter 
        in      tmp1, _SFR_IO_ADDR(TCCR1B)
        andi    tmp1, 0xF8
        out     _SFR_IO_ADDR(TCCR1B),tmp1
		
		; Toggle the debug line to indicate the line is complete
		sbi     _SFR_IO_ADDR(PORTB),PB6
		cbi		_SFR_IO_ADDR(PORTB),PB6
		clt				; clear out the T bit since we have detected
						; the interruption and are exiting to handle it
_exit:
		ret
		
;*****************************************************************		
;   	Function Name: CamIntAsm_waitForNewDumpFrame
;       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 
;       acquiring a line of pixel data to dump out to the UI.
;       Inputs:  r25 - MSB of currentLineBuffer
;                r24 - LSB of currentLineBuffer
;				 r23 - MSB of prevLineBuffer
;				 r22 - LSB of prevLineBuffer
;       Outputs: none
;       NOTES: This function doesn't really return...it sorta just
;       floats into the acquireDumpLine function after the "VSYNC sleep"
;       is awoken.
;*****************************************************************		
CamIntAsm_waitForNewDumpFrame:
		sbi		_SFR_IO_ADDR(PORTB),PB6  ; For testing...
		cbi		_SFR_IO_ADDR(PORTB),PB6
		sleep

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

CamIntAsm_acquireDumpLine:
		brts	_cleanUp
		;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
		;cbi		_SFR_IO_ADDR(PORTD),PD6
		
		mov   	XH,currLineBuffHigh    	; Load the pointer to the current line
		mov		XL,currLineBuffLow		; buffer into the X pointer regs

		mov		YH,prevLineBuffHigh		; Load the pointer to the previous line
		mov		YL,prevLineBuffLow  	; buffer into the Y pointer regs
		
		ldi 	tmp1,0xC0                  ;PIXEL_RUN_START_INITIAL	;0x50 set up the TCNT1 to overflow (and
		ldi 	tmp2,0xFE	  				;//0xff interrupts) after 176 pixels	320	
		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
		out 	_SFR_IO_ADDR(TCNT1L),tmp1		
		
        in      tmp1, _SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
        ori     tmp1, 0x07                 ; feed Timer1
        out     _SFR_IO_ADDR(TCCR1B),tmp1
        nop
        
		in		tmp1, _SFR_IO_ADDR(TIMSK)			; enable TIMER1 to start counting
		ori		tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses and interrupt on 0x04
		out		_SFR_IO_ADDR(TIMSK),tmp1			; overflow			
		
		in 		tmp1, _SFR_IO_ADDR(EIMSK)	; enable the HREF interrupt...remember, we
											; only use this interrupt to synchronize
											; the beginning of the line  INT3
		ori 	tmp1, HREF_INTERRUPT_ENABLE_MASK ;0x08
		out		_SFR_IO_ADDR(EIMSK), tmp1
		
		
		
;*******************************************************************************************
;   Dump Frame handler 
;*******************************************************************************************		
		
_dumpFrame:		
		sbi		_SFR_IO_ADDR(PORTB),PB6
		sleep   ; ...And we wait...

		cbi		_SFR_IO_ADDR(PORTB),PB6             ;(2)
		in 		tmp1, _SFR_IO_ADDR(EIMSK)			;(1) disable the HREF interrupt
		andi 	tmp1, HREF_INTERRUPT_DISABLE_MASK  	;(1) so we don't get interrupted
		out		_SFR_IO_ADDR(EIMSK), tmp1			;(1) while dumping the line
	
		;nop		;改 Remember...if we ever remove the "cbi" instruction above,
				; we need to add two more NOPs to cover this
    
; Ok...the following loop needs to run in 8 clock cycles, so we can get every
; pixel in the line...this shouldn't be a problem, since the PCLK timing was
; reduced by a factor of 2 whenever we go to dump a line (this is to give us
; enough time to do the sampling and storing of the pixel data).  In addition,
; it is assumed that we will have to do some minor processing on the data right
; before we send it out, like mask off the top 4-bits of each, and then pack both
; low nibbles into a single byte for transmission...we just don't have time to
; do that here (only 8 instruction cycles :-)  )
_sampleDumpPixel:
		in		tmp1,G_PORT			    ; sample the G value					(1)
		in		tmp2,RB_PORT			; sample the R/B value					(1)
		st		X+,tmp1					; store to the currLineBuff and inc ptrs(2)
		st		Y+,tmp2					; store to the prevLineBuff and inc ptrs(2)
		brtc	_sampleDumpPixel		; loop back unless flag is set			(2...if not set)
										;									___________
										;									8 cycles normally
																			
		; if we make it here, it means the T flag is set, and we must have been interrupted
		; so we need to exit (what if we were interrupted for serial? should we disable it?)
		
		
		
		rjmp	_cleanUpDumpLine	

;***********************************************************
;	Function Name: <interrupt handler for External Interrupt0> 
;	Function Description: This function is responsible
;	for handling a rising edge on the Ext Interrupt 0.  This
;	routine simply returns, since we just want to wake up
;	whenever the VSYNC transitions (meaning the start of a new
;	frame).
;	Inputs:  none
;	Outputs: none
;***********************************************************
SIG_INTERRUPT2:
; This will wake us up when VSYNC transitions high...we just want to return
		reti
		
;***********************************************************
;	Function Name: <interrupt handler for External Interrupt1> 
;	Function Description: This function is responsible
;	for handling a falling edge on the Ext Interrupt 1.  This
;	routine simply returns, since we just want to wake up
;	whenever the HREF transitions (meaning the pixels 
;	are starting after VSYNC transitioned, and we need to
; 	start acquiring the pixel blocks
;	Inputs:  none
;	Outputs: none
;***********************************************************	
SIG_INTERRUPT3:
; This will wake us up when HREF transitions high...we just want to return
		reti                     ;(4)                
		

;***********************************************************
;	Function Name: <interrupt handler for Timer1 overflow>
;	Function Description: This function is responsible
;	for handling the Timer1 overflow (hooked up to indicate
;	when we have reached the end of a line of pixel data,
;	since PCLK is hooked up to overflow TCNT1 after 176 
;	pixels).  This routine generates an acquire line complete
;	event in the fastEventBitmask, which is streamlined for
;	efficiency reasons.
;***********************************************************
SIG_OVERFLOW1:				
		lds		tmp1,fastEventBitmask   		; set a flag indicating
		ori		tmp1,FEV_ACQUIRE_LINE_COMPLETE	; a line is complete
		sts		fastEventBitmask,tmp1
		set		; set the T bit in SREG 

		reti

; This is the default handler for all interrupts that don't
; have handler routines specified for them.
        .global __vector_default              
__vector_default:
        reti

        .end

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产一区二区三| 国产成人av一区二区三区在线| 日韩视频免费直播| 99视频一区二区| 精品影视av免费| 一区二区三区欧美激情| 久久综合九色综合欧美就去吻| 日本韩国视频一区二区| 国产精品12区| 日韩精品1区2区3区| 亚洲人午夜精品天堂一二香蕉| 日韩欧美国产不卡| 欧美三日本三级三级在线播放| 国产不卡视频一区| 黄色成人免费在线| 日本在线观看不卡视频| 亚洲自拍偷拍综合| 国产精品另类一区| 久久一留热品黄| 日韩写真欧美这视频| 欧美日韩一区二区在线观看视频| 一本大道av伊人久久综合| 丁香六月综合激情| 国产一本一道久久香蕉| 久久99精品久久久久婷婷| 天天爽夜夜爽夜夜爽精品视频| 一区二区在线免费观看| 亚洲欧洲性图库| 国产精品电影一区二区| 国产欧美日韩另类一区| 久久精品日韩一区二区三区| 精品国产a毛片| 日韩欧美在线一区二区三区| 制服丝袜一区二区三区| 欧美日本在线播放| 欧美精品v日韩精品v韩国精品v| 成a人片亚洲日本久久| 亚洲最快最全在线视频| 日韩欧美国产一区二区三区| 欧美午夜在线观看| 在线观看成人免费视频| 91丨porny丨中文| 91视频在线观看| 欧洲av在线精品| 欧美三级视频在线观看| 欧美日韩一卡二卡| 91精品国产丝袜白色高跟鞋| 欧美一级一区二区| 日韩一区二区电影| 久久伊人中文字幕| 欧美激情一区在线| 亚洲视频 欧洲视频| 一区二区三区久久久| 午夜精品久久久久久久久| 日韩国产欧美三级| 久久99国内精品| 成人深夜在线观看| 色婷婷综合激情| 欧美日韩免费观看一区二区三区| 欧美精品v国产精品v日韩精品 | 久久精品视频在线看| 欧美激情一区二区三区不卡| 亚洲欧美日韩国产综合| 亚洲国产一区二区a毛片| 日本免费新一区视频| 国产一区二区电影| 色天天综合色天天久久| 欧美日韩aaa| 国产网站一区二区三区| 亚洲人成7777| 美女一区二区久久| 成人一区二区三区视频 | 欧美性生交片4| 日韩欧美一区二区视频| 中文字幕av免费专区久久| 亚洲精品欧美激情| 久久er精品视频| 99久久综合狠狠综合久久| 欧美久久久久久蜜桃| 国产亚洲福利社区一区| 亚洲一区二区av电影| 国产一区二区不卡老阿姨| 色综合久久久久综合体 | **欧美大码日韩| 青青国产91久久久久久| av一区二区久久| 日韩免费高清av| 亚洲欧美日韩国产综合在线| 九一九一国产精品| 欧美亚洲高清一区| 国产日产欧美精品一区二区三区| 亚洲成年人网站在线观看| 国产精品一区不卡| 制服视频三区第一页精品| 国产精品黄色在线观看| 久久国产婷婷国产香蕉| 91福利国产精品| 亚洲国产精品高清| 免费人成精品欧美精品| 色拍拍在线精品视频8848| 久久久久久久久久看片| 日产欧产美韩系列久久99| 91免费看`日韩一区二区| 久久天天做天天爱综合色| 亚洲国产综合视频在线观看| 成人激情视频网站| 精品久久久久久无| 日本欧美大码aⅴ在线播放| 色诱亚洲精品久久久久久| 国产亚洲成aⅴ人片在线观看| 蜜臀av性久久久久av蜜臀妖精| 欧美性大战久久久| 亚洲人午夜精品天堂一二香蕉| 国产精品影音先锋| 欧美成人bangbros| 美腿丝袜一区二区三区| 欧美精品乱码久久久久久按摩 | 狠狠色丁香久久婷婷综| 欧美精品 日韩| 亚洲午夜日本在线观看| 99在线精品免费| 国产精品色哟哟| 国产成人精品亚洲777人妖| 亚洲精品在线三区| 美女一区二区视频| 日韩女优av电影| 男人的j进女人的j一区| 欧美高清dvd| 日韩av网站在线观看| 欧美一区二区三区在| 婷婷久久综合九色国产成人| 欧美精品第1页| 日本va欧美va精品| 日韩视频123| 老司机一区二区| 精品久久久久久久久久久久久久久久久 | 日韩欧美电影一二三| 午夜久久久久久久久| 欧美日韩免费高清一区色橹橹| 亚洲v中文字幕| 欧美美女直播网站| 日韩激情在线观看| 欧美电影免费观看完整版| 经典一区二区三区| 国产视频一区不卡| 成人激情视频网站| 一区二区三区四区高清精品免费观看 | 亚洲免费高清视频在线| 在线亚洲人成电影网站色www| 一区二区三区精品在线观看| 欧美体内she精视频| 美女性感视频久久| 久久久久久久久伊人| 成人高清免费观看| 艳妇臀荡乳欲伦亚洲一区| 欧美精品在欧美一区二区少妇| 麻豆精品在线观看| 欧美韩国日本一区| 在线观看三级视频欧美| 亚瑟在线精品视频| 久久精品亚洲麻豆av一区二区| 成人app下载| 婷婷夜色潮精品综合在线| 精品少妇一区二区三区| 成人激情校园春色| 亚洲成av人片www| 26uuu另类欧美亚洲曰本| 97久久精品人人澡人人爽| 亚洲高清在线精品| 久久久欧美精品sm网站| 色综合亚洲欧洲| 蜜臀av国产精品久久久久| 国产精品麻豆一区二区| 欧美精品久久久久久久多人混战 | 色94色欧美sute亚洲线路一ni | 一区二区三区在线看| 日韩视频一区二区在线观看| 成人黄动漫网站免费app| 亚洲国产日韩综合久久精品| 久久综合色婷婷| 欧美视频三区在线播放| 国产精品99久久久久久久vr| 一区二区三区四区精品在线视频| 精品国产123| 在线欧美日韩精品| 国产麻豆精品theporn| 亚洲午夜免费福利视频| 国产欧美日韩三级| 91精品综合久久久久久| 91丨porny丨在线| 精品一区二区日韩| 亚洲综合成人网| 久久久久99精品国产片| 91 com成人网| 99视频有精品| 国产福利一区在线观看| 日韩黄色一级片| 一区二区三区精品| 国产欧美一区二区精品婷婷| 欧美一区二区三区免费视频|