|
const char __flash CFG_DESC[] = {
CFG_LENGTH, // bLength
CONFIGURATION, // bDescriptorType
0x20,0x00, // wTotalLength
1, // bNumInterfaces
1, // bConfigurationValue
CFG_STR_OFS, // iConfiguration String Index
0x80, // bmAttributes Bus Powered, No Remote Wakeup
0x19, // bMaxPower, 50 mA
// interface descriptor
INT_LENGTH, // bLength
INTERFACE, // bDescriptorType
0, // bInterface Number
0, // bAlternateSetting
2, // bNumEndpoints
0xFF, // bInterfaceClass (Vendor specific)
0xFF, // bInterfaceSubClass
0xFF, // bInterfaceProtocol
INT_STR_OFS, // iInterface String Index
// endpoint descriptor
END_LENGTH, // bLength
ENDPOINT, // bDescriptorType
0x81, // bEndpoint Address EP1
0x02, // bmAttributes - Bulk
0x40,0x00, // wMaxPacketSize
0x00, // bInterval
// endpoint descriptor
END_LENGTH, // bLength
ENDPOINT, // bDescriptorType
0x02, // bEndpoint Address EP2
0x02, // bmAttributes - Bulk
0x040,0x00, // wMaxPacketSize
0x00 // bInterval
};
Константы:
#define DEVICE 0x01
#define CONFIGURATION 0x02
#define INTERFACE 0x04
#define ENDPOINT 0x05
#define DEV_LENGTH 18
#define CFG_LENGTH 9
#define INT_LENGTH 9
#define END_LENGTH 7
E-mail: info@telesys.ru