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

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

?? usb_ch9.asm

?? USB HID mouse device firmware source code using PIC s MCU
?? ASM
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
    movwf   BufferData+5
    incf    FSR,f
    movf    INDF,w
    movwf   BufferData+6
    incf    FSR,f
    movf    INDF,w
    movwf   BufferData+7

    bsf     STATUS, RP0
    movlw   0x88            ; set UOWNs bit back to SIE
    movwf   BD0OST
    movlw   0x08
    movwf   BD0OBC          ; reset the byte count too.
    movwf   BD0IST          ; return the in buffer to us (dequeue any pending requests)

    bcf     UCTRL,PKT_DIS   ; Assuming there is nothing to dequeue, clear the packet disable bit

    bcf     STATUS,RP0      ; bank 2
    clrf    USB_dev_req     ; clear the device request..

    movf    BufferData+bmRequestType,w
    btfsc   STATUS,Z
    goto    HostToDevice

    movf    BufferData+bmRequestType,w
    xorlw   0x01            ; test for host to Interface tokens
    btfsc   STATUS,Z
    goto    HostToInterface

    movf    BufferData+bmRequestType,w
    xorlw   0x02            ; test for host to Endpoint tokens
    btfsc   STATUS,Z
    goto    HostToEndpoint

    movf    BufferData+bmRequestType,w
    xorlw   0x80            ; test for device to Host tokens
    btfsc   STATUS,Z
    goto    DeviceToHost
 
    movf    BufferData+bmRequestType,w
    xorlw   0x81            ; test for device to Interface tokens
    btfsc   STATUS,Z
    goto    InterfaceToHost

    movf    BufferData+bmRequestType,w
    xorlw   0x82            ; test for device to Endpoint tokens
    btfsc   STATUS,Z
    goto    EndpointToHost

    pagesel ClassSpecificRequest
    movf    BufferData+bmRequestType,w
    andlw   0x60            ; mask off type bits
    xorlw   0x20            ; test for class specific
    btfsc   STATUS,Z        ; was it a standard request?
    goto    ClassSpecificRequest    ; nope, see if it was a class specific request

CheckForVendorRequest
    movf    BufferData+bmRequestType,w
    andlw   0x60            ; mask off type bits
    xorlw   0x40            ; test for vendor specific
    btfss   STATUS,Z        ; was it a standard request?
    pagesel wrongstate
    goto    wrongstate
    pagesel CheckVendor
    goto    CheckVendor     ; nope, see if it was a vendor specific
    return
                
; now test bRequest to see what the request was.

CheckForStandardRequest
; bmRequestType told us it was a Host to Device transfer.  Now look at
; the specifics to see what's up
HostToDevice    ; starts in bank 2
    movf    BufferData+bRequest,w   ; what was our request
    xorlw   CLEAR_FEATURE
    btfsc   STATUS,Z
    goto    Clear_Device_Feature

    movf    BufferData+bRequest,w   ; was our request Set Address
    xorlw   SET_ADDRESS
    btfsc   STATUS,Z
    goto    Set_Address

    movf    BufferData+bRequest,w   ; was our request Set Configuration
    xorlw   SET_CONFIGURATION
    btfsc   STATUS,Z
    goto    Set_Configuration

    movf    BufferData+bRequest,w   ; was our request Set Feature
    xorlw   SET_FEATURE
    btfsc   STATUS,Z
    goto    Set_Device_Feature
    goto    wrongstate

HostToInterface ; starts in bank 2
    movf    BufferData+bRequest,w   ; what was our request
    xorlw   CLEAR_FEATURE
    btfsc   STATUS,Z
    goto    Clear_Interface_Feature

    movf    BufferData+bRequest,w   ; was our request Set Interface
    xorlw   SET_INTERFACE
    btfsc   STATUS,Z
    goto    Set_Interface

    movf    BufferData+bRequest,w   ; was our request Set Feature
    xorlw   SET_FEATURE
    btfsc   STATUS,Z
    goto    Set_Interface_Feature

HostToEndpoint  ; starts in bank2
    movf    BufferData+bRequest,w   ; what was our request
    xorlw   CLEAR_FEATURE
    btfsc   STATUS,Z
    goto    Clear_Endpoint_Feature

    movf    BufferData+bRequest,w   ; was our request Set Feature
    xorlw   SET_FEATURE
    btfsc   STATUS,Z
    goto    Set_Endpoint_Feature

DeviceToHost    ; starts in bank2
    movf    BufferData+bRequest,w   ; what was our request
    xorlw   GET_CONFIGURATION
    btfsc   STATUS,Z
    goto    Get_Configuration

    movf    BufferData+bRequest,w   ; was our request Get Decriptor?
    xorlw   GET_DESCRIPTOR
    btfsc   STATUS,Z
    goto    Get_Descriptor

    movf    BufferData+bRequest,w   ; was our request Get Status?
    xorlw   GET_STATUS
    btfsc   STATUS,Z
    goto    Get_Device_Status

InterfaceToHost ; starts in bank2
    movf    BufferData+bRequest,w   ; was our request Get Interface?
    xorlw   GET_INTERFACE
    btfsc   STATUS,Z
    goto    Get_Interface

    movf    BufferData+bRequest,w   ; was our request Get Status?
    xorlw   GET_STATUS
    btfsc   STATUS,Z
    goto    Get_Interface_Status

    movf    BufferData+bRequest,w   ; was our request Get Decriptor?
    xorlw   GET_DESCRIPTOR
    btfsc   STATUS,Z
    goto    Get_Descriptor

EndpointToHost  ; starts in bank2
    movf    BufferData+bRequest,w   ; was our request Get Status?
    xorlw   GET_STATUS
    btfsc   STATUS,Z
    goto    Get_Endpoint_Status

    pagesel wrongstate              ; unrecognised token, stall EP0
    goto    wrongstate

    return

; ******************************************************************
; Get Descriptor
; Handles the three different Get Descriptor commands
; ******************************************************************
Get_Descriptor  ; starts in bank2
    pagesel Get_Report_Descriptor
    movf    BufferData+(wValue+1),w ; request, which seems to be undefined,
    xorlw   0x22                    ; but it won't enumerate without it
    btfsc   STATUS,Z
    goto    Get_Report_Descriptor

    movf    BufferData+(wValue+1),w
    xorlw   0x21
    btfsc   STATUS,Z
    goto    Get_HID_Descriptor
    pagesel GetCh9Descriptor

GetCh9Descriptor
    movlw   high StartGDIndex       ; set up PCLATH with the current address
    movwf   PCLATH                  ; set up pclath for the computed goto
    movf    BufferData+(wValue+1),w ; get descriptor type
    andlw   0x03                    ; keep things under control
    addlw   low  StartGDIndex
    btfsc   STATUS,C                ; was there an overflow?
    incf    PCLATH,f                ; yes, bump PCLATH
    movwf   PCL                     ; adjust PC
StartGDIndex
    goto    wrongstate               ; 0
    goto    Get_Device_Descriptor    ; 1
    goto    Get_Config_Descriptor    ; 2
    goto    Get_String_Descriptor    ; 3
;    goto    Get_Interface_Descriptor ; 4 - not used
;    goto    Get_EndPoint_Descriptor  ; 5 - not used
;    goto    wrongstate               ; 6
;    goto    wrongstate               ; 7


; *********************************************************************
; Looks up the offset of the device descriptor via the low order byte
; of wValue.  The pointers are set up and the data is copied to the 
; buffer, then the flags are set.
;
; EP0_start points to the first word to transfer
; EP0_end points to the last, limited to the least of the message length
;         or the number of bytes requested in the message (wLength).
; EP0_maxLength is the number of bytes to transfer at a time, 8 bytes
; ******************************************************************
Get_Device_Descriptor           ; starts in bank 2
    pagesel Descriptions        ; set up PCLATH for call below
    movlw   GET_DESCRIPTOR
    movwf   USB_dev_req         ; currently processing a get descriptor request

    movlw   8
    movwf   EP0_maxLength

    movlw   low DeviceDescriptor
    movwf   EP0_start
    movlw   high DeviceDescriptor
    movwf   EP0_start+1
    call    Descriptions        ; get length of device descriptor
    movwf   EP0_end             ; save length
    pagesel DeviceEndPtr

    movf    BufferData+(wLength+1),f ; move it to itself, check for non zero.
    btfss   STATUS,Z            ; if zero, we need to compare EP0_end to requested length.
    goto    DeviceEndPtr        ; if not, no need to compare.  EP0_end is shorter than request length

    subwf   BufferData+wLength,w    ; compare against requested length
    movf    BufferData+wLength,w
    btfss   STATUS,C
    movwf   EP0_end

DeviceEndPtr
    incf    EP0_end,f
    pagesel copy_descriptor_to_EP0
    call    copy_descriptor_to_EP0

    return
        

; *********************************************************************
; Looks up the offset of the config descriptor via the low order byte
; of wValue.  The pointers are set up and the data is copied to the 
; buffer, then the flags are set.
;
; EP0_start points to the first word to transfer
; EP0_end points to the last, limited to the least of the message length
;         or the number of bytes requested in the message (wLength).
; EP0_maxLength is the number of bytes to transfer at a time, 8 bytes
; ******************************************************************
Get_Config_Descriptor   ; starts in bank2
    pagesel Descriptions        ; set up PCLATH for call below
    movlw   GET_DESCRIPTOR
    movwf   USB_dev_req         ; currently processing a get descriptor request

    bcf     STATUS,C
    rlf     BufferData+wValue,w
    call    Config_desc_index   ; translate index to offset into descriptor table
    movwf   EP0_start
    bcf     STATUS,C
    rlf     BufferData+wValue,w
    addlw   1                   ; point to high order byte
    call    Config_desc_index   ; translate index to offset into descriptor table
    movwf   EP0_start+1

    movlw   2                   ; bump pointer by 2 to get the complete descriptor 
    addwf   EP0_start,f         ; length, not just config descriptor
    btfsc   STATUS,C
    incf    EP0_start+1,f
    call    Descriptions        ; get length of the config descriptor
    movwf   EP0_end             ; Get message length

    movlw   2                   ; move EP0_start pointer back to beginning
    subwf   EP0_start,f
    btfss   STATUS,C
    decf    EP0_start+1,f

    movf    BufferData+(wLength+1),f ; test for 0
    btfsc   STATUS,Z
    pagesel CmpLowerByte
    goto    CmpLowerByte
    goto    ConfigEndPtr        ; if not, no need to compare.  EP0_end is shorter than request length

CmpLowerByte
    movf    EP0_end,w
    subwf   BufferData+wLength,w    ; compare against requested length
    btfsc   STATUS,C
    goto    ConfigEndPtr
LimitSize
    movf    BufferData+wLength,w    ; if requested length is shorter..
    movwf   EP0_end                 ; save it.
ConfigEndPtr

    movlw   8
    movwf   EP0_maxLength
    incf    EP0_end,f

    pagesel copy_descriptor_to_EP0
    call    copy_descriptor_to_EP0
    return

; ******************************************************************
; Set up to return String descriptors
; Looks up the offset of the string descriptor via the low order byte
; of wValue.  The pointers are set up and the data is copied to the 
; buffer, then the flags are set.
; ******************************************************************
Get_String_Descriptor    ; starts in bank2
    movlw   GET_STRING_DESCRIPTOR
    movwf   USB_dev_req         ; currently processing a get descriptor request

    movf    BufferData+wIndex,w
    btfss   STATUS,Z
    goto    not_string0
    movf    BufferData+(wIndex+1),w
    btfss   STATUS,Z
    goto    not_string0
    movlw   low String0
    movwf   EP0_start
    movlw   high String0
    movwf   EP0_start+1
    goto    found_string

not_string0
    movlw   high (String0+2)
    movwf   EP0_start+1
    movlw   low (String0+2)
    movwf   EP0_start
    clrf    inner

check_langid
    pagesel StringDescriptions
    call    StringDescriptions
    pagesel wrong_langid 
    incf    EP0_start,f
    subwf   BufferData+wIndex, w
    btfss   STATUS, Z
    goto    wrong_langid
    pagesel StringDescriptions
    call    StringDescriptions
    pagesel right_langid 
    subwf   BufferData+(wIndex+1), w
    btfsc   STATUS, Z
    goto    right_langid
    
wrong_langid
    incf    EP0_start,f
    incf    inner,f
    movlw   low String0_end     ; compare EP0_start to the addr of
    subwf   EP0_start,w         ; the last langid
    btfss   STATUS,C            ; if EP0_start is equal or lager,
    goto    check_langid        ; we've checked all langid and didn't find it
    clrf    USB_dev_req         ; clear USB_dev_req, since GET_descriptor is over
    pagesel wrongstate
    goto    wrongstate

right_langid
    movlw   6                   ; number of strings we have per language + 1
    subwf   BufferData+wValue,w
    btfss   STATUS,C
    goto    right_string
    clrf    USB_dev_req
    pagesel   wrongstate
    goto    wrongstate

right_string
    rlf     BufferData+wValue,w
    movwf   EP0_start+1
    movf    inner,w
    pagesel string_index
    call    string_index
    movwf   EP0_start
    incf    EP0_start+1,f
    movf    inner,w
    call    string_index
    movwf   EP0_start+1

found_string
    pagesel StringDescriptions
    call    StringDescriptions  ; get length of the string descriptor
    movwf   EP0_end             ; save length

    subwf   BufferData+wLength,w    ; compare against requested length
    movf    BufferData+wLength,w    ; if requested length is shorter..
    btfss   STATUS,C
    movwf   EP0_end             ; save it.

    movlw   8                   ; each transfer may be 8 bytes long
    movwf   EP0_maxLength

    incf    EP0_end,f
    pagesel copy_descriptor_to_EP0
    call    copy_descriptor_to_EP0
    return

; ******************************************************************
; Stalls the EP0 endpoint to signal that the command was not recognised.
; This gets reset as the result of a Setup Transaction.
; ******************************************************************
wrongstate
    global  wrongstate

    banksel UEP0
    bsf     UEP0,EP_STALL
    bcf     STATUS,RP0      ; back to page 2

    return

; ******************************************************************
; Loads the device status byte into the EP0 In Buffer.
; ******************************************************************
Get_Device_Status           ; starts in bank2
    bsf     STATUS,RP0
    movf    BD0IAL,w        ; get buffer pointer
    movwf   FSR
    bcf     STATUS,RP0      ; bank 2
    bsf     STATUS,IRP      ; select indirectly banks 2-3
    movf    USB_status_device,w ; get device status byte
    movwf   INDF
    incf    FSR,f
    clrf    INDF

    bsf     STATUS,RP0      ; bank 3
    movlw   0x02
    movwf   BD0IBC          ; set byte count to 2
    movlw   0xC8
    movwf   BD0IST          ; Data 1 packet, set owns bit
    return

; ******************************************************************
; A do nothing response.  Always returns a two byte record, with all
; bits zero.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人一区二区| 99久久国产综合精品色伊| 亚洲国产一区二区在线播放| 亚洲欧美日韩电影| 综合欧美一区二区三区| 国产精品免费久久久久| 国产精品无人区| 国产精品动漫网站| 日韩理论片一区二区| 一区二区三区四区乱视频| 亚洲免费高清视频在线| 亚洲国产日产av| 日韩成人av影视| 精品一区二区免费视频| 国模少妇一区二区三区| 国产 日韩 欧美大片| 99久久精品国产导航| 在线观看欧美日本| 在线电影欧美成精品| 日韩小视频在线观看专区| 久久久久久久久久久久久夜| 中文字幕av一区二区三区免费看| 国产精品久久久久久久久免费丝袜 | 91女神在线视频| 在线影视一区二区三区| 制服.丝袜.亚洲.中文.综合| 欧美一区二区女人| 久久蜜桃av一区精品变态类天堂 | 欧美电影在线免费观看| 精品国产乱码久久久久久浪潮 | 午夜婷婷国产麻豆精品| 日本不卡一区二区三区| 国产精品一区二区三区四区| 91小宝寻花一区二区三区| 欧美丰满一区二区免费视频| 亚洲精品一区二区在线观看| 中文一区在线播放| 亚洲宅男天堂在线观看无病毒| 视频在线观看一区| 国产成人一区二区精品非洲| 色综合久久中文字幕综合网| 欧美日韩国产一二三| 国产清纯白嫩初高生在线观看91 | 丁香天五香天堂综合| 一本色道a无线码一区v| 欧美一卡2卡3卡4卡| 国产精品视频一二三| 亚洲一区二区精品久久av| 久久99精品久久久久婷婷| av电影天堂一区二区在线| 91精品国产综合久久精品性色| 国产欧美日韩另类视频免费观看| 亚洲午夜国产一区99re久久| 国产麻豆视频精品| 欧美剧在线免费观看网站| 亚洲国产岛国毛片在线| 天堂成人免费av电影一区| 成人午夜短视频| 欧美一区二区三区四区久久| 中文字幕一区二区三区不卡 | 日本高清不卡在线观看| 精品1区2区在线观看| 亚洲自拍偷拍av| 粉嫩13p一区二区三区| 欧美蜜桃一区二区三区| 中文字幕在线观看不卡视频| 久久超碰97人人做人人爱| 国产婷婷精品av在线| 日韩影院精彩在线| 色先锋aa成人| 亚洲国产精品成人综合色在线婷婷| 日本成人超碰在线观看| 欧洲av一区二区嗯嗯嗯啊| 国产欧美一区二区在线观看| 日本视频一区二区| 欧美日韩一区精品| 亚洲男人电影天堂| 床上的激情91.| 精品少妇一区二区三区视频免付费 | 国产精品丝袜91| 激情综合网最新| 日韩视频123| 亚洲动漫第一页| 一本到高清视频免费精品| 一色屋精品亚洲香蕉网站| 国产精选一区二区三区| 欧美刺激脚交jootjob| 三级久久三级久久| 欧美性大战久久久久久久| 亚洲欧美偷拍卡通变态| 99久久久无码国产精品| 国产精品久久三| 成人精品视频网站| 欧美国产视频在线| 国产福利一区二区三区视频在线 | 久久亚洲一级片| 久久国产视频网| 精品日韩一区二区三区| 麻豆精品视频在线| 日韩视频一区二区三区在线播放| 三级久久三级久久| 91精品久久久久久久91蜜桃| 奇米色一区二区| 日韩美女主播在线视频一区二区三区| 免费在线观看不卡| 精品国产一区二区三区久久久蜜月| 日本不卡不码高清免费观看| 日韩欧美激情四射| 国产伦精一区二区三区| 久久久久久久网| 成人午夜视频网站| 自拍偷拍欧美精品| 欧美综合亚洲图片综合区| 性感美女极品91精品| 亚洲午夜av在线| 欧美日本高清视频在线观看| 日本欧美在线观看| 久久综合九色欧美综合狠狠| 国产成人综合亚洲网站| 一色桃子久久精品亚洲| 在线观看亚洲a| 免费欧美日韩国产三级电影| 精品久久久久久久久久久久久久久 | 日韩视频免费直播| 国产在线精品一区二区不卡了| 国产欧美日韩在线看| 91小宝寻花一区二区三区| 亚洲国产视频网站| 日韩一区二区三区免费看| 国产精品中文字幕欧美| 国产精品第13页| 欧美在线一二三四区| 麻豆精品在线视频| 中文字幕成人av| 欧美日韩视频一区二区| 久久疯狂做爰流白浆xx| 一色桃子久久精品亚洲| 制服丝袜亚洲色图| 国产成人一区在线| 亚洲成人手机在线| 精品国产青草久久久久福利| av成人老司机| 日本在线不卡一区| 中文字幕第一区| 制服丝袜亚洲播放| 不卡的电影网站| 欧美情侣在线播放| 国产麻豆成人精品| 亚洲五码中文字幕| 国产视频一区在线播放| 在线观看91精品国产入口| 老司机精品视频导航| 成人免费在线播放视频| 91精品久久久久久久99蜜桃| 成人在线视频一区| 日日嗨av一区二区三区四区| 国产精品你懂的在线| 欧美一区二区三级| 色婷婷综合久久久久中文 | 欧美一区二区二区| 91老师片黄在线观看| 国产在线精品免费| 亚洲成人综合网站| 国产精品美女久久久久久久| 777xxx欧美| 色哦色哦哦色天天综合| 国产精品亚洲视频| 蜜臀av一区二区| 亚洲第一二三四区| 国产精品久久夜| 久久影院电视剧免费观看| 日本国产一区二区| heyzo一本久久综合| 久久精品国产澳门| 亚洲一区二区在线免费观看视频| 中文字幕精品在线不卡| 精品免费日韩av| 欧美久久久一区| 91香蕉视频黄| 成人av电影在线观看| 国产在线一区观看| 日韩精品国产精品| 亚洲一区二区三区四区在线观看 | 国产喷白浆一区二区三区| 91精品国产色综合久久| 在线中文字幕一区| 99re热这里只有精品视频| 国产黄色成人av| 国产一区二区三区免费播放| 蜜臀国产一区二区三区在线播放 | 韩国女主播成人在线| 七七婷婷婷婷精品国产| 亚洲国产精品欧美一二99| 亚洲免费视频成人| 综合色中文字幕| 日韩毛片视频在线看| 国产精品麻豆视频| 亚洲国产高清aⅴ视频| 日本一区二区三区久久久久久久久不 | 黑人精品欧美一区二区蜜桃|