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

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

?? caminterfaceasm.s

?? ov7620是采用cmos傳感器技術(shù)的攝像頭
?? S
?? 第 1 頁 / 共 2 頁
字號(hào):
;       Module Name: CanInterfaceAsm.S
;       Module Date: 04/14/2004
;       Module Auth: John Orlando 
;       Copyright (c) 2004 John Orlando  All Rights Reserved 
;
;       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              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.


; 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
                                                ; 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)
            ldd     blueData,Z+BLUE_MEM_OFFSET      ; lookup the blue membership         (2)
            and     color,greenData                 ; mask memberships together          (1)
            and     color,blueData                  ; to produce the final color         (1)
            brts    _cleanUpTrackingLine            ; if some interrupt routine has      (1...not set)
                                                    ; come in and set our T flag in 
                                                    ; SREG, then we need to hop out
                                                    ; and blow away this frames data (common cleanup)									
            cp      color,lastColor                 ; check to see if the run continues  (1)
            breq    _acquirePixelBlock              ;                                    (2...equal)
                                                    ;                                ___________
                                                    ;                                    16 clock cycles 		
                                                    ;        (16 clock cycles = 1 uS = 1 pixelBlock time)
		
		; Toggle the debug line to indicate a color change
		sbi   _SFR_IO_ADDR(PORTD),PD6
		nop
		cbi	_SFR_IO_ADDR(PORTD),PD6
		
		mov	tmp2,pixelRunStart		; get the count value of the

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品国产成人国产三级粉色| 精品剧情v国产在线观看在线| 国产精品久久一卡二卡| 国产成人av电影在线观看| 久久久久久久久久看片| 成人黄色在线网站| 亚洲视频一区在线观看| 欧美色偷偷大香| 久久超碰97中文字幕| 久久久91精品国产一区二区三区| 成人av资源站| 亚洲亚洲精品在线观看| 欧美一区二区美女| 国产成人在线免费| 亚洲日本在线a| 欧美精品在线一区二区| 九色综合狠狠综合久久| 国产精品国产三级国产a| 欧美影视一区在线| 精品在线免费观看| 美国毛片一区二区| 在线免费亚洲电影| 亚洲制服丝袜在线| 日韩欧美国产wwwww| 粉嫩绯色av一区二区在线观看| 精品一区二区三区久久久| 99re亚洲国产精品| 婷婷中文字幕综合| 亚洲国产成人av网| 成人手机在线视频| 国产成人免费网站| 国产精品99久久久久久久女警| 看电视剧不卡顿的网站| 美女在线观看视频一区二区| 五月婷婷欧美视频| 水野朝阳av一区二区三区| 亚洲成人中文在线| 午夜精品久久久久久久久| 亚洲国产精品一区二区久久恐怖片| 亚洲婷婷综合色高清在线| 中文字幕一区二区三| 中文字幕日韩一区二区| 国产精品黄色在线观看| 中文字幕五月欧美| 亚洲精品免费电影| 亚洲成a人v欧美综合天堂| 香蕉成人伊视频在线观看| 日韩中文字幕亚洲一区二区va在线| 午夜视频在线观看一区二区三区 | 亚洲一级二级三级| 夜夜精品视频一区二区| 亚洲一区免费观看| 肉色丝袜一区二区| 蓝色福利精品导航| 国产91丝袜在线播放0| 成人一区在线观看| 色综合久久99| 欧美丰满少妇xxxbbb| 精品国产乱码91久久久久久网站| www激情久久| 国产精品激情偷乱一区二区∴| 一区二区三区在线视频观看58| 亚洲国产aⅴ成人精品无吗| 日韩av在线播放中文字幕| 激情六月婷婷综合| av午夜精品一区二区三区| 91国在线观看| 日韩精品专区在线影院重磅| 国产性色一区二区| 亚洲精品乱码久久久久久久久| 午夜不卡在线视频| 国产成人精品亚洲日本在线桃色 | 东方欧美亚洲色图在线| 色综合网色综合| 777精品伊人久久久久大香线蕉| 欧美电视剧在线看免费| 国产精品福利一区| 日韩国产欧美视频| 国产成人综合精品三级| 在线视频观看一区| 精品粉嫩超白一线天av| 亚洲人成人一区二区在线观看| 欧美96一区二区免费视频| 国产91精品一区二区| 欧美日韩国产天堂| 中文字幕乱码亚洲精品一区| 亚洲成人av福利| www.在线欧美| 欧美第一区第二区| 亚洲午夜一区二区三区| 国产成人午夜片在线观看高清观看| 91片黄在线观看| 久久久久久久综合狠狠综合| 夜夜爽夜夜爽精品视频| 国产+成+人+亚洲欧洲自线| 欧美日韩精品福利| 国产精品进线69影院| 另类中文字幕网| 欧美在线观看一区二区| 中文字幕va一区二区三区| 免费成人性网站| 欧美性大战久久久久久久蜜臀| 欧美激情综合网| 久久机这里只有精品| 欧美日韩精品二区第二页| 国产精品美女久久久久久久| 麻豆成人免费电影| 欧美日韩精品一区二区三区四区| 国产精品国产a级| 国产精品一二三区| 欧美草草影院在线视频| 婷婷综合久久一区二区三区| 色噜噜狠狠色综合中国| 中文字幕av一区 二区| 国产在线播精品第三| 欧美成人欧美edvon| 视频一区二区不卡| 欧美亚洲国产怡红院影院| 综合自拍亚洲综合图不卡区| 国产黄色91视频| 久久久亚洲欧洲日产国码αv| 日韩二区三区在线观看| 欧美日韩免费观看一区三区| 亚洲女同ⅹxx女同tv| av日韩在线网站| 国产精品乱人伦一区二区| 国产精品一区久久久久| 2017欧美狠狠色| 裸体在线国模精品偷拍| 日韩视频中午一区| 日本色综合中文字幕| 欧美一区二区大片| 五月婷婷综合激情| 69堂精品视频| 日本亚洲最大的色成网站www| 欧美日韩国产大片| 日产欧产美韩系列久久99| 欧美电影在哪看比较好| 日韩电影在线一区| 日韩一区二区三区在线| 美国毛片一区二区| 欧美成人精品高清在线播放| 韩国毛片一区二区三区| 久久这里只有精品6| 国产成人久久精品77777最新版本| 久久九九影视网| av在线不卡电影| 亚洲久草在线视频| 欧美伦理影视网| 久久激情综合网| 亚洲国产高清不卡| 一本一本大道香蕉久在线精品 | 狠狠色丁香婷综合久久| 久久久久久久久97黄色工厂| 国产精品白丝jk黑袜喷水| 国产精品女主播在线观看| 99精品久久只有精品| 一区二区三区高清不卡| 6080国产精品一区二区| 精品一区二区在线观看| 国产精品网站一区| 色天天综合色天天久久| 日韩国产高清影视| 久久久五月婷婷| 日本高清不卡在线观看| 日本强好片久久久久久aaa| 久久精品亚洲国产奇米99| 91片黄在线观看| 美女视频免费一区| 国产精品美女久久久久高潮| 欧美午夜片在线看| 国产专区综合网| 亚洲欧美日韩一区| 日韩免费高清av| 99精品热视频| 久久国产精品99久久久久久老狼| 国产精品私人影院| 欧美男女性生活在线直播观看| 国产一区二区免费在线| 一区二区三区四区视频精品免费| 日韩一区国产二区欧美三区| 成人动漫视频在线| 日韩精品国产精品| 中文字幕一区二区三区视频| 91精品国产黑色紧身裤美女| 成人美女在线视频| 日韩精品一卡二卡三卡四卡无卡| 久久九九影视网| 欧美一区日本一区韩国一区| av电影天堂一区二区在线 | 国产真实乱子伦精品视频| 亚洲女同一区二区| 久久久久久久久久久电影| 欧美无人高清视频在线观看| 国产**成人网毛片九色| 日本在线不卡一区| 亚洲综合一区二区三区| 中文字幕免费在线观看视频一区| 日韩一级大片在线观看| 在线免费观看日本欧美|