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

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

?? hidclass.asm

?? pic16c745 的 firmware的一個usb樣例,供大家參考
?? ASM
字號:
;                            Software License Agreement
;
; The software supplied herewith by Microchip Technology Incorporated (the "Company")
; for its PICmicro(r) Microcontroller is intended and supplied to you, the Company's
; customer, for use solely and exclusively on Microchip PICmicro Microcontroller
; products.
;
; The software is owned by the Company and/or its supplier, and is protected under
; applicable copyright laws. All rights are reserved. Any use in violation of the
; foregoing restrictions may subject the user to criminal sanctions under applicable
; laws, as well as to civil liability for the breach of the terms and conditions of
; this license.
;
; THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES, WHETHER EXPRESS,
; IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE
; COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
; CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
;
; ###############################################################################
;	filename:	HIDCLASS.ASM
;
;	Implements USB Human Interface Device (HID) class specific commands.
;
; ###############################################################################
;
;	Author(s):		Dan Butler and Reston Condit
;	Company:		Microchip Technology Inc
;
;	Revision:		2.00
;	Date:			06 November 2002
;	Assembled using:	MPASM 2.80
;################################################################################
;
;	include files:
;		P16C745.inc	Rev 1.00
;		usb_defs.inc	Rev 2.00
;
;################################################################################
#include <p16C745.inc>
#include "usb_defs.inc"

	errorlevel  -302              ; suppress message 302 from list file

	extern	ReportDescriptor
	extern	ReportDescriptorLen
	extern	HID_Descriptor
	extern	Descriptions
	extern	BufferData
	extern	BufferDescriptor
	extern	wrongstate
	extern	USB_dev_req
	extern	EP0_maxLength
	extern	EP0_start
	extern	EP0_end
	extern	copy_descriptor_to_EP0
	extern	Send_0Len_pkt
	extern	Report_desc_index
	extern	USB_Protocol

	global	ClassSpecificRequest
 
USBBANK	code
; ******************************************************************
; Get Class Specific Descriptor
; ******************************************************************

ClassSpecificRequest
	pagesel	Host2DevHIDRequest
	movf	BufferData+bmRequestType,w
	xorlw	0x21
	btfsc	STATUS,Z
	goto	Host2DevHIDRequest

;	pagesel	Host2DevReportRequest
;	movf	BufferData+bmRequestType,w
;	xorlw	0x22
;	btfsc	STATUS,Z
;	goto	Host2DevReportRequest
	
;	pagesel	Host2DevPhysicalRequest
;	movf	BufferData+bmRequestType,w
;	xorlw	0x23
;	btfsc	STATUS,Z
;	goto	Host2DevPhysicalRequest

	pagesel	Dev2HostHIDRequest
	movf	BufferData+bmRequestType,w
	xorlw	0xA1
	btfsc	STATUS,Z
	goto	Dev2HostHIDRequest

;	pagesel	Dev2HostReportRequest
;	movf	BufferData+bmRequestType,w
;	xorlw	0xA2
;	btfsc	STATUS,Z
;	goto	Dev2HostReportRequest

;	pagesel	Dev2HostPhysicalRequest
;	movf	BufferData+bmRequestType,w
;	xorlw	0xA3
;	btfsc	STATUS,Z
;	goto	Dev2HostPhysicalRequest

	pagesel	wrongstate
	goto	wrongstate

; Need to add code if you need to handle optional functions
; such as get/set_idle. Otherwise, send STALL buy calling
; to signal the host that the feature is not implemented.

Host2DevHIDRequest
	movf	BufferData+bRequest,w
	xorlw	0x09
	pagesel SetHIDReport
	btfsc	STATUS,Z
	goto	SetHIDReport

	movf	BufferData+bRequest,w
	xorlw	0x0A
	pagesel	SetIdle
	btfsc	STATUS,Z
	goto	SetIdle

	movf	BufferData+bRequest,w
	xorlw	0x0B
	pagesel	SetProtocol
	btfsc	STATUS,Z
	goto	SetProtocol

	pagesel	wrongstate
	goto	wrongstate

Dev2HostHIDRequest
	movf	BufferData+bRequest,w
	xorlw	0x01
	pagesel	GetHIDReport
	btfsc	STATUS,Z
	goto	GetHIDReport

	movf	BufferData+bRequest,w
	xorlw	0x02
	pagesel GetIdle
	btfsc	STATUS,Z
	goto	GetIdle

	movf	BufferData+bRequest,w
	xorlw	0x03
	pagesel GetProtocol
	btfsc	STATUS,Z
	goto	GetProtocol

	pagesel	wrongstate
	goto	wrongstate
    
; ******************************************************************
; Get Report Descriptor
; Returns the Mouse Report descriptor
; Checks for the report type (input, output or Feature).
; ******************************************************************
Get_Report_Descriptor
	global	Get_Report_Descriptor
	banksel	EP0_start
	movlw	GET_DESCRIPTOR
	movwf	USB_dev_req		; currently processing a get descriptor request

	movlw	8
	movwf	EP0_maxLength

	movf	BufferData+(wValue+1),w	; check report ID
	xorlw	0x01			; was it an Input Report?
	pagesel	TryOutputReport
	btfsc	STATUS,Z
	goto	TryOutputReport

	bcf	STATUS,C
	rlf	BufferData+wIndex,w
	pagesel	Report_desc_index
	call	Report_desc_index	; translate index to offset into descriptor table
	movwf	EP0_start
	bcf 	STATUS,C
	rlf 	BufferData+wIndex,w
	addlw	1			; point to high order byte
	call	Report_desc_index	; translate index to offset into descriptor table
	movwf	EP0_start+1
	pagesel	Descriptions
	call	Descriptions
	movwf	EP0_end
	incf	EP0_start,f
	pagesel	CheckReportLength
	goto	CheckReportLength

TryOutputReport
	movf	BufferData+(wValue+1),w	; check report ID
	xorlw	0x02			; was it an Output Report?
	pagesel	TryFeatureReport
	btfsc	STATUS,Z
	goto	TryFeatureReport

	bcf 	STATUS,C
	rlf 	BufferData+wIndex,w
	pagesel	Report_desc_index
	call	Report_desc_index	; translate index to offset into descriptor table
	movwf	EP0_start
	bcf 	STATUS,C
	rlf 	BufferData+wIndex,w
	addlw	1			; point to high order byte
	call	Report_desc_index	; translate index to offset into descriptor table
	movwf	EP0_start+1
	pagesel	Descriptions
	call	Descriptions
	movwf	EP0_end
	incf	EP0_start,f
	pagesel	CheckReportLength
	goto	CheckReportLength

TryFeatureReport
	movf	BufferData+(wValue+1),w	; check report ID
	xorlw	0x03			; was it an Output Report?
	pagesel	wrongstate
	btfsc	STATUS,Z
	goto	wrongstate

; Fill EP0IN buffer here...
	return

CheckReportLength
	movf	BufferData+(wLength+1),w ; Is the host requesting more than 255 bytes?
	pagesel nolimit_rpt
	btfss	STATUS,Z		; If so, the host is requesting more than we have
	goto	nolimit_rpt

check_low_bytes
	movf	BufferData+wLength,w
	subwf	EP0_end,w		; if not, compare the amount the host is request
	movf	BufferData+wLength,w 	; with the length of the descriptor
	btfsc	STATUS,C		; if the host is request less than the descriptor
	movwf	EP0_end 		; length, send only as much as what the host wants

nolimit_rpt
	incf	EP0_end,f
	pagesel	copy_descriptor_to_EP0
	call	copy_descriptor_to_EP0
	return

Get_HID_Descriptor
	global	Get_HID_Descriptor
	movlw	GET_DESCRIPTOR
	movwf	USB_dev_req		; currently processing a get descriptor request

	movlw	8
	movwf	EP0_maxLength

	movlw	low HID_Descriptor
	movwf	EP0_start
	movlw	high HID_Descriptor
	movwf	EP0_start + 1
	pagesel	Descriptions
	call	Descriptions		; get the HID descriptor length
	movwf	EP0_end

	movf	BufferData+(wLength+1),f
	pagesel	nolimit_hid
	btfss	STATUS,Z
	goto	nolimit_hid

	subwf	BufferData+wLength,w
	movf	BufferData+wLength,w
	btfss	STATUS,C
	movwf	EP0_end

nolimit_hid
	incf	EP0_end,f
	pagesel	copy_descriptor_to_EP0
	call	copy_descriptor_to_EP0
	return

Get_Physical_Descriptor
	return

Check_Class_Specific_IN
	global	Check_Class_Specific_IN
	pagesel	copy_descriptor_to_EP0
	movf	USB_dev_req,w
	xorlw	GET_DESCRIPTOR
	btfsc	STATUS,Z
	call	copy_descriptor_to_EP0
	return

; ******************************************************************
; These requests are parsed out, but nothing is actually done with them
; currently they simply stall EP0 to show that the request is not
; supported.  If you need to support them, fill in the code.
; ******************************************************************
Host2DevReportRequest
Host2DevPhysicalRequest
Dev2HostReportRequest
Dev2HostPhysicalRequest
GetIdle
SetIdle
	pagesel wrongstate
	goto 	wrongstate

GetHIDReport
; Write functionality for Get_Report here and uncomment following lines
;	bsf	STATUS,RP1    ; bank3
;	movlw	0xC8
;	movwf	BD0IST
;	return

SetHIDReport
; Uncomment these lines if Set_Report support is desired
;	movlw	HID_SET_REPORT
;	movwf	USB_dev_req		; store status
;	return

	pagesel	wrongstate
	goto	wrongstate

SetProtocol
	movf	BufferData+wValue,w
	movwf	USB_Protocol
	call	Send_0Len_pkt
	return	

GetProtocol
	banksel	BD0IAL
	bankisel BD0IAL
	movf	BD0IAL,w	; get buffer address
	movwf	FSR
	bcf	STATUS,RP0	; bank 2
	movf	USB_Protocol,w
	bsf	STATUS,RP0	; bank 3
	movwf	INDF
	movlw	1
	movwf	BD0IBC
	movlw	0xC8
	movwf	BD0IST
	return

	end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
首页综合国产亚洲丝袜| 一区二区三区在线免费观看 | 7777精品伊人久久久大香线蕉的| 欧美日韩综合一区| 欧美草草影院在线视频| 日韩一区二区中文字幕| 日本一区免费视频| 五月天激情综合网| 国产麻豆91精品| 欧亚洲嫩模精品一区三区| 欧美艳星brazzers| 久久久久久久久97黄色工厂| 中文字幕亚洲一区二区va在线| 国产精品午夜春色av| 亚洲成人av一区| 激情久久五月天| 欧美日韩一二三区| 国产精品久久久久影院亚瑟| 日韩高清一区在线| 国产精品综合在线视频| 欧美日韩成人在线一区| 国产欧美日韩不卡免费| 亚洲欧美aⅴ...| 国产一本一道久久香蕉| 欧美久久一区二区| 中文字幕精品三区| 亚洲一区二区欧美日韩| 国产河南妇女毛片精品久久久| 欧美喷水一区二区| 亚洲精品国久久99热| 韩国午夜理伦三级不卡影院| 国产美女一区二区| 精品国产一区二区三区不卡| 亚洲国产精品嫩草影院| 91免费版pro下载短视频| 久久久久久久精| 玖玖九九国产精品| 日韩欧美国产午夜精品| 日韩高清电影一区| 欧美吻胸吃奶大尺度电影| 久久综合色综合88| 久久精品国产99国产精品| 8v天堂国产在线一区二区| 亚洲中国最大av网站| 国产大陆亚洲精品国产| 亚洲精品在线免费播放| 蜜臀a∨国产成人精品| 7777女厕盗摄久久久| 亚洲成av人片在线| 欧美精品aⅴ在线视频| 亚洲一二三四久久| 欧美做爰猛烈大尺度电影无法无天| 精品久久久网站| 精品一区二区免费在线观看| 欧美xxxxxxxxx| 日韩成人av影视| 欧美一级欧美三级在线观看| 美日韩黄色大片| 精品国产亚洲一区二区三区在线观看| 亚洲地区一二三色| 欧美一区二区三区日韩视频| 日本不卡高清视频| 欧美伊人精品成人久久综合97 | 国产成人av一区二区| 国产亚洲欧美色| 国产成人亚洲精品青草天美| 中日韩av电影| 91视频精品在这里| 一级女性全黄久久生活片免费| 欧美精品久久99久久在免费线| 国产一区二区三区久久悠悠色av | 欧美一区二区三区性视频| 国产一区欧美一区| 亚洲国产日韩a在线播放| 精品久久久久久久久久久久包黑料| 福利视频网站一区二区三区| 亚洲一区二区三区小说| 欧美mv和日韩mv国产网站| 色婷婷香蕉在线一区二区| 另类小说综合欧美亚洲| 夜夜亚洲天天久久| 国产午夜精品一区二区三区四区| 日本电影欧美片| 国产成人av影院| 全国精品久久少妇| 一区二区三区在线播放| 国产欧美精品一区aⅴ影院 | 成人av电影在线网| 美女视频黄频大全不卡视频在线播放| 国产精品灌醉下药二区| 亚洲精品一区二区三区香蕉| 欧美天天综合网| 97国产精品videossex| 国产麻豆成人精品| 另类的小说在线视频另类成人小视频在线| 亚洲精品国产精华液| 国产欧美日韩综合精品一区二区| 日韩一级高清毛片| 欧美日韩一级视频| 在线看日韩精品电影| 99国产精品久久久久久久久久| 久久精品99国产精品日本| 午夜精品在线看| 亚洲成人手机在线| 亚洲精品少妇30p| 成人欧美一区二区三区在线播放| 精品粉嫩aⅴ一区二区三区四区 | 91国模大尺度私拍在线视频| 国产suv精品一区二区6| 精品一区二区三区不卡| 久久超碰97中文字幕| 日韩高清一区二区| 午夜成人在线视频| 日韩精品乱码av一区二区| 三级久久三级久久| 免费在线看一区| 美洲天堂一区二卡三卡四卡视频| 日本 国产 欧美色综合| 日韩国产精品久久| 久久国产婷婷国产香蕉| 免播放器亚洲一区| 国产一区二区日韩精品| 国产精品一品二品| 国产成人一区二区精品非洲| 成人免费高清视频在线观看| 99久久99久久精品免费观看| 99久久er热在这里只有精品15| 91麻豆成人久久精品二区三区| 91丨国产丨九色丨pron| 在线观看免费亚洲| 4hu四虎永久在线影院成人| 日韩欧美中文字幕精品| 亚洲精品一区二区三区福利| 欧美国产激情二区三区| 最新成人av在线| 亚洲v日本v欧美v久久精品| 美女一区二区三区| 成人午夜激情视频| 欧美在线你懂得| 精品国产三级电影在线观看| 国产精品视频看| 亚洲图片自拍偷拍| 国产在线一区二区综合免费视频| 国产 日韩 欧美大片| 色婷婷香蕉在线一区二区| 制服丝袜中文字幕亚洲| 久久久久久久免费视频了| 中文字幕一区二区三区蜜月| 依依成人综合视频| 国产尤物一区二区| 色综合中文字幕国产 | 亚洲精品大片www| 日韩高清在线观看| 国产99久久久精品| 欧美这里有精品| 欧美刺激脚交jootjob| 国产日韩欧美激情| 亚洲一区二区三区四区五区黄 | 国产精品不卡视频| 天堂精品中文字幕在线| 国产91丝袜在线播放九色| 欧美中文字幕一二三区视频| 久久亚洲影视婷婷| 亚洲一区二区欧美激情| 国产宾馆实践打屁股91| 在线成人av网站| 综合激情成人伊人| 久草中文综合在线| 欧美色精品在线视频| 国产精品日产欧美久久久久| 捆绑调教一区二区三区| 一本大道av伊人久久综合| 久久九九久久九九| av午夜精品一区二区三区| 欧美色手机在线观看| 国产精品传媒在线| 国产精品自在在线| 日韩欧美亚洲一区二区| 亚洲与欧洲av电影| 99久久免费精品高清特色大片| 精品国精品自拍自在线| 婷婷一区二区三区| 欧美日韩专区在线| 亚洲精品日韩专区silk| 成人夜色视频网站在线观看| 欧美成人精品福利| 青娱乐精品在线视频| 欧美日韩国产不卡| 亚洲资源中文字幕| 91福利社在线观看| 亚洲精选视频免费看| proumb性欧美在线观看| 国产日韩成人精品| 国产精品羞羞答答xxdd| 久久亚洲精品国产精品紫薇| 理论片日本一区| 精品国产一区二区精华| 国产在线精品免费| 国产三级三级三级精品8ⅰ区| 激情av综合网|