📄 descript.c
字号:
/**************** (c) 1998 STMicroelectronics **********************
PROJECT : USB - ST7
COMPILER : ST7 HICROSS C (HIWARE)
MODULE : descript.c
VERSION : V 1.0
CREATION DATE : 25/05/98
AUTHOR : / MICROCONTROLLER DIVISION / ST Rousset
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
DESCRIPTION : ST7263 USB descriptor.
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
MODIFICATIONS :
******************************************************************************/
#include "hidef.h"
#include "define.h"
#include "unicode.h"
#include "descript.h"
#include "usr_var.h"
#pragma DATA_SEG DEFAULT
const Byte ReportDescriptor[] = { // For SV-239
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x04, // USAGE (Jotstick)
0xA1, 0x01, // COLLECTION(Application)
0x85, 0x01, // REPORT_ID (1)
0x09, 0x01, // USAGE (Pointer)
0xA1, 0x00, // COLLECTION (Physical)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x32, // USAGE (Z)
0x09, 0x35, // USAGE (Rz)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x04, // REPORT_COUNT (4)
0x81, 0x02, // INPUT (Data, Var, Abs)
0xC0, // END_COLLECTION
0x09, 0x39, // USAGE (Hat switch)
0x15, 0x01, // LOGICAL_MINIMUM (1)
0x25, 0x08, // LOGICAL_MAXIMUM (8)
0x35, 0x00, // PHYSICAL_MINIMUM (0)
0x46, 0x3B, 0x01, // PHYSICAL_MAXIMUM (315)
0x65, 0x14, // UNIT (Eng Rot : Angular Pos)
0x75, 0x04, // REPORT_SIZE (4)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data, Var, Abs)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x14, // USAGE_MAXIMUM (Button 20)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x14, // REPORT_COUNT (20)
0x55, 0x00, // UNIT_EXPONENT (0)
0x65, 0x00, // UNIT (None)
0x81, 0x02, // INPUT (Data, Var, Abs)
0x85, 0x02, // REPORT_ID (2)
0x05, 0x08, // USAGE_PAGE (LED)
0x09, 0x43, // USAGE (Slow Blink on time)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x01, // REPORT_COUNT (1)
0x91, 0x82, // OUTPUT (Data,Var,Abs,Vol)
0x09, 0x44, // USAGE (Slow Blink off time)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x01, // REPORT_COUNT (1)
0x91, 0x82, // OUTPUT (Data,Var,Abs,Vol)
0x09, 0x45, // USAGE (Fast Blink on time)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x01, // REPORT_COUNT (1)
0x91, 0x82, // OUTPUT (Data,Var,Abs,Vol)
0xC0 // END_COLLECTION
};
//TOTALENGTHDESC = 0x73
const Byte DeviceDescriptor[] = {
0x12, // bLength
0x01, // bDescriptorType
0x01, // bcdUSB
0x01, // bDeviceClass
0x00,
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
0x08, // bMaxPacketSize0
0xFD, // idVendor
0x05,
//0x39, // idProduc
//0x02,
0x02, //2-17-00 idProduc 73002
0x30, //2-17-00 idProduc 73002
FWVersion2, // bcdDevice
FWVersion1,
INDEX_MANUFACT, // Index of string descriptor describing manufacturer
INDEX_PRODUCT, // Index of string descriptor describing product
// INDEX_SERIALNUM, // Index of string descriptor describing the device's serial number
0,
0x01 // bNumConfigurations
};
const Byte StringDescriptor[] = {
0x04, // bLength Length of String descriptor
0x03, // bDescriptorType
0x09, // bString US English
0x04,
LENGTH_MANUFACT, // bLength Length of String descriptor
0x03, // bDescriptorType
uS,
uT,
uD,
LENGTH_PRODUCT, // bLength Length of String descriptor
0x03, // bDescriptorType
uA,
ux,
ui,
us,
uP,
ua,
ud,
/*
uI, // Manufacturer
un,
ut,
ue,
ur,
uA,
uc,
ut,
uSPACE,
uH,
ua,
um,
um,
ue,
ur,
uH,
ue,
ua,
ud,
uSPACE,
uD,
uI,
uG,
uI,
uT,
uA,
uL,*/
/* LENGTH_SERIALNUM,
0x03, // bDescriptorType
u2,
u3,
u9,
LENGTH_ADDSTRING0,
0x03,
// Add your string
LENGTH_ADDSTRING1,
0x03
*/ // Add your string
};
const Byte ConfDescriptor[] = {
// Configuration descriptor
0x09, // bLength: Configuration Descriptor size
0x02, // bDescriptorType: Configuration
0x22, // wTotalLength: 34 Bytes returned
0x00,
0x01, // bNumInterfaces: 1 interface
0x01, // bConfigurationValue: Configuration value
0x00, // iConfiguration: Index of string descriptor describing the configuration
0x80, // bmAttributes: Bus powered and Remote wakeup
//0x2D, // MaxPower 90 mA
0x14, //MaxPower 40mA
// Interface descriptor
0x09, // bLength: Interface Descriptor size
0x04, // bDescriptorType: Interface descriptor type
0x00, // bInterfaceNumber: Number of Interface
0x00, // bAlternateSetting: Alternate setting
0x01, // bNumEndpoints: one endpoint used
0x03, // bInterfaceClass: HID
0x00, // bInterfaceSubClass: No subclass
0x00, // bInterfaceProtocol: None
0x00, // iInterface: Index of string descriptor
// HID descriptor
0x09, // bLength: HID Descriptor size
0x21, // bDescriptorType: HID
0x00, // bcdHID: HID Class Spec release number
0x01,
0x21, // bCountryCode: Hardware target country US
0x01, // bNumDescriptors: Number of HID class descriptors to follow
0x22, // bDescriptorType
TOTALENGTHDESC, // wItemLength: Total length of Report descriptor
// Endpoint descriptor
0x07, // bLength: Endpoint Descriptor size
0x05, // bDescriptorType: Endpoint descriptor type
0x81, // bEndpointAddress: Endpoint Address (IN)
0x03, // bmAttributes: Interrupt endpoint
0x08, // wMaxPacketSize: 8 Byte max
0x00,
0x14 // bInterval: Polling Interval (20 ms)
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -