From bbcbf65fd7d074268f4e25ae014965bceb995b79 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 23 Sep 2011 17:56:24 -0400 Subject: 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 --- libmaple/usb/descriptors.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'libmaple/usb/descriptors.h') 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 -- cgit v1.2.3