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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? usbhidio.asm

?? USB通訊的電子能夠例程
?? ASM
?? 第 1 頁 / 共 4 頁
字號:
     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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91极品视觉盛宴| 毛片av一区二区| 99久久精品国产毛片| 欧美极品少妇xxxxⅹ高跟鞋| 国产一区二区三区四区在线观看| 精品毛片乱码1区2区3区| 麻豆91精品91久久久的内涵| 337p粉嫩大胆色噜噜噜噜亚洲| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩精品一区二区三区三区免费| 精品一区二区三区免费毛片爱| 久久婷婷久久一区二区三区| 国产老妇另类xxxxx| 国产精品久久毛片av大全日韩| 色综合天天综合在线视频| 午夜精品福利一区二区三区蜜桃| 欧美丰满少妇xxxxx高潮对白| 蜜乳av一区二区| 欧美国产日产图区| 94色蜜桃网一区二区三区| 色狠狠综合天天综合综合| 日韩美女在线视频| 国产成人精品免费网站| 亚洲综合男人的天堂| 91精品国产综合久久香蕉麻豆| 国产精品1区二区.| 自拍偷拍亚洲欧美日韩| 欧美三日本三级三级在线播放| 久久精品国内一区二区三区| 国产欧美日韩视频一区二区| 91久久精品一区二区三区| 日本欧美韩国一区三区| 亚洲国产高清在线| 欧美亚洲免费在线一区| 老司机午夜精品| 136国产福利精品导航| 欧美猛男gaygay网站| 成人午夜电影小说| 婷婷综合久久一区二区三区| 国产亚洲欧美色| 欧美日韩一卡二卡| 粉嫩一区二区三区性色av| 亚洲一区视频在线观看视频| 久久久久久久久久美女| 在线免费观看日本一区| 国产一区二区看久久| 亚洲国产你懂的| 国产精品网站在线观看| 日韩欧美一二区| 欧美性生活久久| 成人免费视频一区二区| 久久99国产精品久久99果冻传媒| 亚洲精品视频在线| 国产三级欧美三级日产三级99| 欧美精品丝袜中出| 99久久精品情趣| 韩国v欧美v日本v亚洲v| 肉色丝袜一区二区| 亚洲一区二区三区自拍| 国产精品视频看| 久久久久久亚洲综合影院红桃| 欧美一区二区三区在| 在线日韩一区二区| 一本到一区二区三区| 国产成人综合在线观看| 日韩av在线播放中文字幕| 亚洲国产视频在线| 亚洲人精品一区| 国产精品毛片高清在线完整版| 精品久久久久久无| 欧美电影免费观看高清完整版在线 | 99久久伊人精品| 国产一区二区免费视频| 麻豆精品国产91久久久久久| 男男视频亚洲欧美| 天天色天天操综合| 亚洲一区二区三区四区五区黄| ...中文天堂在线一区| 久久久精品欧美丰满| 日韩欧美在线网站| 欧美xingq一区二区| 精品毛片乱码1区2区3区| 精品国精品自拍自在线| 日韩欧美综合一区| 精品日韩一区二区三区| 精品日产卡一卡二卡麻豆| 日韩欧美中文一区二区| 2024国产精品| 国产亚洲成aⅴ人片在线观看 | 99久久综合99久久综合网站| 成人福利视频网站| 成人av在线电影| av在线不卡网| 日本韩国精品一区二区在线观看| 欧美日韩aaaaaa| 日韩欧美www| 欧美r级电影在线观看| 日韩限制级电影在线观看| 日韩欧美一区二区三区在线| 国产亚洲欧洲一区高清在线观看| 国产精品色婷婷久久58| 一区在线观看视频| 亚洲大型综合色站| 美国欧美日韩国产在线播放| 加勒比av一区二区| av电影在线观看一区| 欧美三级在线视频| 欧美一区二区大片| 国产精品午夜免费| 亚洲已满18点击进入久久| 青娱乐精品在线视频| 国产91高潮流白浆在线麻豆| 97成人超碰视| 日韩精品最新网址| 亚洲国产精品ⅴa在线观看| 夜夜爽夜夜爽精品视频| 色婷婷av一区二区| 2017欧美狠狠色| 自拍偷在线精品自拍偷无码专区| 亚洲国产日韩一级| 国内精品视频666| 亚洲黄色尤物视频| 韩国女主播一区二区三区| 91免费观看在线| 91精品国产综合久久精品麻豆| 国产精品欧美经典| 日本不卡一区二区三区| 成人毛片在线观看| 欧美一区二区三区白人| 国产精品国产三级国产aⅴ中文| 亚洲va欧美va人人爽| 成人app在线| 日韩精品中午字幕| 亚洲一区欧美一区| 福利91精品一区二区三区| 欧美色涩在线第一页| 中文字幕不卡一区| 九九视频精品免费| 在线日韩一区二区| 一区在线观看视频| 国产一区二区三区免费在线观看| 欧美探花视频资源| 国产精品污污网站在线观看| 美女尤物国产一区| 欧美色精品在线视频| 日韩国产精品久久| 在线区一区二视频| 亚洲丝袜精品丝袜在线| 国产在线视频一区二区| 777a∨成人精品桃花网| 日韩欧美一区在线观看| 亚洲午夜激情网站| 91免费看视频| 亚洲欧洲一区二区在线播放| 极品少妇一区二区| 337p亚洲精品色噜噜| 亚洲一区二区在线免费看| 91浏览器入口在线观看| 国产精品久久久久久久第一福利| 国产真实乱偷精品视频免| 日韩一区二区三区电影| 日韩精品欧美精品| 欧美欧美午夜aⅴ在线观看| 亚洲永久精品国产| 欧美在线看片a免费观看| 亚洲天堂免费在线观看视频| 成人av在线播放网址| 国产精品乱码人人做人人爱| 国产成人aaa| 国产欧美精品在线观看| 国产成人精品www牛牛影视| 国产亚洲欧美在线| 成人性生交大片免费看中文网站| 久久久国际精品| 国产99久久久国产精品潘金网站| www激情久久| 国产九色精品成人porny| 日韩精品一区二区三区四区| 狠狠色综合播放一区二区| 欧美精品一区二区三区高清aⅴ | 精品一区二区三区在线观看| 日韩精品一区二区三区在线观看 | 久久久久久久免费视频了| 麻豆视频观看网址久久| 精品国产乱码久久久久久图片| 黑人巨大精品欧美一区| 国产欧美日韩视频一区二区 | 亚洲日本va午夜在线影院| 99国产欧美另类久久久精品| 亚洲另类在线视频| 欧美亚洲综合一区| 日韩精品每日更新| 精品国产亚洲一区二区三区在线观看| 狠狠色综合色综合网络| 亚洲国产精品av| 在线观看免费一区| 日韩不卡一区二区三区| 亚洲精品在线三区| thepron国产精品| 亚洲综合免费观看高清完整版在线 |