Hi Jan:
I am posting the Device Descriptor and the Configuration Descriptor. (I am not posting the report descriptors, because one of them is too long, however, if you must see it, do let me know and I will post it as well).
Thanks
ftariq
unsigned char DEVICE_DESCRIPTOR[]=
{
0x12, // bLength = 18d
0x01, // bDescriptorType = Device (1)
0x00,0x02, // bcdUSB(L/H) USB spec rev (BCD)
0x00, // bDeviceClass
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
0x40, // bMaxPacketSize0 EP0 is 64 bytes
0x6A,0x0B, // idVendor(L/H)-- USB VID, Maxim is 0B6A
0x02,0x50, // idProduct(L/H)-- USB PID, 0x5000
0x00,0x01, // bcdDevice-- USB VER, 0x1000 = 01.0x
0x01, // iManufacturer, Vendor ID string index
0x02, // iProduct, Product ID string index
0x03, // iSerialNumber, Serial Number string index
0x01 // bNumConfigurations Number of configurations
};
unsigned char CONFIG_DESCRIPTOR[]= // CONFIGURATION Descriptor
{
// Configuration Descriptor
0x09, // bLength, Size of this descriptor in bytes
0x02, // bDescriptorType, CONFIGURATION descriptor type
0x42,0x00, // wTotalLength(L/H) (Config + Interface + HID + EPs) <****
2, // bNumInterfaces, Number of interfaces in this cfg, <================
1, // bConfigurationValue, Index value of this configuration
0, // iConfiguration, Configuration string index
0xA0, // bmAttributes, Attributes, see usb_device.h, has to do with power
50, // bMaxPower, Max power consumption (2X mA)
/** For TTS **/
// INTERFACE Descriptor
0x09, // length = 9
0x04, // type = Interface
0x00, // bInterfaceNum (1st interface is number 0)
0x00, // bAlternate Setting
0x02, // bNum Endpoints ( 1 In, 1 Out)
0x03, // bInterfaceClass = HID
0x00, // bInterfaceSubClas,
0x00, // bInterfaceProtocol
0x00, // iInterface string index
// HID Descriptor--It's at CD[18]
0x09, // bLength
0x21, // bDescriptorType = HID
0x10,0x01, // bcdHID(L/H) Rev 1.1
0x00, // bCountryCode (none)
0x01, // bNumDescriptors (one report descriptor)
0x22, // bDescriptorType (0x22 = report)
53,0, // wDescriptorLength(L/H) (report desc size)
// Endpoint Descriptor... Host Out Endpoint Desc (EP1 OUT), Data from TTS GUI
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x01, // bEndpointAddress (EP1-OUT)
0x03, // bmAttributes (interrupt)
64,0, // wMaxPacketSize (64)
1, // bInterval (poll every n msec)
// Endpoint Descriptor... Host IN Endpoint Desc (EP2 IN), Data to TTS GUI
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x82, // bEndpointAddress (EP2-IN)
0x03, // bmAttributes (interrupt)
64,0, // wMaxPacketSize (64)
1, // bInterval (poll every n msec)
/** For Windows ***/
// Interface Descriptor
0x09, // Size of this descriptor in bytes
0x04, // INTERFACE descriptor type
1, // Interface Number
0, // Alternate Setting Number
1, // Number of endpoints in this intf(1 IN) <****
0x03, // 0x03, HID Class code
0x00, // bInterfaceSubClas,
0x00, // bInterfaceProtocol
0, // Interface string index
// HID Class Descriptor--It's at CD[50]
0x09, // Size of this descriptor in bytes
0x21, // 0x21, HID descriptor type
0x10,0x01, // HID Spec Release Number in BCD format (1.11)
0x00, // Country Code (0x00 for Not supported)
1, // Number of class descriptors, see usbcfg.h
0x22, // Report descriptor type
(0xff & sizeof(REPORT_DESCRIPTOR)),
(sizeof(REPORT_DESCRIPTOR) >> 8 ), // Size of the report descriptor
// Endpoint Descriptor... Host IN Endpoint Desc (EP2 IN), Data to Windows
0x07, // sizeof(USB_EP_DSC)
0x05, // 0x05, Endpoint Descriptor
0x83, // bEndpointAddress (EP3-IN)
0x03, // INTERRUPT Attributes
64,0, // wMaxPacketSize (64)
0x01 // Interval
};