diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-08-04 16:54:07 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-08-04 18:43:45 -0400 |
commit | ebf132af79c2acca2d88d5bfca998102279f2c57 (patch) | |
tree | f8e0151fafed1a1363f108fac2def94ca7fec055 /libmaple/include | |
parent | 88f81ac8622507de75b9c4a6b504d472c4844bac (diff) | |
download | librambutan-ebf132af79c2acca2d88d5bfca998102279f2c57.tar.gz librambutan-ebf132af79c2acca2d88d5bfca998102279f2c57.zip |
Prep usb_descriptors.h for removal.
Just change names and things to fit the libmaple style. Its contents
will move to the top-level <libmaple/usb.h> 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 <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/include')
-rw-r--r-- | libmaple/include/libmaple/usb_cdcacm.h | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ -53,6 +53,25 @@ extern "C" { #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 */ |