⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myusb_descr.asm

📁 实现2个ps/2接口转到1个USB接口功能
💻 ASM
📖 第 1 页 / 共 3 页
字号:
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: myUSB_descr.asm
;;   Version: 1.5, Updated on 2005/08/17 at 15:01:28
;;  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
;;
;;  DESCRIPTION: USB User Module Descriptors
;;
;;  NOTE: User Module APIs conform to the fastcall convention for marshalling
;;        arguments and observe the associated "Registers are volatile" policy.
;;        This means it is the caller's responsibility to preserve any values
;;        in the X and A registers that are still needed after the API
;;        function returns. Even though these registers may be preserved now,
;;        there is no guarantee they will be preserved in future releases.
;;-----------------------------------------------------------------------------
;;  Copyright (c) Cypress Semiconductor 2004, 2005. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************

include "m8c.inc"
include "myUSB.inc"
include "myUSB_macros.inc"

WIZARD: equ 1
WIZARD_DEFINED_REPORT_STORAGE:    EQU    1
   ;--------------------------------------------------- 
   ;@PSoC_UserCode_BODY_1@ (Do not change this line.)
   ;---------------------------------------------------
   ; Insert your custom code below this banner
   ;---------------------------------------------------
   ; Redefine the WIZARD equate to 0 below by 
   ; uncommenting the WIZARD: equ 0 line 
   ; to allow your custom descriptor to take effect
   ;--------------------------------------------------- 

   ; WIZARD: equ 0
   ; WIZARD_DEFINED_REPORT_STORAGE:    EQU    0

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

IF WIZARD
;-----------------------------------------------
; USB Descriptors--Generated by the USB Setup Wizard
;-----------------------------------------------
AREA  UserModules     (ROM,REL,CON)
;----------------------------------------------------------------------
; Descriptor Dispatch Tables
;   The following tables provide the dispatching pointers and
;   descriptor lengths necessary for the request handler to
;   respond to USB requests.
;----------------------------------------------------------------------

;----------------------------------------------------------------------
; Device Dispatch Table
;   for User Module: (myUSB)
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
EXPORT myUSB_DEVICE_LOOKUP
.LITERAL
myUSB_DEVICE_LOOKUP:                             ;
  LT_START    1                                  ; Number of devices defined for myUSB
  LT_ENTRY    myUSB_D0_CONFIG_LOOKUP, myUSB_D0_CONFIG_DESCR_TABLE
.ENDLITERAL

;----------------------------------------------------------------------
; Configuration Dispatch Table
;   for Device: (myUSB_D0)
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
EXPORT myUSB_D0_CONFIG_LOOKUP
.LITERAL
myUSB_D0_CONFIG_LOOKUP:                          ;
  LT_START    1                                  ; Number of configurations
  LT_ENTRY    myUSB_D0_C1_EP_SETUP, myUSB_D0_C1_INTERFACE_LOOKUP
.ENDLITERAL

;----------------------------------------------------------------------
; Interface Look Up Table
; 
; This look up table points to three tables.  Each of those tables is
; indexed by the selected interface number provided by the request.
;
; Item 0: HID Report GET_REPORT/SET_REPORT Lookup Table
; Item 1: HID Report Descriptor Transfer Descriptor Table
; Item 2: HID Class Descriptor Transfer Descriptor Table
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
EXPORT myUSB_D0_C1_INTERFACE_LOOKUP
.LITERAL
myUSB_D0_C1_INTERFACE_LOOKUP:                    ;
  DW    myUSB_D0_C1_INTERFACE_RPT_LOOKUP         ; Interface GET_REPORT/SET_REPORT Lookup Table
  DW    myUSB_D0_C1_HID_RPT_DESCR_TABLE          ; HID Report Descriptor Transfer Descriptor Table
  DW    myUSB_D0_C1_HID_CLASS_DESCR_TABLE        ; HID Class Descriptor Transfer Descriptor Table
.ENDLITERAL

;----------------------------------------------------------------------
; Endpoint Setup Table
; 
; This table provides the data to configure the endpoint mode registers
; for IN/OUT direction.
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_EP_SETUP:                            ;
  DB    USB_DIR_IN                               ; Endpoint EP1(IN)
  DB    USB_DIR_IN                               ; Endpoint EP2(IN)
.ENDLITERAL

;----------------------------------------------------------------------
; Interface Lookup Table
; 
; This table is indexed by interface number.
;
;----------------------------------------------------------------------
EXPORT myUSB_D0_C1_INTERFACE_RPT_LOOKUP
.LITERAL
myUSB_D0_C1_INTERFACE_RPT_LOOKUP:                ;
  DW    myUSB_D0_C1_I0_HID_RPT_LOOKUP            
  DW    myUSB_D0_C1_I1_HID_RPT_LOOKUP            
.ENDLITERAL

;----------------------------------------------------------------------
; HID Class Descriptor transfer descriptor table
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
EXPORT myUSB_D0_C1_HID_CLASS_DESCR_TABLE
.LITERAL
myUSB_D0_C1_HID_CLASS_DESCR_TABLE:               ;
  TD_START_TABLE 2                               ; Number of interfaces/HID Class Descriptors
  TD_ENTRY       USB_DS_ROM, DESCR_SIZE_HID_CLASS, myUSB_D0_C1_I0_HID_DESCR_START, NULL_PTR
  TD_ENTRY       USB_DS_ROM, DESCR_SIZE_HID_CLASS, myUSB_D0_C1_I1_HID_DESCR_START, NULL_PTR
.ENDLITERAL

;----------------------------------------------------------------------
; HID Report Descriptor transfer descriptor table
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
EXPORT myUSB_D0_C1_HID_RPT_DESCR_TABLE
.LITERAL
myUSB_D0_C1_HID_RPT_DESCR_TABLE:                 ;
  TD_START_TABLE 2                               ; Number of interfaces/HID Report Descriptors
  TD_ENTRY       USB_DS_ROM, myUSB_HID_REPORT_2_DESCR_SIZE, myUSB_HID_REPORT_2_DESCR_START, NULL_PTR
  TD_ENTRY       USB_DS_ROM, myUSB_HID_REPORT_2_DESCR_SIZE, myUSB_HID_REPORT_2_DESCR_START, NULL_PTR
.ENDLITERAL
;----------------------------------------------------------------------
; HID Report Lookup Table for (myUSB_D0_C1_I0)
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_I0_HID_RPT_LOOKUP:                   
  LT_START    4                                  ; 4 Entries
  LT_ENTRY    myUSB_D0_C1_I0_IN_RPTS, NULL_PTR   ; IN Reports
  LT_ENTRY    myUSB_D0_C1_I0_OUT_RPTS, NULL_PTR  ; OUT Reports
  LT_ENTRY    myUSB_D0_C1_I0_FEATURE_RPTS, NULL_PTR; FEATURE Reports
.ENDLITERAL
;----------------------------------------------------------------------
; HID IN Report Transfer Descriptor Table for ()
;----------------------------------------------------------------------
IF WIZARD_DEFINED_REPORT_STORAGE
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_I0_IN_RPTS:                          
  TD_START_TABLE 1                               ; Only 1 Transfer Descriptor
  TD_ENTRY       USB_DS_RAM, myUSB_HID_RPT_2_IN_RPT_SIZE, myUSB_INTERFACE_0_IN_RPT_DATA, NULL_PTR
.ENDLITERAL
ENDIF ; WIZARD_DEFINED_REPORT_STORAGE
;----------------------------------------------------------------------
; HID OUT Report Transfer Descriptor Table for ()
;----------------------------------------------------------------------
IF WIZARD_DEFINED_REPORT_STORAGE
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_I0_OUT_RPTS:                         
  TD_START_TABLE 1                               ; Only 1 Transfer Descriptor
  TD_ENTRY       USB_DS_RAM, myUSB_HID_RPT_2_OUT_RPT_SIZE, myUSB_INTERFACE_0_OUT_RPT_DATA, NULL_PTR
.ENDLITERAL
ENDIF ; WIZARD_DEFINED_REPORT_STORAGE
;----------------------------------------------------------------------
; HID FEATURE Report Transfer Descriptor Table for ()
;----------------------------------------------------------------------
IF WIZARD_DEFINED_REPORT_STORAGE
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_I0_FEATURE_RPTS:                     
  TD_START_TABLE 1                               ; Only 1 Transfer Descriptor
  TD_ENTRY       USB_DS_RAM, myUSB_HID_RPT_2_FEATURE_RPT_SIZE, myUSB_INTERFACE_0_FEATURE_RPT_DATA, NULL_PTR
.ENDLITERAL
ENDIF ; WIZARD_DEFINED_REPORT_STORAGE
;----------------------------------------------------------------------
;----------------------------------------------------------------------
; HID Report Lookup Table for (myUSB_D0_C1_I1)
;----------------------------------------------------------------------
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_I1_HID_RPT_LOOKUP:                   
  LT_START    4                                  ; 4 Entries
  LT_ENTRY    myUSB_D0_C1_I1_IN_RPTS, NULL_PTR   ; IN Reports
  LT_ENTRY    myUSB_D0_C1_I1_OUT_RPTS, NULL_PTR  ; OUT Reports
  LT_ENTRY    myUSB_D0_C1_I1_FEATURE_RPTS, NULL_PTR; FEATURE Reports
.ENDLITERAL
;----------------------------------------------------------------------
; HID IN Report Transfer Descriptor Table for ()
;----------------------------------------------------------------------
IF WIZARD_DEFINED_REPORT_STORAGE
AREA  func_lit     (ROM,REL,CON)
.LITERAL
myUSB_D0_C1_I1_IN_RPTS:                          

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -