I have that :
const char USB_CLASS_SPECIFIC_DESC[] =
{
6, 0, 255, // Usage Page = Vendor Defined
9, 1, // Usage = IO device
0xa1, 1, // Collection = Application
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
0x15, 0x80, // Logical minimum (-128)
0x25, 0x7F, // Logical maximum (127)
0x75, 8, // Report size = 8 (bits)
0x95, USB_CONFIG_HID_TX_SIZE, // Report count = 16 bits (2 bytes) USB_CONFIG_HID_TX_SIZE=64
0x81, 2, // Input (Data, Var, Abs)
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
0x75, 8, // Report size = 8 (bits)
0x95, USB_CONFIG_HID_RX_SIZE, // Report count = 16 bits (2 bytes) USB_CONFIG_HID_RX_SIZE=64
0x91, 2, // Output (Data, Var, Abs)
0xc0 // End Collection
};
and
const char USB_CONFIG_DESC[] = {
//IN ORDER TO COMPLY WITH WINDOWS HOSTS, THE ORDER OF THIS ARRAY MUST BE:
// config(s)
// interface(s)
// class(es)
// endpoint(s)
//config_descriptor for config index 1
USB_DESC_CONFIG_LEN, //length of descriptor size
USB_DESC_CONFIG_TYPE, //constant CONFIGURATION (CONFIGURATION 0x02)
USB_TOTAL_CONFIG_LEN,0, //size of all data returned for this config #DEFINE USB_TOTAL_CONFIG_LEN 41
1, //number of interfaces this device supports
0x01, //identifier for this configuration. (IF we had more than one configurations)
0x00, //index of string descriptor for this configuration
#if USB_CONFIG_BUS_POWER
0x80, //bit 6=1 if self powered, bit 5=1 if supports remote wakeup (we don't), bits 0-4 unused and bit7=1
#else
0xC0, //bit 6=1 if self powered, bit 5=1 if supports remote wakeup (we don't), bits 0-4 unused and bit7=1
#endif
USB_CONFIG_BUS_POWER/2, //maximum bus power required (maximum milliamperes/2) (0x32 = 100mA) #define USB_CONFIG_BUS_POWER 100
//interface descriptor 1
USB_DESC_INTERFACE_LEN, //length of descriptor
USB_DESC_INTERFACE_TYPE, //constant INTERFACE (INTERFACE 0x04)
0x00, //number defining this interface (IF we had more than one interface)
0x00, //alternate setting
2, //number of endpoins, except 0 (pic167xx has 3, but we dont have to use all).
0x03, //class code, 03 = HID
0x00, //subclass code //boot
0x00, //protocol code
0x00, //index of string descriptor for interface
//class descriptor 1 (HID)
USB_DESC_CLASS_LEN, //length of descriptor
USB_DESC_CLASS_TYPE, //dscriptor type (0x21 == HID)
0x00,0x01, //hid class release number (1.0)
0x00, //localized country code (0 = none)
0x01, //number of hid class descrptors that follow (1)
0x22, //report descriptor type (0x22 == HID)
USB_CLASS_SPECIFIC_DESC_LOOKUP_SIZE[0][0], 0x00, //length of report descriptor
//endpoint descriptor
USB_DESC_ENDPOINT_LEN, //length of descriptor
USB_DESC_ENDPOINT_TYPE, //constant ENDPOINT (ENDPOINT 0x05)
0x81, //endpoint number and direction (0x81 = EP1 IN)
USB_EP1_TX_ENABLE, //transfer type supported (0x03 is interrupt) #define USB_EP1_TX_ENABLE USB_ENABLE_INTERRUPT
USB_EP1_TX_SIZE,0x00, //maximum packet size supported #define USB_EP1_TX_SIZE 64
USB_CONFIG_HID_TX_POLL, //polling interval, in ms. (cant be smaller than 10 for slow speed) #define USB_CONFIG_HID_TX_POLL 10
//endpoint descriptor
USB_DESC_ENDPOINT_LEN, //length of descriptor
USB_DESC_ENDPOINT_TYPE, //constant ENDPOINT (ENDPOINT 0x05)
0x01, //endpoint number and direction (0x01 = EP1 OUT)
USB_EP1_RX_ENABLE, //transfer type supported (0x03 is interrupt) #define USB_EP1_RX_ENABLE USB_ENABLE_INTERRUPT
USB_EP1_RX_SIZE,0x00, //maximum packet size supported #define USB_EP1_RX_SIZE 64
USB_CONFIG_HID_RX_SIZE//polling interval, in ms. (cant be smaller than 10 for slow speed) #DEFINE USB_CONFIG_HID_RX_SIZE 10
};
Many thanks for your analysis