aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb/descriptors.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-09-23 17:56:24 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-10-18 13:30:18 -0400
commitbbcbf65fd7d074268f4e25ae014965bceb995b79 (patch)
treed027563c1d4b860d3e77119ee26f75943ced80a2 /libmaple/usb/descriptors.h
parent2e392bbf59c4c746714d71c99757f02da4c57179 (diff)
downloadlibrambutan-bbcbf65fd7d074268f4e25ae014965bceb995b79.tar.gz
librambutan-bbcbf65fd7d074268f4e25ae014965bceb995b79.zip
usb: Disentangle CDC ACM functionality.
Add new usb_cdcacm.h, which provides the virtual serial port API. This file (and new usb_cdcacm.c) consolidate the VCOM support, which was previously distributed through descriptors.[hc], usb.[hc], usb_callbacks.[hc], and usb_config.h. Add usb_init_usblib() to usb.h, as a way of initializing the USB peripheral in terms of the data structures required by usb_lib. This is used by the new usb_cdcacm_enable(). Create new usb_lib_globals.h, with declarations for the usb_lib global state which is most used throughout the rest of the libmaple USB stack. Remove descriptors.c and usb_callbacks.[hc]; they are no longer necessary. Update the USB README accordingly. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb/descriptors.h')
-rw-r--r--libmaple/usb/descriptors.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/libmaple/usb/descriptors.h b/libmaple/usb/descriptors.h
index 77ff3bb..06d9ce7 100644
--- a/libmaple/usb/descriptors.h
+++ b/libmaple/usb/descriptors.h
@@ -25,7 +25,6 @@
#ifndef __DESCRIPTORS_H
#define __DESCRIPTORS_H
-
#include "libmaple.h"
#define USB_DESCRIPTOR_TYPE_DEVICE 0x01
@@ -52,7 +51,6 @@
#define USB_DESCRIPTOR_STRING_LEN(x) (2 + (x << 1))
-
#if defined(__cplusplus)
extern "C" {
#endif
@@ -74,7 +72,6 @@ extern "C" {
uint8 Data[DataSize]; \
} __packed
-/* See http://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors */
typedef struct {
uint8 bLength;
uint8 bDescriptorType;
@@ -92,7 +89,6 @@ typedef struct {
uint8 bNumConfigurations;
} __packed USB_Descriptor_Device;
-/* http://www.beyondlogic.org/usbnutshell/usb5.shtml#ConfigurationDescriptors */
typedef struct {
uint8 bLength;
uint8 bDescriptorType;
@@ -104,7 +100,6 @@ typedef struct {
uint8 bMaxPower;
} __packed USB_Descriptor_Config_Header;
-/* See http://www.beyondlogic.org/usbnutshell/usb5.shtml#InterfaceDescriptors */
typedef struct {
uint8 bLength;
uint8 bDescriptorType;
@@ -154,7 +149,7 @@ extern const uint8 usbVcomDescriptor_iManufacturer[USB_DESCRIPTOR_STRING_LEN(8)]
extern const uint8 usbVcomDescriptor_iProduct[USB_DESCRIPTOR_STRING_LEN(8)];
#if defined(__cplusplus)
- }
+}
#endif
#endif // __DESCRIPTORS_H