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

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

?? usbhidio.asm

?? visual basic 開發的usb hid類應用程序
?? ASM
?? 第 1 頁 / 共 4 頁
字號:

;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

;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 condition for an endpoint.
;For endpoint 1, also set Data 0/1 to Data 0.
        mov A, [wValue]
        cmp A, endpoint_stalled
        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:
        mov A, [wValue]
        cmp A, endpoint_stalled
;Not a match, so stall
        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 two bytes.
;Bit 0 must be 0 (bus-powered).
;Bit 1 is remote wakeup: 0=disabled, 1=enabled.
;All other bits are unused.
;Send two bytes.
        mov A, 2
        mov [data_count], A
;The 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 bytes.
        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) for 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 is cleared following any Setup or OUT transaction.
     iord USB_Status_Control
     or A, 10h
;Clear the StatusOuts bit to disable auto-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 signals 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频一区在线观看| 欧美男女性生活在线直播观看| 91亚洲精品乱码久久久久久蜜桃| 欧美日韩高清在线播放| 中文字幕一区二区三区乱码在线 | 日韩av不卡一区二区| 国产91清纯白嫩初高中在线观看| 欧美精品一级二级| **网站欧美大片在线观看| 狠狠色丁香婷婷综合久久片| 欧美在线视频全部完| 国产精品久久久久一区二区三区共| 另类小说视频一区二区| 欧美天天综合网| 亚洲欧洲国产专区| 成人免费毛片aaaaa**| 26uuu国产在线精品一区二区| 亚洲mv在线观看| 在线观看亚洲专区| 一区二区三区免费观看| 色综合天天综合网天天狠天天| 欧美韩国一区二区| 成人伦理片在线| 国产精品久久久久婷婷二区次| 国精产品一区一区三区mba视频| 欧美一区二区视频在线观看2020| 一区二区三区免费在线观看| 一本久久综合亚洲鲁鲁五月天| 国产精品不卡一区二区三区| 成人在线视频一区| 中文字幕一区二区三区蜜月| 99麻豆久久久国产精品免费优播| 国产精品久线观看视频| av欧美精品.com| 亚洲精品亚洲人成人网在线播放| 色综合中文字幕| 亚洲成人一区在线| 日韩视频一区二区三区| 美女视频网站黄色亚洲| 久久伊人蜜桃av一区二区| 国产精品自拍av| 中文字幕在线观看不卡视频| 不卡一区二区中文字幕| 亚洲欧美日韩国产手机在线| 91久久精品国产91性色tv| 亚洲大型综合色站| 日韩限制级电影在线观看| 狠狠色丁香婷婷综合久久片| 久久久www成人免费无遮挡大片| 国产成人亚洲综合色影视| 亚洲欧洲国产日韩| 欧美视频在线观看一区| 六月丁香综合在线视频| 日本一区二区三级电影在线观看| 91丨porny丨在线| 午夜欧美电影在线观看| 26uuu另类欧美| 色综合久久综合网欧美综合网| 亚洲国产综合在线| 久久久影院官网| 日本韩国视频一区二区| 老司机精品视频在线| 中文字幕中文乱码欧美一区二区| 欧美亚洲丝袜传媒另类| 经典三级一区二区| 一区二区三区四区在线免费观看 | 亚洲成人精品一区| 久久综合给合久久狠狠狠97色69| 91亚洲国产成人精品一区二区三| 亚洲大片精品永久免费| 国产女人18毛片水真多成人如厕| 在线看国产一区| 国产精品一区二区久久不卡| 亚洲男人电影天堂| 欧美精品一区二区三区一线天视频| 成人国产精品免费| 久草精品在线观看| 亚洲高清不卡在线观看| 国产精品久久久久一区二区三区 | 亚洲欧洲国产专区| 日韩久久久久久| 在线观看国产精品网站| 丰满亚洲少妇av| 美女国产一区二区| 天堂在线亚洲视频| 亚洲男人的天堂av| 国产无遮挡一区二区三区毛片日本| 欧美亚洲综合久久| 91麻豆国产精品久久| 国产馆精品极品| 激情文学综合丁香| 日本va欧美va精品发布| 亚洲一二三四在线| 中文字幕中文在线不卡住| 国产色产综合色产在线视频 | 亚洲免费av观看| 亚洲国产高清aⅴ视频| 日韩三级视频中文字幕| 欧美在线不卡视频| 91视频xxxx| 成人精品电影在线观看| 粉嫩av一区二区三区粉嫩| 国产精品66部| 国产乱对白刺激视频不卡| 六月婷婷色综合| 九九国产精品视频| 国产真实乱对白精彩久久| 美女视频黄久久| 免费的成人av| 麻豆成人91精品二区三区| 五月婷婷综合网| 三级亚洲高清视频| 婷婷夜色潮精品综合在线| 亚洲v精品v日韩v欧美v专区| 丝袜美腿亚洲一区二区图片| 香蕉成人伊视频在线观看| 水野朝阳av一区二区三区| 丝袜国产日韩另类美女| 日本强好片久久久久久aaa| 日韩电影免费在线观看网站| 肉肉av福利一精品导航| 免费观看一级特黄欧美大片| 精品一区二区三区在线视频| 国产电影一区二区三区| www.在线成人| 欧美视频精品在线| 91精品午夜视频| 精品精品国产高清a毛片牛牛| 久久综合给合久久狠狠狠97色69| 国产亚洲人成网站| 亚洲精品菠萝久久久久久久| 亚洲综合色网站| 青青草国产成人av片免费| 国产一区二区三区av电影 | 欧美日韩电影一区| 欧美一二三四区在线| 久久综合久久综合九色| 日本一二三四高清不卡| 亚洲精品国产无天堂网2021| 喷白浆一区二区| 成人小视频在线观看| 欧美日韩在线综合| 久久综合色天天久久综合图片| 亚洲天天做日日做天天谢日日欢| 亚洲国产sm捆绑调教视频| 国模娜娜一区二区三区| 色妞www精品视频| 欧美不卡一区二区三区四区| 欧美国产禁国产网站cc| 亚洲成av人片一区二区梦乃 | 日韩国产一区二| 丁香六月综合激情| 欧美高清精品3d| 亚洲视频中文字幕| 免费观看成人av| 在线免费不卡电影| 欧美—级在线免费片| 日韩精品欧美精品| 91在线porny国产在线看| 91精品欧美福利在线观看| 国产精品免费网站在线观看| 视频在线观看91| 色综合久久综合网欧美综合网| 欧美成人video| 午夜久久久久久电影| 成人精品视频.| 精品盗摄一区二区三区| 一个色在线综合| 成人av在线网站| 精品久久国产老人久久综合| 亚洲一二三四区| 色综合天天天天做夜夜夜夜做| 精品1区2区在线观看| 午夜精品视频在线观看| 一本色道亚洲精品aⅴ| 国产欧美日韩精品a在线观看| 日产精品久久久久久久性色| 欧美丝袜丝交足nylons图片| 亚洲三级电影网站| 风间由美中文字幕在线看视频国产欧美 | 久久国产人妖系列| 久久精品免费在线观看| 欧美aa在线视频| 欧美日韩精品是欧美日韩精品| 国产精品久久777777| 国产 欧美在线| 国产无遮挡一区二区三区毛片日本| 久久疯狂做爰流白浆xx| 欧美肥胖老妇做爰| 日韩福利电影在线观看| 欧美群妇大交群中文字幕| 亚洲自拍都市欧美小说| 91丨九色丨尤物| 依依成人综合视频| 91久久精品一区二区二区| 亚洲免费视频中文字幕| 色综合天天性综合| 亚洲综合在线视频| 欧美日韩和欧美的一区二区| 午夜视频在线观看一区二区|