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

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

?? usb_cls_hid.asm

?? 單片機USB接口模擬鍵盤,該程序可以控制PC機的PS/2鍵盤的NUM LOCK和SCROLL LOCK的燈,以此說明通訊正常
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;
;****************************************************************
; HID CLASS INTERFACE OUT REQUEST: Set_Idle
;****************************************************************
;
; bmRequestType   : (OUT | CLASS | INTERFACE)      = 21h
; bRequest        : SET_IDLE                       = 0Ah    
; wValue          : DURATION | REPORT ID           = xxxxh  
; wIndex          : INTERFACE                      = --xxh
; wLength         : ZERO                           = 0000h  
; 
; The SET_IDLE request silences a particular input report (or all 
; input reports) on a specific interface until a new event occurs 
; or the specified amount of time passes. 
;
;****************************************************************
; Note: This function does not support multiple reports per interface.
;****************************************************************
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
IF (USB_CB_SRC_h2d_cls_ifc_10 & USB_UM_SUPPLIED)
export  USB_CB_h2d_cls_ifc_10
USB_CB_h2d_cls_ifc_10:
    MOV     A, REG[USB_EP0DATA+wValueLo]  ; Get the report number
    CMP     A, 0                       ; We don't support report by report idle
    JNZ     USB_Not_Supported_Local_Hid

    MOV     A, REG[USB_EP0DATA+wIndexLo]  ; Get the interface number
    CMP     A, 1h                      ; Range Check
    JNC     USB_Not_Supported_Local_Hid

    MOV     X, A                       ; Interface Number becomes an index

    MOV     A, REG[USB_EP0DATA+wValueHi]  ; Get the duration

    MOV     [X+USB_IdleReload], A      ; Save the reload immediately
    CMP     A, 0                       ; Is this request setting the duration to indefinite?
    JZ      .reload                    ; If so, reload the timer 

    ; Otherwise, we need to determine if we reset the current expiry
    ; (HID Spec says to send the next report if we are within 4 ms (1 count)
    ; of sending the next report
    CMP     [X+USB_IdleTimer], 1       ; Within 4 ms?
    JZ      .done                      ; Jump to let the timer expire "naturally" 

; Jump or Flow here to reload the timer
.reload:
    MOV     [x+USB_IdleTimer], A       ; Reload the timer
            
.done:
    JMP     USB_NoDataStageControlTransfer
ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_h2d_cls_ifc_11
;
;  DESCRIPTION:   Set Idle
;
;****************************************************************
; HID CLASS INTERFACE OUT REQUEST: Set_Protocol
;****************************************************************
;
; bmRequestType  : (OUT | CLASS | INTERFACE)      = 21h
; bRequest       : SET_PROTOCOL                   = 0Bh    
; wValue         : DURATION | REPORT ID           = xxxxh  
; wIndex         : PROTOCOL                       = --xxh
; wLength        : ZERO                           = 0000h  
; 
; The SET_PROTOCOL request switches between the boot protocol and 
; the report protocol (or vice versa). 
;
;****************************************************************
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
IF (USB_CB_SRC_h2d_cls_ifc_11 & USB_UM_SUPPLIED)
export  USB_CB_h2d_cls_ifc_11
USB_CB_h2d_cls_ifc_11:
    MOV     A, REG[USB_EP0DATA+wIndexLo]  ; Get the interface number
    CMP     A, 1h                      ; Range check
    JNC     USB_Not_Supported_Local_Hid

    MOV     X, A                       ; Save the interface number

    MOV     A, REG[USB_EP0DATA+wValueLo]  ; Get the protocol
    CMP     A, (1+1)                   ; Must be zero or one
    JNC     USB_Not_Supported_Local_Hid

    MOV     [X + USB_Protocol], A      ; Save the new protocol

    LJMP     USB_NoDataStageControlTransfer
ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME:   Find_Report
;
;  DESCRIPTION:     Scan the HID Report Tree and return a pointer to the 
;                   HID Report Transfer Descriptor (TD) or NULL
;                   This function is called in during the processing of
;                   GET_REPORT or SET_REPORT HID Class Requests.
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:       
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
Find_Report:
    CALL    USB_GetInterfaceLookupTable  ; Point the the interface lookup table
    ; The first entry of the table point to the report table.
    MOV     [USB_t2],USB_t1            ; Set the GETWORD destination 
    CALL    USB_GETWORD                ; Get the pointer to the transfer descriptor table
                                       ; ITempW has the address
    MOV     A, REG[USB_EP0DATA+wIndexLo]  ; Get the interface number
    MOV     [USB_t2], A                ; Use the UM temp var--Selector
    MOV     A, [USB_t1]                ; Get the Table Address MSB
    MOV     X, [USB_t1+1]              ; Get the Table Address LSB

    ASL     [USB_t2]                   ; Convert the index to offset

    SWAP    A, X
    ADD     A, [USB_t2]
    SWAP    A, X
    ADC     A, 0                       ; A:X now points to the table entry we want

; Get the pointer to the Report Type Table
    GET_WORD

; Dereference to the requested Report Type
    PUSH    A                          ; Don't loose the pointer MSB
    MOV     A, REG[USB_EP0DATA+wValueHi]  ; Get the Report Type
    DEC     A                          ; Make it 0 based
    MOV     [USB_t2], A                ; Use the UM temp var--Selector
    POP     A                          ; Get the MSB back
    PUSH    A                          ; Don't loose the pointer MSB
    ROMX                               ; Get the table size
    CMP     A, [USB_t2]                ; Range check
    JC      .not_supported_pop_1
        
    POP     A                          ; Get the MSB back
    INC     X                          ; Point to the next  entry
    ADC     A, 0                       ;

    LT_INDEX_TO_OFFSET USB_t2          ; Convert the index to offset

    SWAP    A, X
    ADD     A, [USB_t2]
    SWAP    A, X
    ADC     A, 0                       ; A:X now points to the table entry we want
; Get the pointer to the requested Report Table
    GET_WORD                            ; A:X points to the 

    NULL_PTR_CHECK .not_supported      ; Null Table entries indicated not supported
; Dereference to the requested TRANSFER DESCRIPTOR
    PUSH    A                          ; Don't loose the pointer MSB
    MOV     A, REG[USB_EP0DATA+wValueLo]  ; Get the Report ID
    MOV     [USB_t2], A                ; Use the UM temp var--Selector
    POP     A                          ; Get the MSB back
    PUSH    A                          ; Don't loose the pointer MSB
    ROMX                               ; Get the table size
    CMP     A, [USB_t2]                ; Range check
    JC      .not_supported_pop_1
        
    POP     A                          ; Get the MSB back

    RET                                ; Finished A:X point to the TD

.not_supported_pop_1:
    POP     A                          ; Restore the stack
.not_supported:
    MOV     A, 0                       ; Return a null pointer
    MOV     X, A                       ; 
    RET

;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_GetInterfaceLookupTable
;
;  DESCRIPTION:   Point to the interface lookup table
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
export  USB_GetInterfaceLookupTable:
USB_GetInterfaceLookupTable:
    CALL    USB_GET_CONFIG_TABLE_ENTRY ; Get the CONFIG_LOOKUP entry
    SWAP    A, X                       ; Second entry points to the HID_LOOKUP table
    ADD     A, 2                       ; So add two
    SWAP    A, X                       ; 
    ADC     A, 0                       ; Don't forget the carry
    MOV     [USB_t2],USB_t1            ; Set the GETWORD destination 
    CALL    USB_GETWORD                ; Get the pointer to the HID_LOOKUP table
                                       ; ITempW has the address
    MOV     A, [USB_t1]                ; Get the table address MSB
    MOV     X, [USB_t1+1]              ; Get the table address LSB
    RET
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
;  USB 2nd Tier Dispactch Jump Tables for HID Class Requests (based on bRequest)
;-----------------------------------------------------------------------------
;  FUNCTION NAME: ;  USB 2nd Tier Dispactch Jump Table
;
;  DESCRIPTION:   The following tables dispatch to the Standard request handler
;                 functions.  (Assumes bmRequestType(5:6) is 0, Standard)
;
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
USB_DT_h2d_cls_ifc:
;-----------------------------------------------------------------------------
    jmp     USB_CB_h2d_cls_ifc_00
    jmp     USB_CB_h2d_cls_ifc_01
    jmp     USB_CB_h2d_cls_ifc_02
    jmp     USB_CB_h2d_cls_ifc_03
    jmp     USB_CB_h2d_cls_ifc_04
    jmp     USB_CB_h2d_cls_ifc_05
    jmp     USB_CB_h2d_cls_ifc_06
    jmp     USB_CB_h2d_cls_ifc_07
    jmp     USB_CB_h2d_cls_ifc_08
    jmp     USB_CB_h2d_cls_ifc_09
    jmp     USB_CB_h2d_cls_ifc_10
    jmp     USB_CB_h2d_cls_ifc_11
    jmp     USB_CB_h2d_cls_ifc_12

USB_DT_h2d_cls_ifc_End:
USB_DT_h2d_cls_ifc_Size: equ (USB_DT_h2d_cls_ifc_End-USB_DT_h2d_cls_ifc) / 2
USB_DT_h2d_cls_ifc_Dispatch::
    CMP     [USB_Configuration], 0     ; Is the device configured?
    JNZ     .configured                ; Jump on configured
    JMP     USB_Not_Supported_Local_Hid  ; Stall the request if not configured
; Jump here if the device is configured
.configured:
    MOV     A, REG[USB_EP0DATA + bRequest]       ; Get the request number
    DISPATCHER USB_DT_h2d_cls_ifc, USB_DT_h2d_cls_ifc_Size, USB_Not_Supported_Local_Hid 

;-----------------------------------------------------------------------------
USB_DT_d2h_cls_ifc:
;-----------------------------------------------------------------------------

    jmp     USB_CB_d2h_cls_ifc_00
    jmp     USB_CB_d2h_cls_ifc_01
    jmp     USB_CB_d2h_cls_ifc_02
    jmp     USB_CB_d2h_cls_ifc_03

USB_DT_d2h_cls_ifc_End:
USB_DT_d2h_cls_ifc_Size: equ (USB_DT_d2h_cls_ifc_End-USB_DT_d2h_cls_ifc) / 2
USB_DT_d2h_cls_ifc_Dispatch::
    CMP     [USB_Configuration], 0     ; Is the device configured?
    JNZ     .configured                ; Jump on configured
    JMP     USB_Not_Supported_Local_Hid  ; Stall the request if not configured
; Jump here if the device is configured
.configured:
    MOV     A, REG[USB_EP0DATA + bRequest]       ; Get the request number
    DISPATCHER USB_DT_d2h_cls_ifc, USB_DT_d2h_cls_ifc_Size, USB_Not_Supported_Local_Hid 

IF (USB_CB_SRC_d2h_cls_ifc_00 & USB_NOT_SUPPORTED)
export  USB_CB_d2h_cls_ifc_00
USB_CB_d2h_cls_ifc_00:
ENDIF
IF (USB_CB_SRC_d2h_cls_ifc_01 & USB_NOT_SUPPORTED)
export  USB_CB_d2h_cls_ifc_01
USB_CB_d2h_cls_ifc_01:
ENDIF
IF (USB_CB_SRC_d2h_cls_ifc_02 & USB_NOT_SUPPORTED)
export  USB_CB_d2h_cls_ifc_02
USB_CB_d2h_cls_ifc_02:
ENDIF
IF (USB_CB_SRC_d2h_cls_ifc_03 & USB_NOT_SUPPORTED)
export  USB_CB_d2h_cls_ifc_03
USB_CB_d2h_cls_ifc_03:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_00 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_00
USB_CB_h2d_cls_ifc_00:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_01 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_01
USB_CB_h2d_cls_ifc_01:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_02 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_02
USB_CB_h2d_cls_ifc_02:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_03 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_03
USB_CB_h2d_cls_ifc_03:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_04 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_04
USB_CB_h2d_cls_ifc_04:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_05 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_05
USB_CB_h2d_cls_ifc_05:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_06 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_06
USB_CB_h2d_cls_ifc_06:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_07 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_07
USB_CB_h2d_cls_ifc_07:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_08 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_08
USB_CB_h2d_cls_ifc_08:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_09 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_09
USB_CB_h2d_cls_ifc_09:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_10 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_10
USB_CB_h2d_cls_ifc_10:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_11 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_11
USB_CB_h2d_cls_ifc_11:
ENDIF
IF (USB_CB_SRC_h2d_cls_ifc_12 & USB_NOT_SUPPORTED)
export  USB_CB_h2d_cls_ifc_12
USB_CB_h2d_cls_ifc_12:
ENDIF

USB_Not_Supported_Local_Hid:
    LJMP     USB_Not_Supported

USB_GetTableEntry_Local_Hid:
    LJMP     USB_GetTableEntry

;-----------------------------------------------
; Add custom application code for routines 
; redefined by USB_APP_SUPPLIED in USB_HID.INC
;-----------------------------------------------

   ;@PSoC_UserCode_BODY_1@ (Do not change this line.)
   ;---------------------------------------------------
   ; Insert your custom code below this banner
   ;---------------------------------------------------

   ;---------------------------------------------------
   ; Insert your custom code above this banner
   ;---------------------------------------------------
   ;@PSoC_UserCode_END@ (Do not change this line.)

; End of File USB_cls_hid.asm

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区不卡| 成人av电影免费在线播放| 亚洲成精国产精品女| 亚洲黄网站在线观看| 成人欧美一区二区三区在线播放| 欧美性感一区二区三区| 欧美乱妇20p| 欧美成人一区二区三区片免费| 欧美精品久久天天躁| 精品免费一区二区三区| 国产欧美日韩三级| 国产精品电影一区二区| 综合欧美一区二区三区| 国产精品网友自拍| 国产精品久久久久天堂| 亚洲精品国产一区二区三区四区在线| 亚洲电影一区二区三区| 久久精品国产亚洲高清剧情介绍| 黑人精品欧美一区二区蜜桃| 国产一区高清在线| 色综合久久久久综合| 欧美性高清videossexo| 91精品国产欧美一区二区18| 国产精品久久久久9999吃药| 欧美bbbbb| 欧美主播一区二区三区美女| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲va在线va天堂| 波多野结衣精品在线| 日韩一级高清毛片| 亚洲第一会所有码转帖| 不卡区在线中文字幕| 久久人人97超碰com| 亚洲国产视频一区| 欧美日韩dvd在线观看| 日韩黄色免费电影| 日韩一级黄色片| 国产suv精品一区二区6| 国产午夜精品美女毛片视频| 狠狠色丁香九九婷婷综合五月| 91麻豆精品国产91久久久使用方法| 国产精品成人网| 色偷偷久久一区二区三区| 久久精品一区二区三区av | 秋霞电影网一区二区| 在线不卡中文字幕| 国产高清精品在线| 久久久电影一区二区三区| 国产资源精品在线观看| 精品久久久久久久久久久久久久久久久 | 99精品热视频| 亚洲成人自拍一区| 欧美tickling网站挠脚心| 蜜桃视频在线一区| 久久午夜电影网| 91捆绑美女网站| 国产一区二区视频在线| 一区二区成人在线视频| 久久天堂av综合合色蜜桃网| jlzzjlzz欧美大全| 蜜臀av一区二区| 亚洲在线视频免费观看| 成人午夜电影小说| 国产精品久久久久久久久久免费看| 国产不卡在线播放| 日韩电影在线看| 亚洲国产精品二十页| 欧美三级欧美一级| 欧美最新大片在线看| 91色porny蝌蚪| 成人精品在线视频观看| 免费欧美日韩国产三级电影| 伊人婷婷欧美激情| 国产欧美日韩卡一| 精品捆绑美女sm三区| 亚洲精品在线免费观看视频| 欧美日韩在线播放一区| 欧美制服丝袜第一页| 91丨porny丨蝌蚪视频| 国产精品一区二区久激情瑜伽 | 亚洲欧美日韩久久| 亚洲视频在线观看三级| 亚洲三级电影全部在线观看高清| 国产精品久久免费看| 国产精品无遮挡| 中文字幕在线播放不卡一区| 国产日韩欧美一区二区三区乱码| 精品嫩草影院久久| 成人欧美一区二区三区黑人麻豆 | av在线不卡电影| 激情综合色丁香一区二区| 成人avav影音| 欧美电视剧免费观看| 国产欧美日韩不卡| 午夜天堂影视香蕉久久| 国产精一区二区三区| 一本一道综合狠狠老| 欧美一区二区精品久久911| 亚洲综合图片区| 风间由美一区二区三区在线观看 | 欧美三级在线视频| 久久午夜色播影院免费高清| 亚洲午夜久久久久久久久电影网| 国产剧情一区二区三区| 欧美日韩国产a| 国产欧美精品区一区二区三区 | 国产精品青草久久| av电影在线观看不卡| 2014亚洲片线观看视频免费| 视频一区二区国产| 51午夜精品国产| 一区二区三区在线播| 91麻豆国产福利精品| 亚洲激情在线播放| 91久久免费观看| 夜夜精品浪潮av一区二区三区| 国产成人99久久亚洲综合精品| 26uuu国产电影一区二区| 免费成人在线网站| 91精品国产综合久久精品麻豆 | 亚洲国产精品欧美一二99| 欧美影院一区二区三区| 天天av天天翘天天综合网色鬼国产| 不卡av在线网| 中文字幕在线观看不卡视频| 99在线视频精品| 中文字幕第一区| 色天使色偷偷av一区二区| 亚洲综合视频在线观看| 欧美一二三区在线| 成人高清视频在线| 天使萌一区二区三区免费观看| 欧美日韩小视频| 国产精品一区二区在线播放| 中文字幕欧美一区| 日韩美女视频一区二区在线观看| 成人性生交大合| 日韩一区二区免费在线电影| 成人午夜短视频| 蜜桃视频免费观看一区| 一区二区免费看| 亚洲欧美在线视频| 日本一区二区成人| 久久精品在这里| 久久九九国产精品| 日韩欧美一区中文| 26uuu亚洲| 久久影院午夜片一区| 久久蜜桃av一区二区天堂| 日韩欧美激情在线| 久久综合国产精品| 国产欧美综合在线观看第十页| 欧美zozo另类异族| 国产精品国产三级国产有无不卡| 精品福利一区二区三区| 国产偷国产偷精品高清尤物| 亚洲国产精品久久不卡毛片| 国产亚洲美州欧州综合国| 色视频一区二区| 在线观看成人免费视频| 不卡的av电影| 欧美综合久久久| 在线欧美一区二区| 日韩精品自拍偷拍| 日韩欧美一区二区在线视频| 欧美经典一区二区| 一区二区三区四区高清精品免费观看 | 久久久99久久| 欧美大度的电影原声| 欧美大片一区二区| 一区2区3区在线看| 久久精品国产免费看久久精品| 美女一区二区视频| 美女脱光内衣内裤视频久久影院| 精品在线免费观看| 91网站在线观看视频| 日韩三级在线观看| 亚洲视频狠狠干| 亚洲一区二区三区国产| 国产精品一区久久久久| 精品久久人人做人人爱| 国产精品乱码人人做人人爱 | 91精品国产乱码| 亚洲激情中文1区| 国产黄色成人av| 国产精品久久久久aaaa樱花 | 精品视频一区三区九区| 丝袜亚洲另类欧美| 欧美伊人精品成人久久综合97| 久久久高清一区二区三区| 国模娜娜一区二区三区| 久久天天做天天爱综合色| 激情综合色丁香一区二区| 91黄色小视频| 亚洲色图另类专区| 在线日韩国产精品| 亚洲精品视频在线| 91麻豆产精品久久久久久 | 日韩午夜电影av| 国产又黄又大久久|