Add CDC ACM serial class device driver

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3953 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-09-13 19:04:13 +00:00
parent 6fc0c99569
commit a96e7ec9d5
13 changed files with 1431 additions and 1141 deletions
+869 -868
View File
File diff suppressed because it is too large Load Diff
+29 -11
View File
@@ -61,32 +61,46 @@
# define CONFIG_CDCSER_EPINTIN 2
#endif
#ifndef CONFIG_CDCSER_EPINTIN_SIZE
# define CONFIG_CDCSER_EPINTIN_SIZE 8
#ifndef CONFIG_CDCSER_EPINTIN_FSSIZE
# define CONFIG_CDCSER_EPINTIN_FSSIZE 8
#endif
#ifndef CONFIG_CDCSER_EPINTIN_HSSIZE
# define CONFIG_CDCSER_EPINTIN_HSSIZE 8
#endif
/* Endpoint number and size (in bytes) of the CDC device-to-host (IN) data
* bulk endpoint
* bulk endpoint. NOTE that difference sizes may be selected for full (FS)
* or high speed (HS) modes.
*/
#ifndef CONFIG_CDCSER_EPBULKIN
# define CONFIG_CDCSER_EPBULKIN 3
#endif
#ifndef CONFIG_CDCSER_EPBULKIN_SIZE
# define CONFIG_CDCSER_EPBULKIN_SIZE 16
#ifndef CONFIG_CDCSER_EPBULKIN_FSSIZE
# define CONFIG_CDCSER_EPBULKIN_FSSIZE 64
#endif
#ifndef CONFIG_CDCSER_EPBULKIN_HSSIZE
# define CONFIG_CDCSER_EPBULKIN_HSSIZE 512
#endif
/* Endpoint number and size (in bytes) of the CDC host-to-device (OUT) data
* bulk endpoint
* bulk endpoint. NOTE that difference sizes may be selected for full (FS)
* or high speed (HS) modes.
*/
#ifndef CONFIG_CDCSER_EPBULKOUT
# define CONFIG_CDCSER_EPBULKOUT 4
#endif
#ifndef CONFIG_CDCSER_EPBULKOUT_SIZE
# define CONFIG_CDCSER_EPBULKOUT_SIZE 16
#ifndef CONFIG_CDCSER_EPBULKOUT_FSSIZE
# define CONFIG_CDCSER_EPBULKOUT_FSSIZE 64
#endif
#ifndef CONFIG_CDCSER_EPBULKOUT_HSSIZE
# define CONFIG_CDCSER_EPBULKOUT_HSSIZE 512
#endif
/* Number of requests in the write queue */
@@ -101,10 +115,14 @@
# define CONFIG_CDCSER_NRDREQS 4
#endif
/* Write buffer size */
/* TX/RX buffer sizes */
#ifndef CONFIG_CDCSER_WRBUFFERSIZE
# define CONFIG_CDCSER_WRBUFFERSIZE 1024
#ifndef CONFIG_CDCSER_RXBUFSIZE
# define CONFIG_CDCSER_RXBUFSIZE 256
#endif
#ifndef CONFIG_CDCSER_TXBUFSIZE
# define CONFIG_CDCSER_TXBUFSIZE 256
#endif
/* Vendor and product IDs and strings */
+13 -11
View File
@@ -72,19 +72,21 @@
/* Control Setup Packet. Byte 0=Request */
#define USB_REQ_DIR_IN (0x80) /* Bit 7=1: IN */
#define USB_REQ_DIR_OUT (0x00) /* Bit 7=0: OUT */
#define USB_REQ_DIR_IN (1 << 7) /* Bit 7=1: IN */
#define USB_REQ_DIR_OUT (0 << 7) /* Bit 7=0: OUT */
#define USB_REQ_TYPE_MASK (0x60) /* Bits 5:6: Request type */
#define USB_REQ_TYPE_STANDARD (0x00)
#define USB_REQ_TYPE_CLASS (0x20)
#define USB_REQ_TYPE_VENDOR (0x40)
#define USB_REQ_TYPE_SHIFT (5) /* Bits 5:6: Request type */
# define USB_REQ_TYPE_MASK (3 << USB_REQ_TYPE_SHIFT)
# define USB_REQ_TYPE_STANDARD (0 << USB_REQ_TYPE_SHIFT)
# define USB_REQ_TYPE_CLASS (1 << USB_REQ_TYPE_SHIFT)
# define USB_REQ_TYPE_VENDOR (2 << USB_REQ_TYPE_SHIFT)
#define USB_REQ_RECIPIENT_MASK (0x1f) /* Bits 0:4: Recipient */
#define USB_REQ_RECIPIENT_DEVICE (0x00)
#define USB_REQ_RECIPIENT_INTERFACE (0x01)
#define USB_REQ_RECIPIENT_ENDPOINT (0x02)
#define USB_REQ_RECIPIENT_OTHER (0x03)
#define USB_REQ_RECIPIENT_SHIFT (0) /* Bits 0:4: Recipient */
#define USB_REQ_RECIPIENT_MASK (0x1f << USB_REQ_RECIPIENT_SHIFT)
# define USB_REQ_RECIPIENT_DEVICE (0 << USB_REQ_RECIPIENT_SHIFT)
# define USB_REQ_RECIPIENT_INTERFACE (1 << USB_REQ_RECIPIENT_SHIFT)
# define USB_REQ_RECIPIENT_ENDPOINT (2 << USB_REQ_RECIPIENT_SHIFT)
# define USB_REQ_RECIPIENT_OTHER (3 << USB_REQ_RECIPIENT_SHIFT)
/* Control Setup Packet. Byte 1=Standard Request Codes */
+1 -1
View File
@@ -216,7 +216,7 @@
#define USBSER_TRACEERR_SUBMITFAIL 0x001a
#define USBSER_TRACEERR_UARTREGISTER 0x001b
#define USBSER_TRACEERR_UNSUPPORTEDCTRLREQ 0x001c
#define USBSER_TRACEERR_UNSUPPORTEDRWREQ 0x001d
#define USBSER_TRACEERR_UNSUPPORTEDCLASSREQ 0x001d
#define USBSER_TRACEERR_UNSUPPORTEDSTDREQ 0x001e
#define USBSER_TRACEERR_UNSUPPORTEDTYPE 0x001f
#define USBSER_TRACEERR_WRALLOCREQ 0x0020