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

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

?? ups17b.asm

?? USB大全電子版全部資料3~包含源碼、協議等
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
	mov	X, [txBufPtr]	; Set the index.

	mov	A, [X + txBuf]	; Load Command Byte Zero.

	mov	[txData], A		; Put it in the transmit register.

	inc	[txBufPtr]		; Point to the next byte.

	iowr	Watchdog		; Ping the watch dog timer.

	call	txRoutine		; Go transmit the byte.

	iowr	Watchdog		; Ping the watch dog timer.

	call	delay1		; Give the serial device some time.

;	iowr	Watchdog		; clear watchdog timer

	mov	X, [txBufPtr]	; Set the index.

	mov	A, [X + txBuf]	; Load Command Byte One

	mov	[txData], A		; Put it in the transmit register.

	inc	[txBufPtr]		; Point to the next byte.

	iowr	Watchdog		; clear watchdog timer

	call	txRoutine		; Go transmit the byte.

	iowr	Watchdog		; clear watchdog timer

	call	delay1		; Give the serial device some time.

;	iowr	Watchdog		; clear watchdog timer

	mov	X, [txBufPtr]	; Set the index.

	mov	A, [X + txBuf]	; Load Command Byte Two

	mov	[txData], A		; Put it in the transmit register.

	inc	[txBufPtr]		; Point to the next byte.

;	iowr	Watchdog		; clear watchdog timer

	call	txRoutine		; Go transmit the byte.

	iowr	Watchdog		; clear watchdog timer

;	call	delay1		; Give the serial device some time.

;	iowr	Watchdog		; clear watchdog timer

	mov	X, [txBufPtr]	; Set the index.

	mov	A, [X + txBuf]	; Load Command Byte Three

	mov	[txData], A		; Put it in the transmit register.

	inc	[txBufPtr]		; Point to the next byte.

;	iowr	Watchdog		; clear watchdog timer

	call	txRoutine		; Go transmit the byte.

	mov	A, 80h		; Enable the Port 0 Bit 7

	iowr	Port0_Interrupt	; GPIO interrupt.

	iowr	Watchdog		; clear watchdog timer

	ret				; Return to sender.

;

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

; This routine changes from ASCII to BCD

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

ASCII_to_BCD:

;

	push A	

	push X	

	mov A, 0h		

	mov [rxBufPtr], A

	mov A, 02h

	mov [temp2], A

next_char:

	mov X, [rxBufPtr]

	mov A, [X + rxBuf]

	cmp A, Car_Ret

	jz end_of_data

	and A, 0fh

	mov [X + rxBuf], A

	inc [rxBufPtr]

	jmp next_char

end_of_data:

	dec [rxBufPtr]

	jc end_conversion

	mov X, [rxBufPtr]

	mov A, [X + rxBuf]

	mov X, [temp2]

	mov [X + endpoint_1], A

	dec [rxBufPtr]

	jc end_conversion

	mov X, [rxBufPtr]

	mov A, [X + rxBuf]

	asl A

	asl A

	asl A

	asl A

	mov X, [temp2]	

	or A, [X + endpoint_1]

	mov [X + endpoint_1], A

	dec [temp2]

	jmp end_of_data

end_conversion:

	pop X

	pop A

	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



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

; 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 only one interface setting is being used,

; 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 in this UPS.

; 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:

      mov A, [bRequest] 	; load bRequest

; Set Report			bRequest = 9

	cmp A, set_report

	jz SetReport

; Set Idle				bRequest = 10

      cmp A, set_idle

      jz SetIdle

; Set Protocol			bRequest = 11

      cmp A, set_protocol

      jz SetProtocol

	jmp SendStall		; stall unsupported functions



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

; This one is not in the spec, but has been captured with CATC while

; Memphis beta testing. 

RequestType22:

      mov A, [bRequest] 	; load bRequest

; Set Report			bRequest = 9

	cmp A, set_report	

	jz SetReport

	jmp SendStall		; stall unsupported functions



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

; device to host with endpoint as recipient

RequestTypeA1:

        mov A, [bRequest] 	; load bRequest

; Get Report			bRequest = 1

        cmp A, get_report

        jz GetReport

; Get Idle				bRequest = 2

        cmp A, get_idle

        jz GetIdle

; Get Protocol			bRequest = 3

        cmp A, get_protocol

        jz GetProtocol

        jmp SendStall        	; stall unsupported functions



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

;       stage three ... process the request

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

; Remote wakeup is the ability to wakeup a system from power down mode.

; These routines allow the host to enable/disable the ability to request 

; remote wakeup.

;

; Disable the remote wakeup capability.

ClearRemoteWakeup:

        mov A, [wValue]                 ; load wValue

        cmp A, device_remote_wakeup     ; test for valid feature

        jnz SendStall                   ; stall unsupported features

        call no_data_control            ; handshake with host

        mov A, DISABLE_REMOTE_WAKEUP    ; disable remote wakeup

        mov [remote_wakeup_status], A

        ret                             ; return



; Enable the remote wakeup capability.

SetRemoteWakeup:

        mov A, [wValue]                 ; load wValue

        cmp A, device_remote_wakeup     ; test for valid feature

        jnz SendStall                   ; stall unsupported features

        call no_data_control            ; handshake with host

        mov A, ENABLE_REMOTE_WAKEUP     ; enable remote wakeup

        mov [remote_wakeup_status], A

        ret                             ; return



; Set the device address to the wValue in the SETUP packet at

; the completion of the current transaction.

SetAddress:

        call no_data_control            ; handshake with host

        mov A, [wValue]                 ; load wValue 

        iowr USB_Device_Address         ; write new USB device address

        ret                             ; return



; Set the configuration of the device to either unconfigured (0) or

; configured (1) based on wValue in the SETUP packet.  According to

; the USB spec (page 178), a Set Configuration also clears the endpoint

; stall condition and re-initializes endpoints using data 0/1 toggle to

; Data0.

SetConfiguration:

      call no_data_control

	mov A, [wValue]				; load wValue lsb

      mov [configuration_status], A   	; store configuration byte

      mov A, 0

      mov [endpoint_stall], A  		; not stalled

      iord USB_EP1_TX_Config          	; clear data 0/1 bit

      and A, ~DataToggle

	iowr USB_EP1_TX_Config	

      mov A, [configuration_status]

      cmp A, 0

	jnz device_configured



; device is unconfigured

	iord USB_EP1_TX_Config

	and A, EFh					; disable endpoint 1

	iowr USB_EP1_TX_Config			  

	mov A, [interrupt_mask]			; disable endpoint one interrupts

	and A, EFh

    	mov [interrupt_mask], A

	jmp done_configuration



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩美女久久久| 7777精品伊人久久久大香线蕉超级流畅| 日韩欧美一级二级三级久久久| 五月婷婷色综合| 3751色影院一区二区三区| 午夜精品久久久| 日韩免费在线观看| 国产一区二区三区精品欧美日韩一区二区三区 | 欧洲一区二区av| 亚洲午夜精品久久久久久久久| 欧美男女性生活在线直播观看| 午夜电影网亚洲视频| 欧美成人高清电影在线| 国产成人免费视频网站高清观看视频| 国产日韩欧美不卡| 一本色道久久加勒比精品| 午夜视频在线观看一区二区三区| 91精品国产色综合久久不卡蜜臀| 久久国产精品色| 中文字幕一区二区三区在线播放 | 久久99蜜桃精品| 国产女人18水真多18精品一级做| 色综合色狠狠天天综合色| 亚洲18色成人| 亚洲国产精品精华液2区45| 欧美性受xxxx| 国产精品91xxx| 亚洲午夜一区二区| 久久综合99re88久久爱| 日本久久一区二区| 国内精品视频一区二区三区八戒| 亚洲欧洲色图综合| 日韩免费福利电影在线观看| 北条麻妃一区二区三区| 日韩精品乱码免费| 国产精品高清亚洲| 亚洲精品一线二线三线| 欧美视频在线观看一区二区| 国产美女主播视频一区| 五月天一区二区三区| 国产精品美女久久久久高潮| 欧美一区2区视频在线观看| 99国产精品视频免费观看| 麻豆国产精品一区二区三区| 国产精品久久久久精k8| 欧美白人最猛性xxxxx69交| 91丨porny丨国产| 国产精品一二一区| 男男gaygay亚洲| 亚洲国产精品欧美一二99| 中文字幕乱码亚洲精品一区| 日韩区在线观看| 欧美日韩精品一区二区三区四区| 丁香啪啪综合成人亚洲小说 | 全国精品久久少妇| 亚洲美女视频在线| 中文在线免费一区三区高中清不卡| 日韩一区二区电影在线| 欧美色爱综合网| 色噜噜狠狠色综合中国| 成人国产在线观看| 国产a久久麻豆| 国产一区二区三区香蕉| 免费高清不卡av| 免费三级欧美电影| 午夜欧美视频在线观看| 亚洲裸体在线观看| 亚洲日本va午夜在线电影| 国产日韩欧美一区二区三区综合| 欧美成人官网二区| 精品国产一区二区三区久久影院| 91麻豆精品国产自产在线观看一区 | 日韩免费看网站| 日韩午夜激情av| 日韩一二三区不卡| 日韩欧美在线综合网| 日韩一区二区麻豆国产| 欧美一级高清片在线观看| 在线不卡中文字幕播放| 欧美精品久久99久久在免费线 | 91精品国产美女浴室洗澡无遮挡| 91国内精品野花午夜精品| 色欧美日韩亚洲| 91久久香蕉国产日韩欧美9色| 97se亚洲国产综合自在线观| 99久久免费精品高清特色大片| 99天天综合性| 在线中文字幕一区| 欧美精品九九99久久| 日韩一区二区三区在线观看| 精品日韩一区二区三区免费视频| 精品国产免费人成电影在线观看四季| 精品sm在线观看| 国产三级欧美三级日产三级99 | 日韩区在线观看| 久久久不卡影院| 国产精品久久久久一区二区三区| 国产精品亲子乱子伦xxxx裸| 成人欧美一区二区三区1314| 一区二区三区四区在线| 五月天视频一区| 精品在线观看视频| 99久久婷婷国产精品综合| 在线免费观看日本一区| 日韩一级高清毛片| 中文av字幕一区| 亚洲电影一区二区三区| 九九久久精品视频| eeuss鲁片一区二区三区在线看| 在线一区二区三区四区| 日韩精品自拍偷拍| 日韩一区中文字幕| 蜜桃免费网站一区二区三区| 国产激情91久久精品导航 | 久久久91精品国产一区二区三区| 国产精品久久久久影院亚瑟| 久久99在线观看| 国产成人精品免费看| 欧美日韩中文一区| 国产欧美一区二区精品秋霞影院| 一区二区三区在线播| 麻豆精品视频在线观看免费| 97国产一区二区| 久久综合久色欧美综合狠狠| 一区二区视频免费在线观看| 精品无人码麻豆乱码1区2区| 日本精品视频一区二区| 欧美成人艳星乳罩| 一区二区成人在线视频| 国产一区二区三区在线观看免费| 在线观看国产一区二区| 国产调教视频一区| 美腿丝袜一区二区三区| 一本到三区不卡视频| 国产午夜精品福利| 久久精品免费看| 91国偷自产一区二区开放时间| 国产欧美日韩亚州综合| 视频精品一区二区| 91精品福利在线| 国产精品污污网站在线观看| 久久福利资源站| 欧美疯狂做受xxxx富婆| 亚洲精品va在线观看| 成人免费看视频| xfplay精品久久| 麻豆专区一区二区三区四区五区| 日本高清无吗v一区| 国产精品久久久久久久久久久免费看| 韩国午夜理伦三级不卡影院| 在线不卡免费欧美| 亚洲成人免费av| 91精品福利视频| 亚洲男帅同性gay1069| 成人97人人超碰人人99| 国产欧美久久久精品影院| 久久国产精品色| 欧美成人精品福利| 久久成人麻豆午夜电影| 777精品伊人久久久久大香线蕉| 亚洲一区二区三区中文字幕| 99国产精品久久久久久久久久久| 国产精品视频看| 成人国产精品免费网站| 国产精品色婷婷| 99久久国产综合精品麻豆| 欧美国产日韩亚洲一区| 国产成人久久精品77777最新版本| 精品久久五月天| 国产露脸91国语对白| 久久久久久久久免费| 国产99久久精品| 国产精品久久影院| 一本一道波多野结衣一区二区| 日韩理论片网站| 欧洲视频一区二区| 五月激情综合婷婷| 日韩一区二区三免费高清| 久久成人免费日本黄色| 久久久精品综合| 成人av网在线| 一级中文字幕一区二区| 欧美日韩激情一区| 理论电影国产精品| 国产日产欧美精品一区二区三区| 成人美女视频在线观看| 亚洲欧美日韩国产综合| 欧美日韩黄色一区二区| 精品一区二区免费在线观看| wwww国产精品欧美| yourporn久久国产精品| 亚洲成人在线网站| 精品久久人人做人人爽| 成人黄色一级视频| 亚洲成人动漫一区| 久久这里只有精品6| 91香蕉视频污在线| 奇米色777欧美一区二区| 亚洲国产精品精华液ab| 欧美日韩视频在线第一区 |