;;----------------------------------------------------------------------------- ;; File: dscr.asm ;; modified by ENDO.Taichi for SDCC 2006-03-15 ;; Contents: This file contains descriptor data for sample mouse/keyboard descriptor tables. ;; ;; Copyright (c) 2001 Cypress Semiconductor, Inc. All rights reserved ;;----------------------------------------------------------------------------- .module DSCR DSCR_DEVICE = 1 ;; Descriptor type: Device DSCR_CONFIG = 2 ;; Descriptor type: Configuration DSCR_STRING = 3 ;; Descriptor type: String DSCR_INTRFC = 4 ;; Descriptor type: Interface DSCR_ENDPNT = 5 ;; Descriptor type: Endpoint ET_CONTROL = 0 ;; Endpoint type: Control ET_ISO = 1 ;; Endpoint type: Isochronous ET_BULK = 2 ;; Endpoint type: Bulk ET_INT = 3 ;; Endpoint type: Interrupt .globl _DeviceDscr, _ConfigDscr, _StringDscr, _UserDscr, _HID1Dscr, _HID1ReportDscr, _HID1ReportDscrEnd .globl _HID2Dscr, _HID2ReportDscr, _HID2ReportDscrEnd .area CSEG (CODE) ;;----------------------------------------------------------------------------- ;; Global Variables ;;----------------------------------------------------------------------------- ;; Note: This segment must be located in on-part memory. ;; rseg DSCR ;; locate the descriptor table anywhere below 8K _DeviceDscr: DeviceDscr: .db DeviceDscrEnd-DeviceDscr ;; Descriptor length .db DSCR_DEVICE ;; Decriptor type .dw 0x0001 ;; Specification Version (BCD) .db 0x00 ;; Device class .db 0x00 ;; Device sub-class .db 0x00 ;; Device sub-sub-class .db 64 ;; Maximum packet size .dw 0x4705 ;; Vendor ID .dw 0x2910 ;; Product ID - set to example ID .dw 0x0100 ;; Product version ID .db 0 ;; Manufacturer string index .db 0 ;; Product string index .db 0 ;; Serial number string index .db 1 ;; Number of configurations DeviceDscrEnd: _ConfigDscr: ConfigDscr: .db ConfigDscrEnd-ConfigDscr ;; Descriptor length .db DSCR_CONFIG ;; Descriptor type .db StringDscr-ConfigDscr ;; Configuration + End Points length (LSB) .db (StringDscr-ConfigDscr)/256 ;; Configuration + End Points length (MSB) .db 2 ;; Number of interfaces .db 1 ;; Interface number .db 0 ;; Configuration string .db 0b10100000 ;; Attributes (b7 - buspwr, b6 - selfpwr, b5 - rwu) .db 0 ;; Power requirement (div 2 ma) ConfigDscrEnd: HID1IntrfcDscr: .db HID1IntrfcDscrEnd-HID1IntrfcDscr ;; Descriptor length .db DSCR_INTRFC ;; Descriptor type .db 0x00 ;; Zero-based index of this interface .db 0 ;; Alternate setting .db 1 ;; Number of end points .db 0x03 ;; Interface class (HID) .db 0x01 ;; Boot Interface sub class .db 0x02 ;; Interface sub sub class (Mouse) .db 0x00 ;; Interface descriptor string index HID1IntrfcDscrEnd: _HID1Dscr: HID1Dscr: .db 0x09 ; length .db 0x21 ; type: HID .db 0x10,0x01 ; release: HID class rev 1.1 .db 0x00 ; country code (none) .db 0x01 ; number of HID class descriptors to follow .db 0x22 ; report descriptor type (HID) .db (HID1ReportDscrEnd-HID1ReportDscr) ; length of HID descriptor .db 0x00 HID1DscrEnd: HID1EpInDscr: .db HID1EpInDscrEnd-HID1EpInDscr ;; Descriptor length .db DSCR_ENDPNT ;; Descriptor type .db 0x82 ;; Endpoint number, and direction .db ET_INT ;; Endpoint type .db 0x40 ;; Maximum packet size (LSB) .db 0x00 ;; Max packet size (MSB) .db 10 ;; Polling interval HID1EpInDscrEnd: HID2IntrfcDscr: .db HID2IntrfcDscrEnd-HID2IntrfcDscr ;; Descriptor length .db DSCR_INTRFC ;; Descriptor type .db 0x01 ;; Zero-based index of this interface .db 0 ;; Alternate setting .db 1 ;; Number of end points .db 0x03 ;; Interface class (HID) .db 0x00 ;; Interface sub class .db 0x00 ;; Interface sub sub class .db 0 ;; Interface descriptor string index HID2IntrfcDscrEnd: _HID2Dscr: HID2Dscr: .db 0x09 ; length .db 0x21 ; type: HID .db 0x10,0x01 ; release: HID class rev 1.0 .db 0x00 ; country code (none) .db 0x01 ; number of HID class descriptors to follow .db 0x22 ; report descriptor type (HID) .db (HID2ReportDscrEnd-HID2ReportDscr) ; length of HID descriptor .db 0x00 HID2DscrEnd: HID2EpInDscr: .db HID2EpInDscrEnd-HID2EpInDscr ;; Descriptor length .db DSCR_ENDPNT ;; Descriptor type .db 0x81 ;; Endpoint number, and direction .db ET_INT ;; Endpoint type .db 0x40 ;; Maximun packet size (LSB) .db 0x00 ;; Max packect size (MSB) .db 10 ;; Polling interval HID2EpInDscrEnd: _HID1ReportDscr: HID1ReportDscr: .db 0x05, 0x01 ;Usage Page (Generic Desktop), .db 0x09, 0x02 ;Usage (Mouse), .db 0x0A1, 0x01 ;Collection (Application), .db 0x09, 0x01 ;Usage (Pointer), .db 0x0A1, 0x00 ;Collection (Physical), .db 0x95, 0x03 ;Report Count (3), .db 0x75, 0x01 ;Report Size (1), .db 0x05, 0x09 ;Usage Page (Buttons), .db 0x19, 0x01 ;Usage minimum (1) .db 0x29, 0x03 ;Usage maximum (3) .db 0x15, 0x00 ;Logical minimum (0), .db 0x25, 0x01 ;Logical maximum (1), .db 0x81, 0x02 ;Input (Data, Variable, Absolute), (3 button bits.) .db 0x95, 0x01 ;Report Count (1), .db 0x75, 0x05 ;Report Size (5), .db 0x81, 0x01 ;Input (Constant) .db 0x75, 0x08 ;Report Size (8) .db 0x95, 0x02 ;Report Count (2) .db 0x05, 0x01 ;Usage Page (Generic Desktop), .db 0x09, 0x30 ;Usage (X), .db 0x09, 0x31 ;Usage (Y), .db 0x15, 0x81 ;Logical Minimum (-127), .db 0x25, 0x7F ;Logical Maximum (+127), .db 0x81, 0x06 ;Input (Data, Variable, Relative), (2 position bytes - X & Y) .db 0x0C0 ;End Collection .db 0x0C0 ;End Collection HID1ReportDscrEnd: _HID1ReportDscrEnd: _HID2ReportDscr: HID2ReportDscr: .db 0x05, 0x01 ;Usage Page (Generic Desktop) .db 0x09, 0x06 ;Usage (Keyboard) .db 0x0A1, 0x01 ;Collection (Application) .db 0x05, 0x07 ;Usage Page (Key codes) .db 0x19, 0x0E0 ;Usage minimum (234) .db 0x29, 0x0E7 ;Usage maximum (231) .db 0x15, 0x00 ;Logical minimum (0) .db 0x25, 0x01 ;Logical maximum (1) .db 0x75, 0x01 ;Report size (1) .db 0x95, 0x08 ;Report count (8) .db 0x81, 0x02 ;Input (data, variable, absolute) .db 0x95, 0x01 ;Report count (1) .db 0x75, 0x08 ;Report size (8) .db 0x81, 0x01 ;Input (constant) .db 0x95, 0x05 ;Report count (5) .db 0x75, 0x01 ;Report size (1) .db 0x05, 0x08 ;Usage Page (LED) .db 0x19, 0x01 ;Usage minimum (1) .db 0x29, 0x05 ;Usage maximum (5) .db 0x91, 0x02 ;Output (data, variable, absolute) .db 0x95, 0x01 ;Report count (1) .db 0x75, 0x03 ;Report size (3) .db 0x91, 0x01 ;Output (constant) .db 0x95, 0x03 ;Report count (3) .db 0x75, 0x08 ;Report size (8) .db 0x15, 0x00 ;Logical minimum (0) .db 0x25, 0x65 ;Logical maximum (101) .db 0x05, 0x07 ;Usage page (key codes) .db 0x19, 0x00 ;Usage minimum (0) .db 0x29, 0x65 ;Usage maximum (101) .db 0x81, 0x00 ;Input (data, array) .db 0x0C0 ;End Collection HID2ReportDscrEnd: _HID2ReportDscrEnd: _StringDscr: StringDscr: StringDscr0: .db StringDscr0End-StringDscr0 ;; String descriptor length .db DSCR_STRING .db 0x09,0x04 StringDscr0End: StringDscr1: .db StringDscr1End-StringDscr1 ;; String descriptor length .db DSCR_STRING .ascii 'C' .db 0x00 .ascii 'y' .db 0x00 .ascii 'p' .db 0x00 .ascii 'r' .db 0x00 .ascii 'e' .db 0x00 .ascii 's' .db 0x00 .ascii 's' .db 0x00 StringDscr1End: StringDscr2: .db StringDscr2End-StringDscr2 ;; Descriptor length .db DSCR_STRING .ascii 'E' .db 0x00 .ascii 'Z' .db 0x00 .ascii '-' .db 0x00 .ascii 'C' .db 0x00 .ascii 'o' .db 0x00 .ascii 'm' .db 0x00 .ascii 'b' .db 0x00 .ascii 'o' .db 0x00 StringDscr2End: _UserDscr: UserDscr: .dw 0x0000