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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? usbhidio.asm

?? VB和USB通訊示例
?? ASM
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
     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

;Stall unsupported requests.
     jmp SendStall

;Device to host with interface as recipient
RequestType81:
     mov A, [bRequest]     ; load bRequest

; Get Status               bRequest = 0
      cmp A, get_status
      jz GetInterfaceStatus

; Get Interface returns the selected alternate setting.
;  This firmware supports no alternate settings.
; Get Interface                 bRequest = 10   *** not supported ***

;The HID class defines one more request for bmRequestType=10000001
; Get Descriptor                bRequest = 6
      cmp A, get_descriptor
      jz GetDescriptor

;Stall unsupported functions
      jmp SendStall

;Device to host with endpoint as recipient
RequestType82:
     mov A, [bRequest]          ; load bRequest
; Get Status               bRequest = 0
     cmp A, get_status
      jz GetEndpointStatus

; Get Descriptor               bRequest = 6
     cmp A, get_descriptor
     jz GetDescriptor
; Sync Frame                  bRequest = 12   *** not supported ***

;Stall unsupported functions.
     jmp SendStall


;Check for HID class requests

;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

;Stall unsupported requests
     jmp SendStall

RequestType22:
        mov A, [bRequest]      ; load bRequest

; Set Report               bRequest = 9
     cmp A, set_report     
     jz SetReport

;Stall unsupported requests
     jmp SendStall


;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

;Stall unsupported requests
        jmp SendStall

;----------------------------------------------------------------------
;Control transfer, stage three
;Process the request.
;----------------------------------------------------------------------

;The host controls whether or not a device can request a remote wakeup.

; Disable the remote wakeup capability.
ClearRemoteWakeup:
        mov A, [wValue]
        cmp A, device_remote_wakeup
        jnz SendStall
;Handshake by sending a data packet
        call Send0ByteDataPacket
        mov A, DISABLE_REMOTE_WAKEUP
        mov [remote_wakeup_status], A
        ret

; Enable the remote wakeup capability.
SetRemoteWakeup:
        mov A, [wValue]
        cmp A, device_remote_wakeup
;If not a match, stall.
        jnz SendStall
;Handshake by sending a 0-byte data packet
        call Send0ByteDataPacket
;Perform the request.
        mov A, ENABLE_REMOTE_WAKEUP
        mov [remote_wakeup_status], A
        ret

SetAddress:
; Set the device address to match wValue in the Setup packet.
;Complete the requested action after completing the transaction.
;Handshake by sending a 0-byte data packet.
        call Send0ByteDataPacket
;Perform the request
        mov A, [wValue]
        iowr USB_Device_Address
        ret

SetConfiguration:
;Unconfigured: wValue=0, configured: wValue=1.
;Also clear any stall condition and set Data 0/1 to Data0.
;Handshake by sending a 0-byte data packet.
      call Send0ByteDataPacket
;Save the configuration status.
      mov A, [wValue]
      mov [configuration_status], A
;Clear any stall condtion
      mov A, 0
      mov [endpoint_stall], A
;Set data 0/1 to Data0
      iord USB_EP1_TX_Config
      and A, ~DataToggle

;Set the configuration status.
     iowr USB_EP1_TX_Config     
     mov A, [configuration_status]
     cmp A, 0
;If configured, jump.
     jnz device_configured

;If unconfigured:
;Disable Endpoint 1
     iord USB_EP1_TX_Config
     and A, EFh
     iowr USB_EP1_TX_Config
;Disable Endpoint 1 interrupts.
     mov A, [interrupt_mask]
     and A, EFh
     mov [interrupt_mask], A
     jmp done_configuration

;If configured:
device_configured:
;Send NAK in response to IN packets
     iord USB_EP1_TX_Config
     and A,7Fh
;Enable Endpoint 1
     or A, 10h
     iowr USB_EP1_TX_Config
;Enable interrupts: Endpoint 1 and GPIO
     mov A, [interrupt_mask]
     or A, 50h
     mov [interrupt_mask], A
;Send NAK in response to Endpoint 0 OUT packets.
     iord USB_Status_Control
     and A,0EFh
     iowr USB_Status_Control
done_configuration:
        ret

ClearEndpointStall:
;Clear the stall (halt) condition for Endpoint 1.
;wValue = 0.
        mov A, [wValue]
        cmp A, endpoint_stalled
;If endpoint_stalled = 0, the endpoint isn't stalled
;and there's nothing to clear. Return a Stall for the request.
        jnz SendStall
;
;Clear Endpoint 1 stall
;Handshake by sending a 0-byte data packet
      call Send0ByteDataPacket
;Clear the stall condition
      mov A,0
      mov [endpoint_stall], A
;Set Data 0/1 to Data0
      iord USB_EP1_TX_Config
      and A, ~DataToggle
      iowr USB_EP1_TX_Config
;Send NAK in response to Endpoint 0 OUT packets.
      iord USB_Status_Control
      and A,0EFh
      iowr USB_Status_Control
      ret

;Stall Endpoint 1
SetEndpointStall:
;wValue = 0.
        mov A, [wValue]
        cmp A, endpoint_stalled
;If endpoint_stalled = 1, the endpoint is already stalled,
;so return a Stall for this request.
        jnz SendStall
;Handshake by sending a 0-byte data packet.
        call Send0ByteDataPacket
;Stall the endpoint.
        mov A,1         
        mov [endpoint_stall], A
        mov A, 30h
        iowr USB_EP1_TX_Config
        ret

GetDeviceStatus:
;Device Status is a 2-byte value.
;Bit 0 must be 0 (bus-powered).
;Bit 1 is remote wakeup: 0=disabled, 1=enabled.
;All other bits are unused.
;Return to status bytes to the host.
        mov A, 2
        mov [data_count], A
;control_read_table holds the two possible values for device status.
;Get the address of the first value.
        mov A, (get_dev_status_table - control_read_table)
;Add an index value to select the correct value.
        add A, [remote_wakeup_status]
;Send the value.
        jmp SendDescriptor

GetDescriptor:
;The high byte of wValue contains the descriptor type.
;The low byte of wValue contains the descriptor index.

        mov A, [wValueHi]               ; load descriptor type

;Test for standard descriptor types first.
;Supported descriptor types are device, configuration, string.
;Unsupported descriptor types are interface, endpoint.

; Get Descriptor (device)               wValueHi = 1
     cmp A, device
     jz GetDeviceDescriptor
; Get Descriptor (configuration)        wValueHi = 2
     cmp A, configuration
     jz GetConfigurationDescriptor
; Get Descriptor (string)               wValueHi = 3
     cmp A, string
     jz GetStringDescriptor

; Test for HID-class descriptor types.
; Get Descriptor (HID)                  wValueHi = 21h
        cmp A, HID
        jz GetHIDDescriptor
; Get Descriptor (report)               wValueHi = 22h  
     cmp A, report
     jz GetReportDescriptor
; Get Descriptor (physical)             wValueHi = 23h  *** not supported ***
;Stall unsupported requests.
     jmp SendStall

GetConfiguration:
;Send the current device configuration.
;0 = unconfigured, 1 = configured.

;Send 1 byte
        mov A, 1
        mov [data_count], A
;Get the address of the data to send.
        mov A, (get_configuration_status_table - control_read_table)
;Add an index to point to the correct configuration.
        add A, [configuration_status]
;Send the data.
        jmp SendDescriptor

GetInterfaceStatus:
;Interface status is 2 bytes, which are always 0.
;Send 2 bytes.
        mov A, 2
        mov [data_count], A
;Get the address of the data to send.
        mov A, (get_interface_status_table - control_read_table)
;Send the data.
        jmp SendDescriptor

GetEndpointStatus:
;Endpoint status is 2 bytes.
;Bit 0 = 0 when the endpoint is not stalled.
;Bit 0 = 1 when the endpoint is stalled.
;All other bits are unused.
;Send 2 bytes.
        mov A, 2
        mov [data_count], A
;Get the stall status.
        mov A, [endpoint_stall]
;Shift left to get an index (0 or 2) to point to data
;in the endpoint status table
        asl A
;Get the address of the data to send.
        add A, (get_endpoint_status_table - control_read_table)
;Send the data.
        jmp SendDescriptor

SetReport:
;The CY7C63000 doesn't support interrupt-mode OUT transfers.
;So the host uses Control transfers with Set_Report requests
;to get data from the device.

;Get the report data.

;For debugging: set Port 0, bit 0 =1 to show that we're here.
;      iord Port0_Data
;      or a, 1
;      iowr Port0_Data

;Find out how many bytes to read. This value is in WLength.
;Save the length in data_count.
     mov A, [wLength]
     mov [data_count], A

;Enable receiving data at Endpoint 0 by setting the EnableOuts bit
;The bit clears following any Setup or OUT transaction.
     iord USB_Status_Control
     or A, 10h
;Clear the StatusOuts bit to disable automatic sending of ACK after
;receiving a valid status packet in a Control read (IN) transfer.
;Otherwise, the USB engine will respond to a data OUT packet with a Stall.
     and A, F7h
     iowr USB_Status_Control
;Now we're ready to receive the report data.
;An Endpoint 0 OUT interrupt indicates the arrival of the report data.
ret

SetIdle:
        jmp SendStall   ; *** not supported ***

SetProtocol:
;Switches between a boot protocol (wValue=0) and report protocol (wValue=1).
;This firmware doesn't distinguish between protocols.
        mov A, [wValue]
        mov [protocol_status], A
        call Send0ByteDataPacket
        ret

GetReport:
;Sends a report to the host.
;The high byte of wValue contains the report type. 
;The low byte of wValue contains the report ID.
;Not supported (Use interrupt transfers to send data.)
     jmp SendStall

GetReportDescriptor:
;Save the descriptor length
     mov A, (end_hid_report_desc_table - hid_report_desc_table)
     mov [data_count], A
;Get the descriptor's starting address.
     mov A, (hid_report_desc_table - control_read_table)
     call SendDescriptor

      ret

GetIdle:
;Not supported
        jmp SendStall

GetProtocol:
;Send the current protocol status.
;Send 1 byte.
        mov A, 1
        mov [data_count], A
;Get the address of the data to send.
        mov A, (get_protocol_status_table - control_read_table)
;Add an index that points to the correct data.
        add A, [protocol_status]
;Send the data.
        jmp SendDescriptor
        
; Standard Get Descriptor routines
;
;Send the device descriptor.
GetDeviceDescriptor:
;Get the length of the descriptor
;(stored in the first byte in the device descriptor table).
        mov A, 0
       index device_desc_table
        mov [data_count], A
;Get the starting address of the descriptor.
        mov A, (device_desc_table - control_read_table)
;Send the descriptor.
        jmp SendDescriptor

GetConfigurationDescriptor:
;Send the configuration descriptor.
;Get the length of the descriptor.
     mov A, (end_config_desc_table - config_desc_table)
      mov [data_count], A

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情综合五月色丁香| 欧美精品第一页| 欧美成人r级一区二区三区| 亚洲视频狠狠干| 国产一区二区免费在线| 欧美日韩在线三级| 国产精品麻豆一区二区| 极品少妇一区二区| 69堂国产成人免费视频| 亚洲女人的天堂| 福利电影一区二区三区| 日韩女优av电影| 亚洲成a人在线观看| 91在线porny国产在线看| 久久亚洲一级片| 蜜桃视频在线一区| 在线不卡的av| 亚洲国产另类av| 色老综合老女人久久久| 亚洲欧洲av在线| 成人自拍视频在线观看| 国产校园另类小说区| 激情综合五月天| 6080国产精品一区二区| 亚洲一区二区三区国产| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品毛片大码女人| 成人综合在线网站| 中文字幕欧美国产| 成人亚洲一区二区一| 国产婷婷一区二区| 国产麻豆精品在线| 久久久久久久国产精品影院| 国产在线一区二区综合免费视频| 日韩精品一区二区三区四区视频 | 久久久久国产精品人| 久久精品二区亚洲w码| 日韩网站在线看片你懂的| 首页国产欧美日韩丝袜| 在线不卡一区二区| 热久久国产精品| 精品入口麻豆88视频| 精品无人区卡一卡二卡三乱码免费卡 | 午夜精品福利一区二区蜜股av| 色哟哟在线观看一区二区三区| 亚洲精品免费播放| 在线观看国产日韩| 三级欧美在线一区| 欧美伦理电影网| 琪琪一区二区三区| 精品免费日韩av| 国产高清亚洲一区| 国产精品丝袜一区| 日本道精品一区二区三区| 亚洲成人精品一区二区| 欧美巨大另类极品videosbest| 日韩在线一区二区| 精品国产麻豆免费人成网站| 久久99精品国产| 国产农村妇女毛片精品久久麻豆| 粉嫩av一区二区三区粉嫩| 国产精品超碰97尤物18| 在线亚洲一区二区| 青青草97国产精品免费观看无弹窗版| 日韩午夜在线观看视频| 国产精品一区一区三区| 中文字幕制服丝袜成人av| 欧美私人免费视频| 久久99精品一区二区三区三区| 国产亚洲va综合人人澡精品| 91免费在线播放| 天堂在线一区二区| 国产日产欧美一区二区三区| 97精品国产露脸对白| 天天综合色天天综合色h| 久久免费电影网| 色婷婷亚洲精品| 免费的成人av| 国产精品国产三级国产a| 欧美亚洲高清一区| 精品午夜久久福利影院| 亚洲少妇屁股交4| 日韩欧美国产午夜精品| 不卡的av电影| 日韩高清在线观看| 国产精品三级电影| 91.com视频| 成人av免费在线播放| 亚洲1区2区3区视频| 国产无人区一区二区三区| 欧美色偷偷大香| 国产精品99久久久久久宅男| 亚洲综合丁香婷婷六月香| 精品久久久久久久久久久久久久久久久 | 亚洲欧洲成人自拍| 成人精品gif动图一区| 日韩欧美一级在线播放| 国产欧美一区二区精品忘忧草| 国产美女一区二区三区| 亚洲乱码日产精品bd| 欧美成人综合网站| www.亚洲在线| 日本视频免费一区| 亚洲色图.com| 亚洲精品一区二区三区香蕉| 欧美亚洲国产一区二区三区| 丰满少妇久久久久久久| 日韩精品久久久久久| 国产精品福利一区二区三区| 欧美一区二区啪啪| 一本一道综合狠狠老| 国产成人精品网址| 蜜臀av一区二区在线观看 | 欧美日韩一区 二区 三区 久久精品| 国产成人欧美日韩在线电影| 强制捆绑调教一区二区| 一区二区三区国产精品| 中文字幕的久久| 久久综合久久综合久久综合| 欧美老肥妇做.爰bbww| 色一情一乱一乱一91av| 成人午夜av影视| 国产制服丝袜一区| 日本亚洲欧美天堂免费| 一区二区三区小说| 国产精品久久久久aaaa樱花| 欧美精品一区二区精品网| 欧美精选在线播放| 欧美色图一区二区三区| 91麻豆免费视频| 国产高清在线观看免费不卡| 久久99国产乱子伦精品免费| 午夜精品成人在线视频| 亚洲午夜视频在线| 亚洲靠逼com| 亚洲视频你懂的| 亚洲欧洲精品成人久久奇米网| 国产欧美中文在线| 久久久99久久| 久久久一区二区三区捆绑**| 欧美成人一区二区三区| 欧美裸体一区二区三区| 欧美日韩另类国产亚洲欧美一级| 色悠悠亚洲一区二区| 91女人视频在线观看| 91丝袜高跟美女视频| 99国产精品久久久久久久久久| 国产91丝袜在线18| 国产成人免费视| 高潮精品一区videoshd| 成人高清免费在线播放| 成人网页在线观看| 成人黄色在线视频| av在线播放不卡| 91色porny蝌蚪| 色哟哟亚洲精品| 欧美综合一区二区三区| 欧美日韩一区二区三区不卡| 欧美日韩精品欧美日韩精品一| 欧美精品在线观看一区二区| 欧美肥胖老妇做爰| 日韩欧美一区二区久久婷婷| 精品捆绑美女sm三区| 国产香蕉久久精品综合网| 国产精品丝袜久久久久久app| 中文幕一区二区三区久久蜜桃| 欧美经典一区二区| ...中文天堂在线一区| 亚洲免费av高清| 亚洲第一激情av| 奇米777欧美一区二区| 久久精品久久综合| 国产超碰在线一区| 99国产欧美久久久精品| 91成人在线免费观看| 欧美日韩一二三| 欧美大度的电影原声| 久久综合九色综合97_久久久| 国产精品免费视频一区| 亚洲一区二区三区视频在线播放| 水野朝阳av一区二区三区| 精彩视频一区二区| www.色精品| 欧美精品久久久久久久多人混战| 日韩亚洲欧美高清| 国产日韩欧美在线一区| 亚洲精品亚洲人成人网| 日韩1区2区3区| 国产99久久久国产精品| 一本到高清视频免费精品| 欧美群妇大交群的观看方式| 久久综合久久综合亚洲| 亚洲图片你懂的| 男女激情视频一区| 成人av在线网站| 欧美日韩成人在线| 国产午夜精品一区二区| 一区二区三区精品视频在线| 免费看日韩a级影片| 不卡一区二区在线|