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

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

?? mouse45b.asm

?? USB大全電子版全部資料3~包含源碼、協(xié)議等
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
	dec A					; check if idle_period <= idle_period_counter

	cmp A, [idle_period_counter]

      jnc Nosend

      

send_packet:

	iord USB_EP1_TX_Config

	and A, 80h

	cmp A, 80h

	jz Nosend

	mov A, [horizontal]	

	mov [horiz_position], A	

	mov A, [vertical]	

	mov [vert_position], A

	mov A, [buttons]	

	mov [button_position], A	

	iord USB_EP1_TX_Config

	and A, DataToggle		; keep the data 0/1 bit

	or A, 93h			; enable transmit 3 bytes

	iowr USB_EP1_TX_Config



      mov A,[new_idle_flag]  ;if it received a new idle

      cmp A,0                   ;period 4 ms before the previous one

      jz prev_idle              ;counted finishes, need to upgrade

      mov A,[new_idle_period]   ;with a new value

	mov [idle_period],A

      mov A,0

      mov [new_idle_flag],A 

	jmp reset_idle_period_counter 

prev_idle:                     ;

;      mov A,[prev_idle_period]

;      mov [idle_period],A



reset_idle_period_counter: 

      mov A,0

      mov [idle_period_counter],A

	mov [horizontal], A

	mov [vertical], A

	mov [button_flag], A

Nosend:

	jmp main



;========================================================================

; Read the mouse buttons.  If the buttons have changed from the last

; value read, then enable data transmission from endpoint one.

;

; Hardware has buttons in MRL order.  We need to translate them

; to data bits [2:0].

;

;       Port 0 bit[6]   Middle  => bit 2

;       Port 0 bit[5]   Right   => bit 1

;       Port 0 bit[4]   Left    => bit 0

;

ReadButtons:

	mov A, [button1_deb]

	cmp A, 0h

	jnz DoneButtons



	mov A, [port_temp]

	cpl A				; buttons are now 1 when pressed



	asr				; [6:4] => [5:3]

	asr				; [5:3] => [4:2]

	asr				; [4:2] => [3:1]

      asr                     ; [3:1] => [2:0]

      and A, 7h               ; mask out non-buttons

	

	cmp A,[buttons]		; have buttons changed?

	jz DoneButtons



	mov [buttons], A		; move buttons to dma buffer

	mov A, 01h

	mov [button_flag], A

	mov A, 01h

	mov [button1_deb], A



DoneButtons:

	ret				; return to main loop



;========================================================================

; This is a state transition table (16 bytes) that has four input bits:

; 	bit [3:2]	previous state

;	bit [1:0]	current state

;

; The state sequences are:

;	00 => 01 => 11 => 10	increment

;	00 => 10 => 11 => 01	decrement

;

;	00 00 =>  0	00 01 =>  1	00 10 => -1	00 11 =>  0

;	01 00 => -1	01 01 =>  0	01 10 =>  0	01 11 =>  1

;	10 00 =>  1	10 01 =>  0	10 10 =>  0	10 11 => -1

;	11 00 =>  0	11 01 => -1	11 10 =>  1	11 11 =>  0

; 

; The count stays the same if either the states are the same or the

; state changed by two transitions (jump).   

;

	XPAGEOFF		; do not insert XPAGE instructions in a table

StateTable:

	db  0,  1, -1,  0

	db -1,  0,  0,  1

	db  1,  0,  0, -1 

	db  0, -1,  1,  0

	XPAGEON		; insert XPAGE instructions automatically



; If the wheels are configured backwards the StateTable matrix

; 1's and -1's should be exchanged to flip the x and y directions.

; If only one direction has its wheels configured backwards then

; two seperate StateTables should be used and one of them will

; need the 1 to -1 and vice versa exchange.

; A wheel is configured backwards if the two phototransistors 

; associated with it are connected in opposite order to this

; reference design.



;========================================================================

; Check for horizontal movement of the mouse.

;

CheckHorizontal:

	mov A, [port_temp]	; load current state

	and A, 3h			; mask out the rest of the bits

	push A			; save the current state on stack

	or A, [horiz_state]	; include the previous state

	index StateTable		; read increment from PROM	



	add A, [horizontal]	; add increment

	mov [horizontal], A	



	pop A				; restore current state from stack

	asl				; bit[1:0] => bit[2:1]

	asl				; bit[2:1] => bit[3:2]

	mov [horiz_state],A	; update previous state in memory

	ret

;========================================================================

; Check for vertical movement of the mouse.  The first time I tried this,

; the horizontal movement worked and the vertical movement was backward.

; To correct the problem, the current and next states are switched in the

; check vertical routine when compared with the horizontal states.

;

CheckVertical:

	mov A, [port_temp]	; load current state

	and A, 0ch			; mask out the rest of the bits

	push A			; save the current state on stack

	or A, [vert_state]	; include the previous state

	index StateTable		; read increment from PROM	



	add A, [vertical]		; add increment

	mov [vertical], A	



	pop A				; restore current state from stack

      asr A                   ; bit[3:2] => bit[2:1]

      asr A                   ; bit[2:1] => bit[1:0]

      mov [vert_state],A	; update previous state in memory

	ret





;*******************************************************

;

;	Interrupt handler: endpoint_zero

;	Purpose: This interrupt routine handles the specially

;		 reserved control endpoint 0 and parses setup 

;		 packets.  If a IN or OUT is received, this 

;		 handler returns to the control_read

;		 or no_data_control routines to send more data.

;

;*******************************************************

;========================================================================

; The endpoint zero interrupt service routine supports the control

; endpoint.  This firmware enumerates and configures the hardware.

USB_EP0_ISR:

      push A                  		; save accumulator on stack

	iord USB_EP0_RX_Status			; load status register into accumulator

	and A, 01h					; check if SETUP packet received

	jz ep0_continue				; ignore unless SETUP packet 

	mov A,[interrupt_mask]			; disable endpoint zero interrupts

	and A, 0F7h

	mov [interrupt_mask], A

	iowr Global_Interrupt

      call StageOne           		; parse SETUP packet

	mov A, [interrupt_mask]			; enable endpoint zero interrupts

	or A, 08h

	mov [interrupt_mask], A	

ep0_continue:

	mov A, [interrupt_mask]			; enable the interrupts

	ipret Global_Interrupt



;========================================================================

;       stage one ... test bmRequestType

;========================================================================

StageOne:

;------------------------------------------------------------------------

; Parse standard device requests as per Table 9.2 in USB Spec.

;------------------------------------------------------------------------

	mov A, 00h					; clear the setup flag to write DMA

	iowr USB_EP0_RX_Status

	mov A, 8					; set BadOut bit

	iowr USB_Status_Control

      mov A, [bmRequestType]  		; load bmRequestType

; host to device

        cmp A, 00h

        jz RequestType00        		; bmRequestType = 00000000 device

;       cmp A, 01h              		*** not required ***  

;       jz RequestType01        		; bmRequestType = 00000001 interface

        cmp A, 02h              

        jz RequestType02        		; bmRequestType = 00000010 endpoint

        cmp A, 80h             

; device to host

        jz RequestType80        		; bmRequestType = 10000000 device

        cmp A, 81h

        jz RequestType81       		; bmRequestType = 10000001 interface

        cmp A, 82h

        jz RequestType82       		; bmRequestType = 10000010 endpoint

;-----------------------------------------------------------------------

; Parse HID class device requests as per HID version 1.0 Draft #4

;-----------------------------------------------------------------------

; host to device

        cmp A, 21h

        jz RequestType21        		; bmRequestType = 00100001 interface

        cmp A, 22h             		; *** not in HID spec ***

        jz RequestType22       		; bmRequestType = 00100010 endpoint

; device to host

        cmp A, A1h

        jz RequestTypeA1        		; bmRequestType = 10100001 interface

        cmp A, A2h				; *** not in HID spec ***

        jz RequestTypeA2        		; bmRequestType = 10100010 interface



;-----------------------------------------------------------------------

; Stall unsupported functions

;-----------------------------------------------------------------------

SendStall:						; stall unsupported functions

      mov A, A0h					; send a stall to indicate the requested

	iowr USB_EP0_TX_Config			; function is not supported

      ret                    			; return

;========================================================================

;       stage two ... test bRequest

;========================================================================

; host to device with device as recipient

RequestType00:

	mov A, [bRequest]	; load bRequest

;------------------------------------------------------------------------

; The only standard feature defined for a "device" recipient is

; device_remote_wakeup.  Remote wakeup is the ability to "wakeup" a

; system from power down mode by pressing a key or moving a button.

; The default condition at reset is remote wakeup disabled.

;------------------------------------------------------------------------

; Clear Feature                 	bRequest = 1

        cmp A, clear_feature

        jz ClearRemoteWakeup 

; Set Feature 				bRequest = 3

	cmp A, set_feature

        jz SetRemoteWakeup

;------------------------------------------------------------------------

; Set the device address to a non-zero value.

; Set Address 				bRequest = 5

	cmp A, set_address

	jz SetAddress

;------------------------------------------------------------------------

; This request is optional.  If a device supports this request, existing

; device descriptors may be updated or new descriptors may be added.

; Set Descriptor                bRequest = 7    *** not supported ***

;------------------------------------------------------------------------

; If wValue is zero, the device is unconfigured.  The only other legal

; configuration for this version of firmware is one.

; Set Configuration 		bRequest = 9

	cmp A, set_configuration

	jz SetConfiguration

    	jmp SendStall           ; stall unsupported function calls

                                                       

;========================================================================

; host to device with interface as recipient    *** not required ***

; RequestType01:

;        mov A, [bRequest]       ; load bRequest

;------------------------------------------------------------------------

; There are no interface features defined in the spec.

; Clear Feature                 bRequest = 1    *** not supported ***

; Set Feature                   bRequest = 3    *** not supported ***

;------------------------------------------------------------------------

; This request allows the host to select an alternate setting for the

; specified interface.  As the mouse only has one interface setting,

; this request is not supported.

; Set Interface                 bRequest = 11   *** not supported ***

;        jmp SendStall           ; stall unsupported functions



;========================================================================

; host to device with endpoint as recipient

RequestType02:

	mov A, [bRequest]	; load bRequest

;------------------------------------------------------------------------

; The only standard feature defined for an endpoint is endpoint_stalled.  



; Clear Feature			bRequest = 1

	cmp A, clear_feature

      jz ClearEndpointStall

; Set Feature			bRequest = 3

	cmp A, set_feature

      jz SetEndpointStall

	jmp SendStall		; stall unsupported functions



;=======================================================================

; device to host with device as recipient

RequestType80:

	mov A, [bRequest]		; load bRequest

; Get Status			bRequest = 0

	cmp A, get_status

      jz GetDeviceStatus

; Get Descriptor			bRequest = 6

	cmp A, get_descriptor

	jz GetDescriptor

; Get Configuration		bRequest = 8

	cmp A, get_configuration

	jz GetConfiguration

	jmp SendStall		; stall unsuported functions



;=======================================================================

; device to host with interface as recipient

RequestType81:

	mov A, [bRequest]	; load bRequest

; Get Status			bRequest = 0

      cmp A, get_status

      jz GetInterfaceStatus

;------------------------------------------------------------------------

; This request returns the selected alternate setting for the specified

; interface.  There are no alternate settings for the mouse.

; Get Interface                 bRequest = 10   *** not supported ***

;------------------------------------------------------------------------

; HID class defines one more request for bmRequestType=10000001

; Get Descriptor                bRequest = 6

      cmp A, get_descriptor

      jz GetDescriptor

	jmp SendStall		; stall unsupported functions



;=======================================================================

; device to host with endpoint as recipient

RequestType82:

	mov A, [bRequest]		; load bRequest

; Get Status			bRequest = 0

	cmp A, get_status

      jz GetEndpointStatus

;------------------------------------------------------------------------

; Not defined in the spec, but it must be decoded for the enumeration to

; complete under Memphis.

; Get Descriptor			bRequest = 6

	cmp A, get_descriptor

	jz GetDescriptor

; Sync Frame                  bRequest = 12   *** not supported ***

	jmp SendStall		; stall unsupported functions



;========================================================================

;	Now parse HID class Descriptor Types

;========================================================================

; host to device with endpoint as recipient

RequestType21:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人a免费在线看| 紧缚捆绑精品一区二区| 久久久久久久久久电影| 日韩欧美一区二区不卡| 日韩欧美在线网站| 精品免费国产二区三区| 日韩欧美视频在线| 精品久久五月天| 久久天天做天天爱综合色| 久久久久国产精品麻豆ai换脸 | 欧美放荡的少妇| 欧美日韩和欧美的一区二区| 欧美日韩激情一区二区三区| 欧美精品乱码久久久久久按摩| 欧美日韩国产美| 日韩三级.com| 国产精品欧美久久久久一区二区| 国产精品免费视频观看| 亚洲免费视频成人| 日本在线不卡视频| 国产福利一区二区三区在线视频| 成人精品国产免费网站| 91久久一区二区| 91精品国产乱| 国产三级一区二区| 一区二区三区四区国产精品| 日本欧洲一区二区| 国产v日产∨综合v精品视频| av福利精品导航| 欧美精品 国产精品| 久久久99免费| 亚洲一区二区精品视频| 精品制服美女丁香| 91丨九色丨蝌蚪丨老版| 欧美一区二区三区免费在线看 | 一区二区三区在线影院| 日韩vs国产vs欧美| 成人激情文学综合网| 欧美亚洲尤物久久| 久久久蜜桃精品| 亚洲综合偷拍欧美一区色| 国产做a爰片久久毛片| 91理论电影在线观看| 久久综合九色综合欧美就去吻 | 欧美一级黄色片| 亚洲欧美在线高清| 麻豆精品国产91久久久久久| 97精品久久久午夜一区二区三区| 91精品国产乱码| 亚洲精品乱码久久久久| 国产精品一卡二| 91精品婷婷国产综合久久性色| 国产精品天干天干在线综合| 蜜臀av性久久久久av蜜臀妖精| 91丝袜美腿高跟国产极品老师| 久久综合色婷婷| 日韩综合小视频| 在线观看亚洲专区| 国产精品二区一区二区aⅴ污介绍| 国产一区二区主播在线| 在线精品视频免费播放| 中文字幕日韩一区二区| 国产精品888| 精品国产乱码久久久久久1区2区 | 亚洲丝袜自拍清纯另类| 韩国精品久久久| 日韩精品专区在线影院观看| 舔着乳尖日韩一区| 欧美日韩国产经典色站一区二区三区| 综合色中文字幕| 97超碰欧美中文字幕| 中文字幕国产精品一区二区| 国产福利一区二区| 久久久精品国产免大香伊| 精品一区二区三区免费毛片爱| 91精品国产综合久久久久久久| 亚洲h在线观看| 制服丝袜在线91| 青青草成人在线观看| 欧美一级日韩免费不卡| 美女诱惑一区二区| 久久久久久久精| 成人激情免费视频| 一区免费观看视频| 91福利在线播放| 丝袜亚洲另类丝袜在线| 在线综合亚洲欧美在线视频| 亚洲成人一区在线| 日韩一区二区在线观看视频| 精品一区二区影视| 中文一区二区在线观看| 91在线无精精品入口| 亚洲午夜在线视频| 日韩免费成人网| 成人精品亚洲人成在线| 一区二区视频在线| 日韩一区二区三区在线观看| 国产一区二区三区不卡在线观看| 国产视频一区在线观看| 91丨九色丨黑人外教| 日韩一区精品字幕| 久久人人爽人人爽| 色综合天天综合| 蜜臀久久久99精品久久久久久| 久久久激情视频| 欧美羞羞免费网站| 国产一区二区在线观看视频| 亚洲欧美另类小说视频| 日韩网站在线看片你懂的| 国产99久久久国产精品免费看| 中文字幕制服丝袜成人av| 制服丝袜在线91| www.性欧美| 蜜桃久久久久久久| 亚洲精品综合在线| 亚洲精品一区二区三区影院 | 国产精品亚洲а∨天堂免在线| 亚洲视频在线观看一区| 欧美一级夜夜爽| 色欧美乱欧美15图片| 国产乱人伦偷精品视频免下载| 一区二区三区四区在线免费观看 | 亚洲综合色成人| 2024国产精品| 欧美午夜电影网| 成人精品免费看| 毛片一区二区三区| 亚洲一区二区视频在线| 国产日产精品1区| 日韩午夜在线观看| 欧美日韩亚洲高清一区二区| 99久久99久久久精品齐齐| 国产米奇在线777精品观看| 亚洲国产日产av| 亚洲色图另类专区| 日本一区二区不卡视频| 日韩免费在线观看| 欧美日本在线看| 欧美性色黄大片| 色网综合在线观看| 成人黄色在线看| 成人黄色777网| www.一区二区| 成人精品鲁一区一区二区| 国产精品一级片在线观看| 精品在线播放午夜| 欧美a级理论片| 美日韩黄色大片| 国内精品久久久久影院薰衣草| 日韩1区2区日韩1区2区| 日本欧美一区二区| 美女在线观看视频一区二区| 日本女人一区二区三区| 手机精品视频在线观看| 五月激情综合网| 蜜桃久久av一区| 激情综合色综合久久| 国产精品一区专区| 成人精品视频.| 91麻豆.com| 欧美日韩日本视频| 欧美夫妻性生活| 欧美xxx久久| 国产人伦精品一区二区| 一区在线观看视频| 午夜婷婷国产麻豆精品| 日本欧美韩国一区三区| 国产资源在线一区| 不卡欧美aaaaa| 欧美日韩一级二级| 精品国产一区二区三区不卡| 国产亚洲精品7777| 亚洲三级电影网站| 亚洲成人777| 国产一区二区三区不卡在线观看 | 欧美理论片在线| 7878成人国产在线观看| 久久先锋影音av鲁色资源网| 国产精品视频免费| 亚洲一区二区精品久久av| 日本aⅴ精品一区二区三区| 国产精品亚洲人在线观看| 91国在线观看| 精品免费视频一区二区| 亚洲男女毛片无遮挡| 日本欧美一区二区三区乱码| 国产东北露脸精品视频| 欧美日韩一区高清| 国产日韩精品一区二区三区在线| 亚洲精品欧美专区| 韩国女主播成人在线观看| 色哟哟在线观看一区二区三区| 日韩午夜精品电影| 1区2区3区欧美| 紧缚奴在线一区二区三区| 一道本成人在线| 久久老女人爱爱| 视频一区视频二区中文| 成人性生交大合| 精品国产91久久久久久久妲己 |