#ifndef USB_DESCRIPTORS_H #define USB_DESCRIPTORS_H /* Device descriptor */ unsigned char ds_dev[] = { 18, // Length 1, // Descriptor type 0x00, 0x02, // USB Release 0xff, // Device class 0x00, // Device sub class 0x00, // Device protocol 64, // Max packet size 0xc0, 0x16, // VID 0xdc, 0x05, // PID 0x01, 0x00, // Device relase 1, // Manufacturer string 0, // Product string 0, // Serial number string 1, // Number of configurations }; /* Configuration descriptor */ unsigned char ds_conf[] = { /* Configuration */ 9, // Length 2, // Descriptor type 0x22, 0x00, // Total length 1, // Number of interfaces 1, // Configuration value 0, // Configuration string 0xc0, // Attributes (1SR00000, S - Self powered, R - Remote wakeup) 50, // Maximum current (multiples of 2mA) /* Interface */ 9, // Length 4, // Descriptor type 0, // Interface number 0, // Alternate setting 1, // Number of endpoints 3, // Interface class 1, // Interface sub class 2, // Interface protocol 0, // Interface string /* HID */ 9, // Length 33, // Descriptor type 0x11, 0x01, // HID Class spec version 0, // Country code 1, // Number of descriptors 34, // Descriptor type 0x34, 0x00, // Descriptor length /* Endpoint */ 7, // Length 5, // Descriptor type 0x81, // Endpoint address (D000NNNN, D - Direction (0 OUT, 1 IN), N - Endpoint No.) 0x03, // Attributes (00UUSSTT, U - Usage type, S - Synch type, T - Transfer type) 0x08, 0x00, // Max packet size 64, // Interval (1ms Frames) }; /* Language descriptor */ unsigned char ds_lang[] = { 4, // Length 3, // Descriptor type 0x09, 0x04 // Language ID }; /* String descriptor 1 */ unsigned char ds_str1[] = { 22, // Length 3, // Descriptor type 0x74, 0x00, // t 0x68, 0x00, // h 0x65, 0x00, // e 0x2d, 0x00, // - 0x74, 0x00, // t 0x6b, 0x00, // k 0x2e, 0x00, // . 0x63, 0x00, // c 0x6f, 0x00, // o 0x6d, 0x00, // m }; #endif /* USB_DESCRIPTORS_H */