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

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

?? mouse45b.asm

?? USB大全電子版全部資料3~包含源碼、協議等
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
GetConfigurationDescriptor:

	mov A, (end_config_desc_table - config_desc_table)

      mov [data_count], A               ; save the descriptor length

	mov A, (config_desc_table - control_read_table)

execute:                                ; send the descriptors

        mov [data_start], A             ; save start index

        call get_descriptor_length      ; correct the descriptor length

        call control_read               ; perform control read function

        ret                             ; return

execute2:                               ; send the descriptors

        mov [data_start], A             ; save start index

        call get_descriptor_length      ; correct the descriptor length

        call control_read2              ; perform control read function from 

                                        ; the RAM

        ret                             ; return





GetStringDescriptor:

	mov A, [wValue]

	cmp A, 0h

	jz LanguageString

	cmp A, 01h

	jz ManufacturerString

	cmp A, 02h

	jz ProductString

	cmp A, 03h

	jz SerialNumString

      cmp A, 04h

	jz ConfigurationString

      cmp A, 05h

	jz InterfaceString



; No other strings supported

      jmp SendStall   		; *** not supported ***

LanguageString:

	mov A, (USBStringDescription1 - USBStringLanguageDescription)

      mov [data_count], A               ; save the descriptor length

	mov A, (USBStringLanguageDescription - control_read_table)

      jmp execute                     ; send the string descriptor

ManufacturerString:	

	mov A, ( USBStringDescription2 - USBStringDescription1)

      mov [data_count], A               ; save the descriptor length

	mov A, (USBStringDescription1 - control_read_table)

      jmp execute                     ; send the string descriptor

ProductString:

	mov A, ( USBStringDescription3 - USBStringDescription2)

      mov [data_count], A               ; save the descriptor length

	mov A, (USBStringDescription2 - control_read_table)

      jmp execute                     ; send the string descriptor

SerialNumString:

	mov A, ( USBStringDescription4 - USBStringDescription3)

      mov [data_count], A               ; save the descriptor length

	mov A, (USBStringDescription3 - control_read_table)

      jmp execute                     ; send the string descriptor

ConfigurationString:

	mov A, ( USBStringDescription5 - USBStringDescription4)

      mov [data_count], A               ; save the descriptor length

	mov A, (USBStringDescription4 - control_read_table)

      jmp execute

InterfaceString:

	mov A, ( USBStringEnd - USBStringDescription5)

      mov [data_count], A               ; save the descriptor length

	mov A, (USBStringDescription5 - control_read_table)

      jmp execute

	



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

; HID class Get Descriptor routines

;

; Return the HID descriptor and enable endpoint one.

GetHIDDescriptor:

	mov A, (Endpoint_Descriptor - Class_Descriptor)

      mov [data_count], A             ; save descriptor length            



	mov A, ( Class_Descriptor - control_read_table)

      call execute                    ; send descriptor to host

      ret                             ; return



;**********USB library main routines*******************



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

; The host sometimes lies about the number of bytes it

; wants from a descriptor.  Any request to get descriptor

; should return the lesser of the number of bytes requested

; or the actual length of the descriptor.

 

get_descriptor_length:

	mov A, [wLengthHi] 	; load requested transfer length

	cmp A, 0			; confirm high byte is zero

	jnz use_actual_length	; no requests should be longer than 256b

	mov A, [wLength]		; test low byte against zero

	cmp A, 0

	jz use_actual_length	; must request some data

	cmp A, [data_count]     ; compare to the amount of data

	jnc use_actual_length

	mov [data_count], A     ; use requested length

use_actual_length:

        ret                   ; return



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

;	function: no_data_control

;	purpose: performs the no-data control operation

;		as defined by the USB specifications

no_data_control:

	mov A, C0h			; set up the transfer

	iowr USB_EP0_TX_Config	; register for data1

					; and 0 byte transfer



	mov A, [interrupt_mask]	; enable interrupts

	iowr Global_Interrupt



wait_nodata_sent:

	iord USB_EP0_TX_Config	; wait for the data to be

	and A, 80h			; transferred

	jnz wait_nodata_sent

	ret				; return to caller



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



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

;

;	function:  Control_read

;	Purpose:   Performs the control read operation

;		   as defined by the USB specification

;	SETUP-IN-IN-IN...OUT

;

;	data_start: must be set to the descriptors info

;		    as an offset from the beginning of the

;		    control read table

;		    data count holds the 

;	data_count: must be set to the size of the 

;		    descriptor 

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



control_read: 

	push X				; save X on stack

	mov A, 00h				; clear data 0/1 bit

	mov [endp0_data_toggle], A



control_read_data_stage:

	mov X, 00h

	mov A, 00h

	mov [loop_counter], A

	iowr USB_EP0_RX_Status		; clear setup bit



; Fixing a bug seen by NEC hosts	

	iord USB_EP0_RX_Status		; check setup bit

	and A, 01h				; if not cleared, another setup

	jnz control_read_status_stage	; has arrived. Exit ISR

	mov A, 08h				; set BADOUTS BIT

	iowr USB_Status_Control

	mov A, [data_count]

	cmp A, 00h				; if the number of byte to transmit

	jz dma_load_done			; is a multiple of 8 we have to transmit 

						; a zero-byte data packet



dma_load_loop:				; loop to load data into the data buffer

	mov A, [data_start]

	index control_read_table

	mov [X + endpoint_0], A		; load dma buffer

	inc [data_start]

	inc X

	inc [loop_counter]

	dec [data_count]			; exit if descriptor

	jz dma_load_done			; is done

	mov A, [loop_counter]		; or 8 bytes sent

	cmp A, 08h

	jnz dma_load_loop



dma_load_done:



	iord USB_EP0_RX_Status		; check setup bit

	and A, 01h				; if not cleared, another setup

	jnz control_read_status_stage	; has arrived. Exit ISR

	mov A, [endp0_data_toggle]

	xor A, 40h

	mov [endp0_data_toggle], A

	or A, 80h

	or A, [loop_counter]

	iowr USB_EP0_TX_Config

	mov A, [interrupt_mask]

	iowr Global_Interrupt



wait_control_read:

	iord USB_EP0_TX_Config		; wait for the data to be

	and A, 80h				; transfered

	jz control_read_data_stage

	iord USB_EP0_RX_Status

	and A, 02h				; check if out was sent by host

	jz wait_control_read



control_read_status_stage:		; OUT at end of data transfer

	pop X					; restore X from stack

	mov A, [interrupt_mask]

	iowr Global_Interrupt

	ret



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



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

;

;	function:  Control_read2

;	Purpose:   Performs the control read operation. 

;		     Sends data from RAM

;	SETUP-IN-IN-IN...OUT

;

;	data_start: must be set to the beginning of the

;		    RAM buffer

;		    

;	data_count: must be set to the size of the 

;		      buffer 

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



control_read2: 

	push X				; save X on stack

	mov A, 00h				; clear data 0/1 bit

	mov [endp0_data_toggle], A



control_read_data_stage2:

	mov X, 00h

	mov A, 00h

	mov [loop_counter], A

	iowr USB_EP0_RX_Status		; clear setup bit



; Fixing a bug seen by NEC hosts	

	iord USB_EP0_RX_Status		; check setup bit

	and A, 01h				; if not cleared, another setup

	jnz control_read_status_stage2	; has arrived. Exit ISR

	mov A, 08h				; set BADOUTS BIT

	iowr USB_Status_Control

      mov A, [data_count]

	cmp A, 00h				; if the number of byte to transmit

	jz dma_load_done2			; is a multiple of 8 we have to transmit 

						; a zero-byte data packet



dma_load_loop2:				; loop to load data into the data buffer

	push X

	mov X, [data_start]

	mov A,[X+0]

      pop X

	mov [X + endpoint_0], A		; load dma buffer

	inc [data_start]

	inc X

	inc [loop_counter]

	dec [data_count]			; exit if descriptor

	jz dma_load_done2			; is done

	mov A, [loop_counter]		; or 8 bytes sent

	cmp A, 08h

	jnz dma_load_loop2



dma_load_done2:



	iord USB_EP0_RX_Status		; check setup bit

	and A, 01h				; if not cleared, another setup

	jnz control_read_status_stage2	; has arrived. Exit ISR

	mov A, [endp0_data_toggle]

	xor A, 40h

	mov [endp0_data_toggle], A

	or A, 80h

	or A, [loop_counter]

	iowr USB_EP0_TX_Config

	mov A, [interrupt_mask]

	iowr Global_Interrupt



wait_control_read2:

	iord USB_EP0_TX_Config		; wait for the data to be

	and A, 80h				; transfered

	jz control_read_data_stage2

	iord USB_EP0_RX_Status

	and A, 02h				; check if out was sent by host

	jz wait_control_read2

control_read_status_stage2:		; OUT at end of data transfer

	pop X					; restore X from stack

	mov A, [interrupt_mask]

	iowr Global_Interrupt

	ret







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

;                   rom lookup tables

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



	XPAGEOFF

		

control_read_table:

   device_desc_table:

	db	12h		; size of descriptor (18 bytes)

	db	01h		; descriptor type (device descriptor)

	db	00h, 01h	; USB spec release (ver 1.0)

	db	00h		; class code (each interface specifies class information)

	db	00h		; device sub-class (must be set to 0 because class code is 0)

	db	00h		; device protocol (no class specific protocol)

	db	08h		; maximum packet size (8 bytes)

	db	B4h, 04h	; vendor ID (note Cypress vendor ID)

	db	01h, 00h	; product ID (Cypress USB mouse product ID)

	db	00h, 00h	; device release number

	db	01h		; index of manufacturer string 

	db	02h		; index of product string 

	db	00h		; index of serial number (0=none)

	db	01h		; number of configurations (1)



   config_desc_table:

	db	09h		; length of descriptor (9 bytes)

	db	02h		; descriptor type (CONFIGURATION)

	db	22h, 00h	; total length of descriptor (34 bytes)

	db	01h		; number of interfaces to configure (1)

	db	01h		; configuration value (1)

	db	04h		; configuration string index 

	db	A0h		; configuration attributes (bus powered)

	db	32h		; maximum power (100mA)



   Interface_Descriptor:

	db	09h		; length of descriptor (9 bytes)

	db	04h		; descriptor type (INTERFACE)

	db	00h		; interface number (0)

	db	00h		; alternate setting (0)

	db	01h		; number of endpoints (1)

	db	03h		; interface class (3..defined by USB spec)

	db	01h		; interface sub-class (1..defined by USB spec)

	db	02h		; interface protocol (2..defined by USB spec)

	db	05h		; interface string index 



   Class_Descriptor:

	db	09h		; descriptor size (9 bytes)

	db	21h		; descriptor type (HID)

	db	00h,01h		; HID class release number (1.00)

	db	00h		; Localized country code (none)

	db	01h		; # of HID class descriptor to follow (1)

	db	22h		; Report descriptor type (HID)

	db	(end_hid_report_desc_table - hid_report_desc_table)

	db	00h



   Endpoint_Descriptor:

	db	07h		; descriptor length (7 bytes)

	db	05h		; descriptor type (ENDPOINT)

	db	81h		; endpoint address (IN endpoint, endpoint 1)

	db	03h		; endpoint attributes (interrupt)

	db	03h, 00h	; maximum packet size (3 bytes)

	db	0Ah		; polling interval (10ms)





   end_config_desc_table:



   hid_report_desc_table:

	db	05h, 01h	; usage page (generic desktop)

	db	09h, 02h

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99久久久久久久久久久| 国产视频不卡一区| 久久久久久久免费视频了| 亚洲成av人片一区二区梦乃| 色呦呦一区二区三区| 国产精品美女久久久久久久久| 九九九久久久精品| 91精品国产综合久久精品| 亚洲成人动漫在线观看| 欧美体内she精高潮| 亚洲精品免费看| 欧美色老头old∨ideo| 亚洲狼人国产精品| 色94色欧美sute亚洲线路二| 亚洲欧美日韩成人高清在线一区| 成人福利电影精品一区二区在线观看| 国产婷婷色一区二区三区在线| 国产一级精品在线| 国产精品素人视频| 99久久99久久精品免费观看| 亚洲人吸女人奶水| 欧美亚洲尤物久久| 日韩激情在线观看| www久久精品| av色综合久久天堂av综合| 亚洲精品亚洲人成人网| 欧美日韩国产一区二区三区地区| 丝袜美腿亚洲一区二区图片| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲福利电影网| 精品欧美一区二区三区精品久久| 经典三级视频一区| 国产精品久久久久久亚洲毛片| 91丝袜美腿高跟国产极品老师 | 国产一区二区三区免费播放| 国产欧美一区二区精品婷婷| www.色精品| 性感美女极品91精品| 精品国产一二三| 暴力调教一区二区三区| 亚洲a一区二区| 久久精品无码一区二区三区| 91丨porny丨国产| 免费在线看成人av| 久久精品无码一区二区三区 | 国产成人午夜精品影院观看视频| 亚洲黄色av一区| 国产欧美日韩另类视频免费观看| 欧美日韩国产综合一区二区| 91在线免费视频观看| 国产美女精品人人做人人爽| 香蕉成人啪国产精品视频综合网| 国产精品美女久久久久aⅴ| 欧美一级高清大全免费观看| 91视频你懂的| 不卡视频在线观看| 国产v综合v亚洲欧| 狠狠色综合播放一区二区| 婷婷开心激情综合| 亚洲综合在线观看视频| 亚洲欧洲三级电影| 日本一区二区三区国色天香| 2017欧美狠狠色| 日韩视频在线一区二区| 欧美人与禽zozo性伦| 欧美熟乱第一页| 色天天综合久久久久综合片| 成人av网站大全| av网站一区二区三区| 成人性生交大片| 国产精品性做久久久久久| 久久精品国产精品亚洲精品| 毛片一区二区三区| 美腿丝袜亚洲一区| 久久精品国产精品青草| 久久成人久久鬼色| 国内国产精品久久| 国模一区二区三区白浆| 国产一区二区精品在线观看| 国产美女精品在线| 国产成人免费9x9x人网站视频| 国产一区二区三区| 成人性视频免费网站| 成人a区在线观看| 99精品久久只有精品| 91麻豆高清视频| 欧美中文字幕亚洲一区二区va在线 | 奇米777欧美一区二区| 免费高清在线视频一区·| 日韩经典中文字幕一区| 免费精品99久久国产综合精品| 免费在线成人网| 国产在线精品不卡| 99久久久精品免费观看国产蜜| 91亚洲精品乱码久久久久久蜜桃| 91国偷自产一区二区三区成为亚洲经典 | 亚洲va欧美va天堂v国产综合| 亚洲国产美国国产综合一区二区 | 免费成人美女在线观看| 久久成人18免费观看| 国产99一区视频免费| 色综合久久六月婷婷中文字幕| 欧美三级日韩在线| 精品少妇一区二区三区在线播放 | 欧美美女喷水视频| 欧美本精品男人aⅴ天堂| 国产夜色精品一区二区av| 1区2区3区国产精品| 天堂影院一区二区| 成人在线视频一区| 欧美性欧美巨大黑白大战| 日韩免费高清av| 国产精品久久久久国产精品日日| 亚洲午夜影视影院在线观看| 老司机精品视频导航| 99久久国产综合精品女不卡 | 日韩精品综合一本久道在线视频| 欧美国产综合色视频| 午夜精品久久久久久久久久久| 久久机这里只有精品| 9人人澡人人爽人人精品| 4hu四虎永久在线影院成人| 国产亚洲视频系列| 舔着乳尖日韩一区| 成人深夜福利app| 91精品免费在线| 日韩理论片中文av| 久久99蜜桃精品| 色哟哟欧美精品| 精品国产一区二区三区忘忧草| 亚洲欧美日韩国产综合在线| 精品一区二区在线看| 91久久人澡人人添人人爽欧美 | 国产午夜亚洲精品羞羞网站| 亚洲综合成人网| 国产69精品一区二区亚洲孕妇 | 综合av第一页| 国产一区欧美二区| 欧美日韩成人在线一区| 国产精品不卡在线| 韩国一区二区视频| 欧美丰满一区二区免费视频| 亚洲精品第一国产综合野| 国产成人aaaa| 欧美mv和日韩mv的网站| 舔着乳尖日韩一区| 91黄色免费观看| 亚洲欧洲av一区二区三区久久| 国产一区在线视频| 日韩三级伦理片妻子的秘密按摩| 亚洲电影一级片| 欧美在线小视频| 亚洲狠狠丁香婷婷综合久久久| 国产91在线观看丝袜| 久久色视频免费观看| 美女一区二区视频| 91麻豆精品国产91久久久久| 一级中文字幕一区二区| 99久久精品国产毛片| 国产精品福利在线播放| 国产999精品久久久久久绿帽| 久久蜜桃香蕉精品一区二区三区| 秋霞电影网一区二区| 69久久99精品久久久久婷婷| 亚洲大片免费看| 欧美精品乱人伦久久久久久| 亚洲午夜免费视频| 欧美色倩网站大全免费| 亚洲国产日韩在线一区模特| 欧美影片第一页| 亚洲图片欧美色图| 欧美久久久影院| 日本不卡一区二区三区高清视频| 制服丝袜中文字幕一区| 奇米四色…亚洲| xf在线a精品一区二区视频网站| 国产一区二区三区av电影 | 中文在线资源观看网站视频免费不卡| 青青草成人在线观看| 精品国产免费视频| 国产精品亚洲а∨天堂免在线| 欧美韩国一区二区| 91网页版在线| 亚洲成av人片一区二区| 欧美一区二区黄色| 国产精品一区二区三区99| 欧美国产精品劲爆| 色琪琪一区二区三区亚洲区| 亚洲图片欧美一区| 欧美哺乳videos| 粉嫩av一区二区三区在线播放| 亚洲日本乱码在线观看| 欧美日精品一区视频| 久久国产尿小便嘘嘘| 国产女同性恋一区二区| 91麻豆国产在线观看| 日韩专区在线视频| 2021国产精品久久精品| 99久久综合狠狠综合久久| 夜夜亚洲天天久久|