summaryrefslogtreecommitdiff
path: root/stm/lib/usbd_desc.c
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-10-13 19:02:15 +0100
committerDamien <damien.p.george@gmail.com>2013-10-13 19:02:15 +0100
commitfee89d520fb02b6fb673050c9d2043e14641edf6 (patch)
tree65fc7a33667e8147c983ed9925ff9fb30d63199c /stm/lib/usbd_desc.c
parented65605edc5c1376947a34723b9c750400b5a028 (diff)
Implement crude but functional CDC + MSC USB device.
Diffstat (limited to 'stm/lib/usbd_desc.c')
-rw-r--r--stm/lib/usbd_desc.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/stm/lib/usbd_desc.c b/stm/lib/usbd_desc.c
index da68679d1..d4ada2de2 100644
--- a/stm/lib/usbd_desc.c
+++ b/stm/lib/usbd_desc.c
@@ -104,26 +104,26 @@ USBD_DEVICE USR_desc =
#endif
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
/* USB Standard Device Descriptor */
-__ALIGN_BEGIN uint8_t USBD_DeviceDesc[USB_SIZ_DEVICE_DESC] __ALIGN_END =
- {
- 0x12, /*bLength */
- USB_DEVICE_DESCRIPTOR_TYPE, /*bDescriptorType*/
- 0x00, /*bcdUSB */
+__ALIGN_BEGIN static uint8_t USBD_DeviceDesc[USB_SIZ_DEVICE_DESC] __ALIGN_END =
+{
+ 0x12, // bLength
+ USB_DEVICE_DESCRIPTOR_TYPE, // bDescriptorType
+ 0x00, // bcdUSB: v2.0
0x02,
- 0x00, /*bDeviceClass*/
- 0x00, /*bDeviceSubClass*/
- 0x00, /*bDeviceProtocol*/
- USB_OTG_MAX_EP0_SIZE, /*bMaxPacketSize*/
- LOBYTE(USBD_VID), /*idVendor*/
- HIBYTE(USBD_VID), /*idVendor*/
- LOBYTE(USBD_PID), /*idVendor*/
- HIBYTE(USBD_PID), /*idVendor*/
- 0x00, /*bcdDevice rel. 2.00*/
+ 0xef, // bDeviceClass: Miscellaneous Device Class
+ 0x02, // bDeviceSubClass: Common Class
+ 0x01, // bDeviceProtocol: Interface Association Descriptor
+ USB_OTG_MAX_EP0_SIZE, // bMaxPacketSize
+ LOBYTE(USBD_VID), // idVendor
+ HIBYTE(USBD_VID), // idVendor
+ LOBYTE(USBD_PID), // idVendor
+ HIBYTE(USBD_PID), // idVendor
+ 0x00, // bcdDevice: rel. 2.00
0x02,
USBD_IDX_MFC_STR, /*Index of manufacturer string*/
USBD_IDX_PRODUCT_STR, /*Index of product string*/
USBD_IDX_SERIAL_STR, /*Index of serial number string*/
- USBD_CFG_MAX_NUM /*bNumConfigurations*/
+ USBD_CFG_MAX_NUM // bNumConfigurations: 1
} ; /* USB_DeviceDescriptor */
#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED