From ebf132af79c2acca2d88d5bfca998102279f2c57 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Sat, 4 Aug 2012 16:54:07 -0400 Subject: Prep usb_descriptors.h for removal. Just change names and things to fit the libmaple style. Its contents will move to the top-level header next. This API is still unstable, but we need to expose pieces of it in order to get the Maple-specific pieces of usb_cdcacm.c into Wirish. Adjust uses of the API appropriately. Signed-off-by: Marti Bolivar --- libmaple/include/libmaple/usb_cdcacm.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libmaple/include') diff --git a/libmaple/include/libmaple/usb_cdcacm.h b/libmaple/include/libmaple/usb_cdcacm.h index 6649854..1c46b56 100644 --- a/libmaple/include/libmaple/usb_cdcacm.h +++ b/libmaple/include/libmaple/usb_cdcacm.h @@ -52,6 +52,25 @@ extern "C" { #define USB_CDCACM_CONTROL_LINE_DTR (0x01) #define USB_CDCACM_CONTROL_LINE_RTS (0x02) +/* + * Descriptors, etc. + */ + +#define CDC_FUNCTIONAL_DESCRIPTOR_SIZE(DataSize) (3 + DataSize) +#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \ + struct { \ + uint8 bLength; \ + uint8 bDescriptorType; \ + uint8 SubType; \ + uint8 Data[DataSize]; \ + } __packed + +#define USB_DEVICE_CLASS_CDC 0x02 +#define USB_DEVICE_SUBCLASS_CDC 0x00 +#define USB_INTERFACE_CLASS_CDC 0x02 +#define USB_INTERFACE_SUBCLASS_CDC_ACM 0x02 +#define USB_INTERFACE_CLASS_DIC 0x0A + /* * CDC ACM interface */ -- cgit v1.2.3