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

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

?? usb_int.a51

?? 演示了如何開發WINDOES下I/O口驅動
?? A51
字號:
; This module is common to all of the examples.
; It services USB Requests from the SIE.
; Interpretation of the Output Reports is handled by MAIN
;
 	CSEG
ServiceSetupPacket:
	MOV	DPTR, #SETUPDAT		; Point to Setup Packet data
	MOVX	A, @DPTR		; Get the RequestType
	MOV	C, ACC.7		; Bit 7 = 1 means IO device needs to send data to PC Host
	MOV	SendData, C
	ANL	A, #01011100b		; IF RequestType[6.4.3.2] = 1 THEN goto BadRequest
	JNZ	BadRequest
	MOVX	A, @DPTR		; IF RequestType[1&0] = 1 THEN goto BadRequest
	MOV	C, ACC.0
	ANL	C, ACC.1
	JC	BadRequest
	JNB	ACC.5, NotB5		; IF RequestType[5] = 1 THEN RequestType[1,0] = [1,1]
	MOV	A, #00000011b
NotB5:	ANL	A, #00000011b		; Set CommandIndex[5,4] = RequestType[1,0]
	SWAP	A
	MOV	Temp, A			; Save HI nibble of CommandIndex
					; Set CommandIndex[3,0] = Request[3,0]
	INC	DPTR			; Point to Request
	MOVX	A, @DPTR
	ANL	A, #00001111b		; Only 13 are defined today, handle in table
	ORL	A, Temp	
	CALL	CorrectSubroutine	; goto CommandTable(CommandIndex)
					; Returns STALL=1 if a stall is required
	JB	STALL, BadRequest
       	JNB	SendData, HandShake
	JB	IsDescriptor, LoadSUDPTR; EZ-USB has a short cut for descriptors
                                        ; Send data in ReplyBuffer
	MOV	DPTR, #EP0InBuffer+2
	MOV	R0, #ReplyBuffer+3
	MOV	Temp, #3		; Copy maximum byte count
CopyRB:	MOV	A, @R0
	MOVX	@DPTR, A
	DEC	DPL
	DEC	R0
	DJNZ	Temp, CopyRB
	MOV	A, @R0 			; Get real byte count
SendEP0InBuffer:
	MOV	DPTR, #In0ByteCount
StartXfer:
	MOVX	@DPTR, A		; This write initiates the transfer
HandShake:				; Handshake with host
	MOV	Temp, #00000010b 	; Set HSNAK to tell the SIE that we're done
SetEP0Control:
	MOV	DPTR, #EP0Control
	MOVX	A, @DPTR
	ORL	A, Temp
	MOVX	@DPTR, A
	RET
LoadSUDPTR:			      	; Send the data pointed to by DPTR
	MOV	Temp, DPL
	MOV	A, DPH
	MOV	DPTR, #SUDPTR
	MOVX	@DPTR, A
	MOV	A, Temp
	INC	DPTR
	JMP	StartXfer
BadRequest:				; Invalid Request was received
	MOV	Temp, #00000011b	; Set EP0STALL and HSNAK
	JMP	SetEP0Control

NextDPTR:				; Returns (DPTR + byte DPTR is pointing to)
	MOVX	A, @DPTR
BumpDPTR:				; Returns (DPTR + ACC)
	ADD	A, DPL
	MOV	DPL, A
	JNC	Skip
	INC	DPH			; Need 16 bit arithmetic here
Skip:	RET

CorrectSubroutine:			; Jump to the subroutine that DPTR is pointing to
	MOV	DPTR, #CommandTable
	CALL	BumpDPTR		; Point to entry
	MOVX	A, @DPTR		; Get the offset
	MOV	DPTR, #CommandTable
	CALL	BumpDPTR                ; Get the routine address
	PUSH	DPL			; Create a RETURN address on stack
	PUSH	DPH                     ; Note: JMP @A+DPTR not used since A, DPTR needed
	MOV	R0, #ReplyBuffer+2
	CLR	A
	MOV	@R0, A			; Clear ReplyBuffer
	DEC	R0
	MOV	@R0, A
	DEC	R0
	MOV	@R0, #1			; Default non-descriptor reply
	MOV	DPTR, #SETUPDAT+2	; Point to LOW(wValue)
	MOVX	A, @DPTR		; Many of the routines need these
	MOV	B, A                    ; LOW(wValue) in B
	INC	DPTR
	MOVX	A, @DPTR            	; HIGH(wValue) in A
	CLR	STALL
	CLR	IsDescriptor
	RET				; Go to service routine

; Since the table only contains byte offsets, it is important that all these routines are
; within one page (100H) of CommandTable
;
CommandTable:
; First 16 commands are for the Device
	DB Device_Get_Status - CommandTable
	DB Device_Clear_Feature - CommandTable
	DB Invalid - CommandTable
	DB Device_Set_Feature - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable		; SIE implements Device_Set_Address
	DB Get_Descriptor - CommandTable
	DB Set_Descriptor - CommandTable
	DB Get_Configuration - CommandTable
	DB Set_Configuration - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
; Next 16 commands are for the Interface
	DB Interface_Get_Status - CommandTable
	DB Interface_Clear_Feature - CommandTable
	DB Invalid - CommandTable
	DB Interface_Set_Feature - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Get_Class_Descriptor - CommandTable
	DB Set_Class_Descriptor - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Get_Interface - CommandTable
	DB Set_Interface - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
; Next 16 commands are for the Endpoint
	DB Endpoint_Get_Status - CommandTable
	DB Endpoint_Clear_Feature - CommandTable
	DB Invalid - CommandTable
	DB Endpoint_Set_Feature - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Endpoint_Sync_Frame - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
; Next 16 commands are Class Requests
	DB Invalid - CommandTable
	DB Get_Report - CommandTable
	DB Get_Idle - CommandTable
	DB Get_Protocol - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Set_Report - CommandTable
	DB Set_Idle - CommandTable
	DB Set_Protocol - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
	DB Invalid - CommandTable
;
; Many requests are INVALID for this example
Get_Protocol:			; We are not a Boot device
Set_Protocol: 			; We are not a Boot device
Set_Descriptor:			; Our Descriptors are static
Set_Class_Descriptor:          	; Our Descriptors are static
Set_Interface:			; We only have one Interface
Get_Interface:			; We do not have an Alternate setting
Device_Set_Feature: 		; We have no features that can be set or cleared
Interface_Set_Feature: 		; We have no features that can be set or cleared
Endpoint_Set_Feature: 		; We have no features that can be set or cleared
Device_Clear_Feature:		; We have no features that can be set or cleared 
Interface_Clear_Feature: 	; We have no features that can be set or cleared
Endpoint_Sync_Frame:		; We are not an Isonchronous device

Invalid:			; Invalid Request made, STALL the Endpoint
	SETB	STALL
;
Endpoint_Clear_Feature: 	; We have no features that can be set or cleared
;
Reply:	RET

Set_Report:				; Host wants to sent us a Report. 
; The ONLY case in this example where host sends data to us
	JNB	Configured, Invalid	; Need to be Configured to do this command
	MOV	DPTR, #Out0ByteCount	; Enable EP0OutBuffer to receive data
	MOVX	@DPTR, A 		; Any value will do
        MOV	DPTR, #OUT07IRQ		; Wait for valid data in EP0OutBuffer
Wait4D:	MOVX	A, @DPTR
	ANL	A, #00000001b
	JZ	Wait4D
	MOVX	@DPTR, A		; Clear the interrupt
	JMP	ProcessOutputReport	; RETurn via this subroutine
Get_Report:				; Host wants a Report
	JNB	Configured, Invalid	; Need to be Configured to do this command 
	INC	R0			; Point to ReplyBuffer(1)
	MOV	@R0, #18H               ; Reply with a recognizable (arbitary) value
	RET
Set_Idle:				; Host wants to tell us how often we should talk
	JNB	Configured, Invalid	; Need to be Configured to do this command 
	MOV	Idle_Time, A
	RET				; Handshake with host
Get_Idle:				; Host must have forgotten what he told us to do
	JNB	Configured, Invalid	; Need to be Configured to do this command 
        INC	R0			; Point to ReplyBuffer(1)
	MOV	@R0, Idle_Time
	RET
Get_Configuration:			; Need to return 0 or 1
	JNB	Configured, Configuration0
Configuration1:				; Same bit pattern as Device_Get_Status	
Device_Get_Status:			; Only two bits of Device Status are defined
	INC	R0			; Point to ReplyBuffer(1)
	MOV	@R0, #1			; Bit 1=Remote Wakeup(=0), Bit 0=Self Powered(=1)
	RET
Configuration0:				; Same bit pattern as Interface_Get_Status
Interface_Get_Status:			; Interface Status is currently defined as 0
Endpoint_Get_Status:
        MOV	@R0, #2
	RET
Set_Configuration:   			; Valid values are 0 and 1
	MOV	A, B			; Get LOW(wValue)
	JZ	Deconfigured
	DEC	A
	JNZ	Invalid
	SETB	Configured
	RET
Deconfigured:
	CLR	Configured
	RET
Get_Descriptor:		   		; Host wants to know who/what we are
	SETB	IsDescriptor
	DEC	A			; Valid Values are 1, 2 and 3
	MOV	DPTR, #DeviceDescriptor
	JZ	Reply
	DEC	A
	MOV	DPTR, #ConfigurationDescriptor
	JZ	Reply
	DEC	A
	JNZ	Invalid
; Request is for a String Descriptor
	MOV	DPTR, #String0		; Point to String 0
	MOV	A, B			; Get String Index
NextString:
	JZ	FixUpthenReply
	MOV	Temp, A			; Save String Index
	CALL	NextDPTR
	MOVX	A, @DPTR		; Get the String Length (= 0 means we're at Backstop)
	JZ	Invalid			; Asked for a string I don't have 
	MOV	A, Temp
	DEC	A
	JMP	NextString		; Check if we are there yet
Get_Class_Descriptor: 			; Valid values are 21H, 22H, 23H for Class Request
	SETB	IsDescriptor
	CLR	C
	SUBB	A, #21H
	MOV	DPTR, #HIDDescriptor
	JZ	Reply
	DEC	A
	MOV	DPTR, #ReportDescriptor
	JZ	Reply
;	DEC	A			; This example does not use Physical Descriptors
;	JZ	Send_Physical_Descriptor
	JMP	Invalid
;
; Error check: this MUST be on within a page of CommandTable
WithinSamePage EQU $ - CommandTable	
;
FixUpthenReply:				; EZ-USB Rev D has a String Descriptor bug
					; Need to fill the IN0BUF (@ 7F00H) myself
	MOVX	A, @DPTR		; Get the string length
	MOV	R7, A			; Save counter
	MOV	B, A
	MOV	R0, #LOW(EP0InBuffer)	; PageReg = 7FH = HIGH(EP0InBuffer)
CopySD:	MOVX	@R0, A
	INC	R0
	INC	DPTR
        MOVX	A, @DPTR
	DJNZ	R7, CopySD
; Fixup complete, get back to the program flow
	POP	ACC			; Get rid of the return address
	POP	ACC
	MOV	A, B			; Retrieve byte count
	JMP	SendEP0InBuffer

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
大白屁股一区二区视频| 极品美女销魂一区二区三区免费 | 国v精品久久久网| 精品亚洲成a人| 另类小说欧美激情| 捆绑紧缚一区二区三区视频| 日本中文字幕一区二区视频| 麻豆一区二区三区| 国产在线精品免费| 国产成人在线视频网站| 成人sese在线| 91国偷自产一区二区三区观看| 色丁香久综合在线久综合在线观看| 色综合网站在线| 欧美亚洲综合一区| 91精品国产91久久综合桃花| 精品捆绑美女sm三区| 国产三级精品视频| 亚洲婷婷综合色高清在线| 亚洲一区二区精品久久av| 天天操天天色综合| 国产一区二区三区视频在线播放| 丁香激情综合国产| 色哦色哦哦色天天综合| 日韩免费电影网站| 中文字幕亚洲不卡| 日韩精品欧美精品| 国产精品1区2区3区在线观看| 成人av网站在线观看免费| 欧洲av在线精品| 久久免费美女视频| 夜夜操天天操亚洲| 国产九九视频一区二区三区| 99热精品国产| 日韩免费高清视频| 亚洲乱码中文字幕| 国产一区二区免费视频| 在线观看日韩一区| 国产拍揄自揄精品视频麻豆| 亚洲妇女屁股眼交7| 国产成人在线视频网站| 欧美三级视频在线| 久久精品夜夜夜夜久久| 同产精品九九九| 成人蜜臀av电影| 精品久久五月天| 一区二区三区不卡在线观看| 国产很黄免费观看久久| 欧美精品aⅴ在线视频| 国产精品理论在线观看| 美国十次综合导航| 欧美亚男人的天堂| 亚洲色图在线看| 国产99久久久国产精品免费看| 欧美麻豆精品久久久久久| 亚洲美女视频在线| 成人免费三级在线| 久久久久久亚洲综合| 麻豆专区一区二区三区四区五区| 在线免费观看日本欧美| 国产精品久久精品日日| 国产成人亚洲精品狼色在线| 欧美mv日韩mv国产网站app| 亚洲一区二三区| 91久久精品一区二区三| 中文字幕一区二区三区四区| 高清不卡在线观看av| 国产亚洲成aⅴ人片在线观看| 久久精品国产99国产精品| 8v天堂国产在线一区二区| 亚洲福利视频一区| 欧美日韩国产色站一区二区三区| 亚洲狼人国产精品| 91热门视频在线观看| 亚洲四区在线观看| 97精品国产97久久久久久久久久久久| 久久久国产综合精品女国产盗摄| 欧美a级一区二区| 日韩一区二区三区免费看| 日韩精品视频网| 欧美一区二区成人6969| 黄色日韩三级电影| 久久婷婷久久一区二区三区| 国产精品自拍三区| 欧美激情中文字幕| 99久久精品免费精品国产| 亚洲精品福利视频网站| 在线观看精品一区| 日韩电影在线一区二区| 精品国产一二三| 成人永久aaa| 亚洲男帅同性gay1069| 欧洲亚洲国产日韩| 蜜臀av在线播放一区二区三区| 久久综合久久鬼色| 91在线精品一区二区三区| 亚洲综合免费观看高清在线观看| 欧美日韩精品二区第二页| 美脚の诱脚舐め脚责91| 国产精品理论片| 欧美日本乱大交xxxxx| 精品一区二区免费视频| 亚洲色图20p| 日韩一区二区三区三四区视频在线观看| 另类小说色综合网站| 中文字幕一区二区视频| 91精品国产一区二区三区| 韩国精品在线观看| 亚洲伊人伊色伊影伊综合网| 欧美一级艳片视频免费观看| 成人精品国产一区二区4080 | 欧美天堂亚洲电影院在线播放| 亚洲第一在线综合网站| 日本一区二区免费在线| 欧美日韩一卡二卡| 丁香六月久久综合狠狠色| 视频一区欧美日韩| 国产精品美女视频| 日韩久久久久久| 日本乱码高清不卡字幕| 粉嫩一区二区三区在线看| 日韩中文欧美在线| 亚洲色图.com| 91首页免费视频| 欧美性受xxxx黑人xyx| 678五月天丁香亚洲综合网| 亚洲主播在线播放| 婷婷六月综合亚洲| 成人开心网精品视频| 一区二区三区在线视频免费观看| 日韩精品一区二区三区视频在线观看| av亚洲精华国产精华精华| 成人av在线观| 最新欧美精品一区二区三区| 欧美一区二区国产| 欧美私模裸体表演在线观看| 国产成人免费视频精品含羞草妖精 | 99国产精品久久久久久久久久 | 99久免费精品视频在线观看| 精品无人码麻豆乱码1区2区 | 欧美性高清videossexo| 国产成人精品免费在线| 激情小说欧美图片| 一级精品视频在线观看宜春院| 中文字幕一区三区| 国产精品护士白丝一区av| 精品欧美一区二区在线观看| 色综合视频在线观看| 日韩精品一区二区三区视频| 欧美日韩激情一区二区三区| 色哟哟日韩精品| 91久久香蕉国产日韩欧美9色| 成人激情黄色小说| 国产成人精品网址| 不卡电影一区二区三区| 成人avav影音| 91视频精品在这里| 欧美少妇bbb| 欧美精品一二三四| 91精品国产91久久久久久一区二区 | 秋霞影院一区二区| 青草国产精品久久久久久| 青青草国产精品97视觉盛宴| 日本午夜一区二区| 国产乱淫av一区二区三区| 国产精品一区在线| aaa亚洲精品| 欧美日韩性生活| 日韩精品影音先锋| 国产午夜精品福利| 亚洲黄色性网站| 日精品一区二区| 国产乱人伦精品一区二区在线观看| 国产一区不卡在线| 色视频一区二区| 4438成人网| 久久精品亚洲精品国产欧美kt∨ | 久久国产精品一区二区| 国产成人av自拍| 欧美视频在线观看一区| 精品日韩欧美在线| 亚洲视频你懂的| 美女网站色91| 91视频观看视频| 日韩欧美的一区| 亚洲精品国产精华液| 久久精品国产99久久6| 一本久道中文字幕精品亚洲嫩| 7777精品伊人久久久大香线蕉超级流畅 | 色系网站成人免费| 欧美精品一区二区三区蜜桃 | 久久亚洲综合av| 一区二区三区四区视频精品免费 | 99久久免费精品| 日本精品一区二区三区高清| 日韩一本二本av| 日韩一区日韩二区| 麻豆精品视频在线| yourporn久久国产精品| 欧美久久一二区|