summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-16 18:42:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-16 18:42:54 +0000
commite7f67f93e598f240c9e3928936d63172ec4a1b0a (patch)
treea451821ed3a024a7c17c659e8e6da5ee44dccbe4 /nuttx
parentdd9ad586ffe578ab4176f594e0b803291bc2d443 (diff)
downloadpx4-nuttx-e7f67f93e598f240c9e3928936d63172ec4a1b0a.tar.gz
px4-nuttx-e7f67f93e598f240c9e3928936d63172ec4a1b0a.tar.bz2
px4-nuttx-e7f67f93e598f240c9e3928936d63172ec4a1b0a.zip
A little progress with CDC ACM driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3959 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html4
-rw-r--r--nuttx/configs/README.txt4
-rw-r--r--nuttx/drivers/usbdev/cdc_serial.c21
-rw-r--r--nuttx/include/nuttx/usb/cdc_serial.h10
4 files changed, 22 insertions, 17 deletions
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 6aa11bc78..9fda53426 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -4778,7 +4778,7 @@ build
<code>CONFIG_CDCSER</code>: Enable compilation of the USB serial driver
</li>
<li>
- <code>CONFIG_CDCSER_EP0MAXPACKET</code>: Endpoint 0 max packet size. Default 8.
+ <code>CONFIG_CDCSER_EP0MAXPACKET</code>: Endpoint 0 max packet size. Default 64.
</li>
<li>
<code>CONFIG_CDCSER_EPINTIN</code>: The logical 7-bit address of a hardware endpoint that supports
@@ -4788,7 +4788,7 @@ build
<code>CONFIG_CDCSER_EPINTIN_FSSIZE</code>: Max package size for the interrupt IN endpoint if full speed mode. Default 64.
</li>
<li>
- <code>CONFIG_CDCSER_EPINTIN_HSSIZE</code>: Max package size for the interrupt IN endpoint if high speed mode. Default 512.
+ <code>CONFIG_CDCSER_EPINTIN_HSSIZE</code>: Max package size for the interrupt IN endpoint if high speed mode. Default 64.
</li>
<li>
<code>CONFIG_CDCSER_EPBULKOUT</code>: The logical 7-bit address of a hardware endpoint that supports
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index b50592b81..8958ee874 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -949,7 +949,7 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_CDCSER
Enable compilation of the USB serial driver
CONFIG_CDCSER_EP0MAXPACKET
- Endpoint 0 max packet size. Default 8.
+ Endpoint 0 max packet size. Default 64.
CONFIG_CDCSER_EPINTIN
The logical 7-bit address of a hardware endpoint that supports
interrupt IN operation. Default 2.
@@ -958,7 +958,7 @@ defconfig -- This is a configuration file similar to the Linux
Default 64.
CONFIG_CDCSER_EPINTIN_HSSIZE
Max package size for the interrupt IN endpoint if high speed mode.
- Default 512.
+ Default 64.
CONFIG_CDCSER_EPBULKOUT
The logical 7-bit address of a hardware endpoint that supports
bulk OUT operation
diff --git a/nuttx/drivers/usbdev/cdc_serial.c b/nuttx/drivers/usbdev/cdc_serial.c
index 693cdc4bf..d5d5739b2 100644
--- a/nuttx/drivers/usbdev/cdc_serial.c
+++ b/nuttx/drivers/usbdev/cdc_serial.c
@@ -67,14 +67,14 @@
/* Descriptors ****************************************************************/
/* These settings are not modifiable via the NuttX configuration */
-#define CDC_VERSIONNO 0x010a /* CDC version number 1.10 */
+#define CDC_VERSIONNO 0x0110 /* CDC version number 1.10 (BCD) */
#define CDCSER_CONFIGIDNONE (0) /* Config ID means to return to address mode */
#define CDCSER_INTERFACEID (0)
#define CDCSER_ALTINTERFACEID (0)
/* Device descriptor values */
-#define CDCSER_VERSIONNO (0x0101) /* Device version number 1.1 */
+#define CDCSER_VERSIONNO (0x0101) /* Device version number 1.1 (BCD) */
#define CDCSER_NCONFIGS (1) /* Number of configurations supported */
/* Configuration descriptor values */
@@ -330,17 +330,23 @@ static const struct usb_devdesc_s g_devdesc =
{
USB_SIZEOF_DEVDESC, /* len */
USB_DESC_TYPE_DEVICE, /* type */
- {LSBYTE(0x0200), MSBYTE(0x0200)}, /* usb */
+ { /* usb */
+ LSBYTE(0x0200),
+ MSBYTE(0x0200)
+ },
USB_CLASS_CDC, /* class */
CDC_SUBCLASS_NONE, /* subclass */
CDC_PROTO_NONE, /* protocol */
CONFIG_CDCSER_EP0MAXPACKET, /* maxpacketsize */
{ LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */
- MSBYTE(CONFIG_CDCSER_VENDORID) },
+ MSBYTE(CONFIG_CDCSER_VENDORID)
+ },
{ LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */
- MSBYTE(CONFIG_CDCSER_PRODUCTID) },
+ MSBYTE(CONFIG_CDCSER_PRODUCTID)
+ },
{ LSBYTE(CDCSER_VERSIONNO), /* device */
- MSBYTE(CDCSER_VERSIONNO) },
+ MSBYTE(CDCSER_VERSIONNO)
+ },
CDCSER_MANUFACTURERSTRID, /* imfgr */
CDCSER_PRODUCTSTRID, /* iproduct */
CDCSER_SERIALSTRID, /* serno */
@@ -458,7 +464,7 @@ static const struct usb_epdesc_s g_epbulkoutdesc =
USB_SIZEOF_EPDESC, /* len */
USB_DESC_TYPE_ENDPOINT, /* type */
CDCSER_EPOUTBULK_ADDR, /* addr */
- CDCSER_EPINTIN_ATTR, /* attr */
+ CDCSER_EPOUTBULK_ATTR, /* attr */
{
LSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE)
@@ -1926,7 +1932,6 @@ static int usbclass_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s *
usbclass_ep0incomplete(dev->ep0, ctrlreq);
}
}
-
return ret;
}
diff --git a/nuttx/include/nuttx/usb/cdc_serial.h b/nuttx/include/nuttx/usb/cdc_serial.h
index 72410a22d..92ae62b20 100644
--- a/nuttx/include/nuttx/usb/cdc_serial.h
+++ b/nuttx/include/nuttx/usb/cdc_serial.h
@@ -51,7 +51,7 @@
/* CONFIG_CDCSER
* Enable compilation of the USB serial driver
* CONFIG_CDCSER_EP0MAXPACKET
- * Endpoint 0 max packet size. Default 8.
+ * Endpoint 0 max packet size. Default 64.
* CONFIG_CDCSER_EPINTIN
* The logical 7-bit address of a hardware endpoint that supports
* interrupt IN operation. Default 2.
@@ -60,7 +60,7 @@
* Default 64.
* CONFIG_CDCSER_EPINTIN_HSSIZE
* Max package size for the interrupt IN endpoint if high speed mode.
- * Default 512.
+ * Default 64.
* CONFIG_CDCSER_EPBULKOUT
* The logical 7-bit address of a hardware endpoint that supports
* bulk OUT operation
@@ -94,7 +94,7 @@
/* EP0 max packet size */
#ifndef CONFIG_CDCSER_EP0MAXPACKET
-# define CONFIG_CDCSER_EP0MAXPACKET 8
+# define CONFIG_CDCSER_EP0MAXPACKET 64
#endif
/* Endpoint number and size (in bytes) of the CDC serial device-to-host (IN)
@@ -106,11 +106,11 @@
#endif
#ifndef CONFIG_CDCSER_EPINTIN_FSSIZE
-# define CONFIG_CDCSER_EPINTIN_FSSIZE 8
+# define CONFIG_CDCSER_EPINTIN_FSSIZE 64
#endif
#ifndef CONFIG_CDCSER_EPINTIN_HSSIZE
-# define CONFIG_CDCSER_EPINTIN_HSSIZE 8
+# define CONFIG_CDCSER_EPINTIN_HSSIZE 64
#endif
/* Endpoint number and size (in bytes) of the CDC device-to-host (IN) data