Suga koubou
/
USB_CDC
Revision 1:e5b352a3e0a9, committed 2011-11-09
- Comitter:
- okini3939
- Date:
- Wed Nov 09 09:30:28 2011 +0000
- Parent:
- 0:d644bf01b0cb
- Commit message:
Changed in this revision
USBCDC.cpp | Show annotated file Show diff for this revision Revisions of this file |
USBCDC.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r d644bf01b0cb -r e5b352a3e0a9 USBCDC.cpp --- a/USBCDC.cpp Tue Nov 08 15:46:25 2011 +0000 +++ b/USBCDC.cpp Wed Nov 09 09:30:28 2011 +0000 @@ -133,3 +133,27 @@ }; return configDescriptor; } + +uint8_t * USBCDC::deviceDesc() { + static uint8_t deviceDescriptor[] = { + DEVICE_DESCRIPTOR_LENGTH, /* bLength */ + DEVICE_DESCRIPTOR, /* bDescriptorType */ + LSB(0x01), /* bcdUSB (LSB) */ + MSB(0x01), /* bcdUSB (MSB) */ + 0x02, /* bDeviceClass */ + 0x00, /* bDeviceSubClass */ + 0x00, /* bDeviceprotocol */ + MAX_PACKET_SIZE_EP0, /* bMaxPacketSize0 */ + LSB(VENDOR_ID), /* idVendor (LSB) */ + MSB(VENDOR_ID), /* idVendor (MSB) */ + LSB(PRODUCT_ID), /* idProduct (LSB) */ + MSB(PRODUCT_ID), /* idProduct (MSB) */ + LSB(PRODUCT_RELEASE), /* bcdDevice (LSB) */ + MSB(PRODUCT_RELEASE), /* bcdDevice (MSB) */ + STRING_OFFSET_IMANUFACTURER, /* iManufacturer */ + STRING_OFFSET_IPRODUCT, /* iProduct */ + STRING_OFFSET_ISERIAL, /* iSerialNumber */ + 0x01 /* bNumConfigurations */ + }; + return deviceDescriptor; +}
diff -r d644bf01b0cb -r e5b352a3e0a9 USBCDC.h --- a/USBCDC.h Tue Nov 08 15:46:25 2011 +0000 +++ b/USBCDC.h Wed Nov 09 09:30:28 2011 +0000 @@ -43,6 +43,7 @@ * @returns pointer to the configuration descriptor */ virtual uint8_t * configurationDesc(); + virtual uint8_t * deviceDesc(); virtual bool USBCallback_setConfiguration(uint8_t configuration);