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
This commit is contained in:
patacongo
2011-09-16 18:42:54 +00:00
parent 48e30073db
commit a961af1303
4 changed files with 22 additions and 17 deletions
+2 -2
View File
@@ -4778,7 +4778,7 @@ build
<code>CONFIG_CDCSER</code>: Enable compilation of the USB serial driver <code>CONFIG_CDCSER</code>: Enable compilation of the USB serial driver
</li> </li>
<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>
<li> <li>
<code>CONFIG_CDCSER_EPINTIN</code>: The logical 7-bit address of a hardware endpoint that supports <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. <code>CONFIG_CDCSER_EPINTIN_FSSIZE</code>: Max package size for the interrupt IN endpoint if full speed mode. Default 64.
</li> </li>
<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>
<li> <li>
<code>CONFIG_CDCSER_EPBULKOUT</code>: The logical 7-bit address of a hardware endpoint that supports <code>CONFIG_CDCSER_EPBULKOUT</code>: The logical 7-bit address of a hardware endpoint that supports
+2 -2
View File
@@ -949,7 +949,7 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_CDCSER CONFIG_CDCSER
Enable compilation of the USB serial driver Enable compilation of the USB serial driver
CONFIG_CDCSER_EP0MAXPACKET CONFIG_CDCSER_EP0MAXPACKET
Endpoint 0 max packet size. Default 8. Endpoint 0 max packet size. Default 64.
CONFIG_CDCSER_EPINTIN CONFIG_CDCSER_EPINTIN
The logical 7-bit address of a hardware endpoint that supports The logical 7-bit address of a hardware endpoint that supports
interrupt IN operation. Default 2. interrupt IN operation. Default 2.
@@ -958,7 +958,7 @@ defconfig -- This is a configuration file similar to the Linux
Default 64. Default 64.
CONFIG_CDCSER_EPINTIN_HSSIZE CONFIG_CDCSER_EPINTIN_HSSIZE
Max package size for the interrupt IN endpoint if high speed mode. Max package size for the interrupt IN endpoint if high speed mode.
Default 512. Default 64.
CONFIG_CDCSER_EPBULKOUT CONFIG_CDCSER_EPBULKOUT
The logical 7-bit address of a hardware endpoint that supports The logical 7-bit address of a hardware endpoint that supports
bulk OUT operation bulk OUT operation
+13 -8
View File
@@ -67,14 +67,14 @@
/* Descriptors ****************************************************************/ /* Descriptors ****************************************************************/
/* These settings are not modifiable via the NuttX configuration */ /* 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_CONFIGIDNONE (0) /* Config ID means to return to address mode */
#define CDCSER_INTERFACEID (0) #define CDCSER_INTERFACEID (0)
#define CDCSER_ALTINTERFACEID (0) #define CDCSER_ALTINTERFACEID (0)
/* Device descriptor values */ /* 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 */ #define CDCSER_NCONFIGS (1) /* Number of configurations supported */
/* Configuration descriptor values */ /* Configuration descriptor values */
@@ -330,17 +330,23 @@ static const struct usb_devdesc_s g_devdesc =
{ {
USB_SIZEOF_DEVDESC, /* len */ USB_SIZEOF_DEVDESC, /* len */
USB_DESC_TYPE_DEVICE, /* type */ USB_DESC_TYPE_DEVICE, /* type */
{LSBYTE(0x0200), MSBYTE(0x0200)}, /* usb */ { /* usb */
LSBYTE(0x0200),
MSBYTE(0x0200)
},
USB_CLASS_CDC, /* class */ USB_CLASS_CDC, /* class */
CDC_SUBCLASS_NONE, /* subclass */ CDC_SUBCLASS_NONE, /* subclass */
CDC_PROTO_NONE, /* protocol */ CDC_PROTO_NONE, /* protocol */
CONFIG_CDCSER_EP0MAXPACKET, /* maxpacketsize */ CONFIG_CDCSER_EP0MAXPACKET, /* maxpacketsize */
{ LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */ { LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */
MSBYTE(CONFIG_CDCSER_VENDORID) }, MSBYTE(CONFIG_CDCSER_VENDORID)
},
{ LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */ { LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */
MSBYTE(CONFIG_CDCSER_PRODUCTID) }, MSBYTE(CONFIG_CDCSER_PRODUCTID)
},
{ LSBYTE(CDCSER_VERSIONNO), /* device */ { LSBYTE(CDCSER_VERSIONNO), /* device */
MSBYTE(CDCSER_VERSIONNO) }, MSBYTE(CDCSER_VERSIONNO)
},
CDCSER_MANUFACTURERSTRID, /* imfgr */ CDCSER_MANUFACTURERSTRID, /* imfgr */
CDCSER_PRODUCTSTRID, /* iproduct */ CDCSER_PRODUCTSTRID, /* iproduct */
CDCSER_SERIALSTRID, /* serno */ CDCSER_SERIALSTRID, /* serno */
@@ -458,7 +464,7 @@ static const struct usb_epdesc_s g_epbulkoutdesc =
USB_SIZEOF_EPDESC, /* len */ USB_SIZEOF_EPDESC, /* len */
USB_DESC_TYPE_ENDPOINT, /* type */ USB_DESC_TYPE_ENDPOINT, /* type */
CDCSER_EPOUTBULK_ADDR, /* addr */ CDCSER_EPOUTBULK_ADDR, /* addr */
CDCSER_EPINTIN_ATTR, /* attr */ CDCSER_EPOUTBULK_ATTR, /* attr */
{ {
LSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE), /* maxpacket (full speed) */ LSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE) 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); usbclass_ep0incomplete(dev->ep0, ctrlreq);
} }
} }
return ret; return ret;
} }
+5 -5
View File
@@ -51,7 +51,7 @@
/* CONFIG_CDCSER /* CONFIG_CDCSER
* Enable compilation of the USB serial driver * Enable compilation of the USB serial driver
* CONFIG_CDCSER_EP0MAXPACKET * CONFIG_CDCSER_EP0MAXPACKET
* Endpoint 0 max packet size. Default 8. * Endpoint 0 max packet size. Default 64.
* CONFIG_CDCSER_EPINTIN * CONFIG_CDCSER_EPINTIN
* The logical 7-bit address of a hardware endpoint that supports * The logical 7-bit address of a hardware endpoint that supports
* interrupt IN operation. Default 2. * interrupt IN operation. Default 2.
@@ -60,7 +60,7 @@
* Default 64. * Default 64.
* CONFIG_CDCSER_EPINTIN_HSSIZE * CONFIG_CDCSER_EPINTIN_HSSIZE
* Max package size for the interrupt IN endpoint if high speed mode. * Max package size for the interrupt IN endpoint if high speed mode.
* Default 512. * Default 64.
* CONFIG_CDCSER_EPBULKOUT * CONFIG_CDCSER_EPBULKOUT
* The logical 7-bit address of a hardware endpoint that supports * The logical 7-bit address of a hardware endpoint that supports
* bulk OUT operation * bulk OUT operation
@@ -94,7 +94,7 @@
/* EP0 max packet size */ /* EP0 max packet size */
#ifndef CONFIG_CDCSER_EP0MAXPACKET #ifndef CONFIG_CDCSER_EP0MAXPACKET
# define CONFIG_CDCSER_EP0MAXPACKET 8 # define CONFIG_CDCSER_EP0MAXPACKET 64
#endif #endif
/* Endpoint number and size (in bytes) of the CDC serial device-to-host (IN) /* Endpoint number and size (in bytes) of the CDC serial device-to-host (IN)
@@ -106,11 +106,11 @@
#endif #endif
#ifndef CONFIG_CDCSER_EPINTIN_FSSIZE #ifndef CONFIG_CDCSER_EPINTIN_FSSIZE
# define CONFIG_CDCSER_EPINTIN_FSSIZE 8 # define CONFIG_CDCSER_EPINTIN_FSSIZE 64
#endif #endif
#ifndef CONFIG_CDCSER_EPINTIN_HSSIZE #ifndef CONFIG_CDCSER_EPINTIN_HSSIZE
# define CONFIG_CDCSER_EPINTIN_HSSIZE 8 # define CONFIG_CDCSER_EPINTIN_HSSIZE 64
#endif #endif
/* Endpoint number and size (in bytes) of the CDC device-to-host (IN) data /* Endpoint number and size (in bytes) of the CDC device-to-host (IN) data