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

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

?? caminterfaceasm.s

?? The AVRcam source files were built using the WinAVR distribution (version 3.3.1 of GCC). I haven t
?? S
?? 第 1 頁 / 共 2 頁
字號:
;       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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品视频一区二区三区八戒| 国产在线精品免费| 久久久久久电影| 91成人网在线| 成人性生交大合| 日本欧美在线观看| 一二三区精品福利视频| 国产肉丝袜一区二区| 91精品国产综合久久久久久久久久 | 国产suv精品一区二区883| 天堂午夜影视日韩欧美一区二区| 中文字幕av在线一区二区三区| 日韩一级欧美一级| 色哟哟亚洲精品| 成人中文字幕在线| 国产麻豆精品视频| 久久99精品久久久久久久久久久久| 一区二区三区鲁丝不卡| 国产精品看片你懂得| 久久久精品天堂| 欧美电视剧免费全集观看| 欧美人妖巨大在线| 欧美日韩一区二区三区四区| 一本久道久久综合中文字幕| av一区二区久久| 国产成人午夜视频| 国产剧情一区二区| 精品在线亚洲视频| 久草这里只有精品视频| 美女视频免费一区| 久久99久久精品| 激情综合网最新| 精品一区二区综合| 欧美嫩在线观看| 欧美午夜一区二区| 欧美日韩成人在线一区| 欧美私模裸体表演在线观看| 欧美色图一区二区三区| 欧美日韩中文国产| 欧美吻胸吃奶大尺度电影| 欧美视频一二三区| 欧美一区二区在线观看| 欧美一级视频精品观看| 精品国产sm最大网站免费看| 久久综合精品国产一区二区三区 | 丝袜诱惑制服诱惑色一区在线观看| 一区二区三区在线观看视频| 亚洲夂夂婷婷色拍ww47| 天天综合色天天综合色h| 日韩黄色小视频| 激情文学综合网| 国产成人亚洲综合a∨婷婷 | 国产精品妹子av| 色呦呦网站一区| 欧美日韩亚洲综合一区二区三区| 欧美视频一区二区在线观看| 91精品国产入口| 久久久蜜臀国产一区二区| 国产三级久久久| 亚洲色图清纯唯美| 亚洲高清三级视频| 麻豆国产精品777777在线| 国产福利一区在线| 91丝袜呻吟高潮美腿白嫩在线观看| 色哟哟国产精品免费观看| 欧美日韩免费电影| 久久精品水蜜桃av综合天堂| 中文字幕在线免费不卡| 亚洲小说春色综合另类电影| 麻豆久久一区二区| 成人免费毛片app| 在线观看91精品国产入口| 日韩精品一区二区三区swag| 国产精品久久午夜夜伦鲁鲁| 午夜激情一区二区三区| 国产一区二区三区最好精华液| 93久久精品日日躁夜夜躁欧美| 91.com在线观看| 国产欧美精品在线观看| 香蕉久久夜色精品国产使用方法| 狠狠色丁香久久婷婷综合_中 | 午夜在线成人av| 国产一区二区三区高清播放| 91麻豆swag| 精品国产区一区| 亚洲午夜精品在线| 国产suv精品一区二区6| 欧美日韩国产高清一区二区 | 秋霞电影网一区二区| 成年人网站91| 日韩精品一区在线观看| 一二三四区精品视频| 国产成人高清视频| 91精品国产aⅴ一区二区| 最近日韩中文字幕| 精品区一区二区| 亚洲伦理在线免费看| 国产在线播放一区二区三区 | 国产精品第一页第二页第三页| 婷婷综合五月天| 一本一本久久a久久精品综合麻豆| 精品国产乱码久久久久久牛牛| 亚洲成人动漫一区| 91在线你懂得| 欧美国产禁国产网站cc| 麻豆高清免费国产一区| 欧美日韩不卡一区二区| 一区二区不卡在线视频 午夜欧美不卡在 | 高清成人在线观看| 欧美一个色资源| 亚洲国产欧美另类丝袜| av亚洲精华国产精华精华| 久久伊人蜜桃av一区二区| 欧美aⅴ一区二区三区视频| 欧美性猛片xxxx免费看久爱| 中文字幕色av一区二区三区| 国产一区二区三区香蕉| 日韩精品专区在线影院重磅| 午夜伦理一区二区| 欧美日韩国产一级二级| 一区二区三区四区中文字幕| 99免费精品视频| 国产欧美一区二区精品久导航| 激情综合色丁香一区二区| 7777精品伊人久久久大香线蕉经典版下载 | 国产宾馆实践打屁股91| 久久久久久久久岛国免费| 久久精品国产在热久久| 欧美一区二区三级| 日韩电影在线一区| 日韩欧美在线123| 美女视频黄频大全不卡视频在线播放| 欧美优质美女网站| 亚洲妇熟xx妇色黄| 在线播放视频一区| 日本不卡在线视频| 日韩片之四级片| 极品销魂美女一区二区三区| 精品国产污污免费网站入口 | 2021中文字幕一区亚洲| 国产资源精品在线观看| 精品国产人成亚洲区| 国产成人夜色高潮福利影视| 国产精品免费观看视频| 一本在线高清不卡dvd| 亚洲成人精品影院| 精品人伦一区二区色婷婷| 国产在线观看一区二区| 国产精品麻豆99久久久久久| 99麻豆久久久国产精品免费优播| 亚洲激情综合网| 欧美另类变人与禽xxxxx| 免费日本视频一区| 国产日韩欧美一区二区三区乱码 | 日韩一区二区在线观看| 另类的小说在线视频另类成人小视频在线| 欧美一区二区三区啪啪| 9191成人精品久久| 国产精品一级黄| 亚洲视频一区在线观看| 欧美三级中文字幕| 国产又黄又大久久| 中文字幕日韩精品一区| 欧美日韩日日骚| 国产真实乱子伦精品视频| 中文字幕一区二| 欧美人体做爰大胆视频| 国产激情精品久久久第一区二区| 中文字幕亚洲一区二区va在线| 欧美精品免费视频| 国产风韵犹存在线视精品| 亚洲最新在线观看| 精品国产伦一区二区三区观看方式| av在线不卡免费看| 美女一区二区视频| 国产精品不卡视频| 日韩欧美激情在线| 色综合一区二区三区| 免费不卡在线视频| 亚洲欧美日本在线| wwwwxxxxx欧美| 在线观看区一区二| 国产精品资源在线观看| 亚洲成人第一页| 国产精品久久毛片av大全日韩| 9191精品国产综合久久久久久| 高清不卡一区二区| 秋霞电影网一区二区| 亚洲乱码国产乱码精品精的特点 | 色综合久久精品| 国产在线视频精品一区| 亚洲一区二区欧美日韩| 久久久久9999亚洲精品| 欧美日韩国产另类一区| 91日韩一区二区三区| 狠狠色狠狠色综合日日91app| 亚洲国产精品自拍| 亚洲欧美偷拍三级| 国产女人18毛片水真多成人如厕| 欧美猛男超大videosgay|