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

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

?? mouse45.asm

?? USB大全電子版全部資料3~包含源碼、協議等
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
                                        ; 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, (end_config_desc_table - 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 



   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)



   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



   end_config_desc_table:



   hid_report_desc_table:

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

	db	09h, 02h	; usage (mouse)

	db	A1h, 01h	; collection (application)

	db	09h, 01h	; usage (pointer)

	db	A1h, 00h	; collection (linked)

	db	05h, 09h	; usage page (buttons)

	db	19h, 01h	; usage minimum (1)

	db	29h, 03h	; usage maximum (3)

	db	15h, 00h	; logical minimum (0)

	db	25h, 01h	; logical maximum (1)

	db	95h, 03h	; report count (3 bytes)

	db	75h, 01h	; report size (1)

	db	81h, 02h	; input (3 button bits)

	db	95h, 01h	; report count (1)

	db	75h, 05h	; report size (5)

	db	81h, 01h	; input (constant 5 bit padding)

	db	05h,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大白屁股肥臀xxxxxx| 欧美一区二区三区思思人 | 国产91富婆露脸刺激对白| 日韩美一区二区三区| 日本不卡一区二区三区高清视频| 欧美日韩国产首页在线观看| 日韩精品久久久久久| 欧美一级欧美一级在线播放| 黑人巨大精品欧美一区| 国产亚洲欧美色| 99精品久久免费看蜜臀剧情介绍| 亚洲精品国产a| 欧美日韩亚洲丝袜制服| 麻豆精品一区二区综合av| 亚洲精品一区二区精华| 成人性生交大片免费看在线播放| 国产精品久久久久精k8| 欧美日韩中字一区| 久久电影国产免费久久电影| 国产精品视频一二三区| 在线观看欧美精品| 美国欧美日韩国产在线播放| 国产欧美中文在线| 91麻豆免费看片| 三级久久三级久久| 久久色中文字幕| 91官网在线观看| 韩国三级在线一区| 亚洲特级片在线| 日韩区在线观看| 91免费视频网| 久久精品免费观看| 亚洲人成小说网站色在线| 7777精品伊人久久久大香线蕉| 国产成人啪免费观看软件 | 亚洲永久精品大片| 日韩欧美成人一区二区| 成人av网站免费| 日韩电影免费在线看| 国产精品无人区| 8v天堂国产在线一区二区| 丰满亚洲少妇av| 日韩成人午夜精品| 亚洲色图在线视频| 欧美精品一区二区三区蜜桃 | 亚洲男同1069视频| 精品国产一区二区三区不卡 | 成人午夜碰碰视频| 欧美a一区二区| 亚洲自拍另类综合| 国产欧美一区二区精品性| 欧美精品在线观看播放| 成人性视频网站| 国产综合色精品一区二区三区| 亚洲自拍偷拍麻豆| 国产精品沙发午睡系列990531| 日韩一区国产二区欧美三区| 91蜜桃在线观看| 国产成人av一区二区| 毛片av一区二区三区| 亚洲成av人影院| 一区二区成人在线观看| 国产精品女人毛片| 久久久亚洲高清| 精品成人私密视频| 欧美一级精品大片| 91精品视频网| 欧美日韩精品综合在线| 在线观看视频一区| 日本道在线观看一区二区| www.综合网.com| 高清不卡在线观看| 国产一本一道久久香蕉| 久久99在线观看| 久久国产精品色婷婷| 美女视频黄免费的久久| 日韩在线播放一区二区| 天天影视涩香欲综合网| 亚洲aaa精品| 丝袜亚洲另类欧美| 日本强好片久久久久久aaa| 亚洲成av人在线观看| 午夜精品一区二区三区电影天堂 | 亚洲乱码精品一二三四区日韩在线| 国产人成一区二区三区影院| 久久蜜桃av一区精品变态类天堂 | 国产日产欧美精品一区二区三区| 久久午夜免费电影| 国产三级一区二区三区| 日本一区二区在线不卡| 国产精品成人一区二区三区夜夜夜| 国产精品青草综合久久久久99| 日韩vs国产vs欧美| 欧美aaaaa成人免费观看视频| 日本亚洲免费观看| 精品在线一区二区| 国产精品一区免费在线观看| 成人自拍视频在线观看| av男人天堂一区| 色婷婷激情一区二区三区| 欧美三级中文字| 日韩视频免费观看高清在线视频| 精品噜噜噜噜久久久久久久久试看 | 粉嫩久久99精品久久久久久夜| 风间由美一区二区av101| 97久久超碰国产精品| 欧美无乱码久久久免费午夜一区| 777午夜精品视频在线播放| 精品成人免费观看| 国产精品二三区| 首页亚洲欧美制服丝腿| 日本午夜精品一区二区三区电影| 欧美国产激情一区二区三区蜜月| 中文字幕亚洲欧美在线不卡| 亚洲成人先锋电影| 紧缚捆绑精品一区二区| 成人黄色av电影| 欧美精品一级二级三级| 久久久久久久久久电影| 最近日韩中文字幕| 蜜桃久久精品一区二区| 成人美女在线观看| 制服丝袜亚洲网站| 中文字幕在线一区二区三区| 日本不卡视频一二三区| 成人av网站大全| 欧美成人三级电影在线| 亚洲欧美日韩一区| 狠狠色综合日日| 欧美人妇做爰xxxⅹ性高电影 | 国产乱子伦一区二区三区国色天香| www.综合网.com| 欧美成人午夜电影| 亚洲在线观看免费| 成人精品视频.| 欧美一级欧美三级在线观看| 亚洲啪啪综合av一区二区三区| 久久国产精品第一页| 欧美日韩国产高清一区| 中文字幕亚洲在| 欧美性大战久久| 国产日本欧美一区二区| 美洲天堂一区二卡三卡四卡视频| 91在线观看视频| 国产三级欧美三级| 免费观看久久久4p| 欧美探花视频资源| ㊣最新国产の精品bt伙计久久| 九九久久精品视频| 欧美精品v国产精品v日韩精品 | 国产综合色产在线精品| 欧美美女视频在线观看| 亚洲视频免费观看| 成人黄色在线网站| 欧美国产综合色视频| 精品一区二区久久久| 欧美一级欧美三级在线观看| 性做久久久久久免费观看| 色网站国产精品| 亚洲色欲色欲www| av在线综合网| 国产精品每日更新在线播放网址| 国产一区二区主播在线| 日韩精品一区国产麻豆| 蜜桃视频一区二区三区| 制服丝袜中文字幕亚洲| 日韩中文欧美在线| 3d成人h动漫网站入口| 亚洲国产成人精品视频| 色视频成人在线观看免| 亚洲婷婷在线视频| 色综合咪咪久久| 亚洲免费色视频| 在线观看日韩av先锋影音电影院| 亚洲精品老司机| 欧美日韩中字一区| 天天综合日日夜夜精品| 欧美一区二区三区日韩视频| 老司机免费视频一区二区| 欧美成人午夜电影| 国产乱码字幕精品高清av | 日韩欧美国产一区在线观看| 男人的天堂久久精品| 精品国产制服丝袜高跟| 欧美日韩日本视频| 亚洲成人先锋电影| 日韩一级免费一区| 国产精品一二三四区| 国产精品理论片在线观看| 91精品福利在线| 日韩精品一二区| 久久综合视频网| 99精品欧美一区| 香蕉av福利精品导航| 欧美成人a∨高清免费观看| 国产成人自拍在线| 亚洲精品你懂的| 日韩欧美亚洲国产另类| 国产经典欧美精品| 洋洋av久久久久久久一区|