summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html30
-rw-r--r--nuttx/configs/README.txt19
-rw-r--r--nuttx/configs/mcu123-lpc214x/nsh/defconfig16
-rw-r--r--nuttx/configs/mcu123-lpc214x/ostest/defconfig18
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbserial/defconfig18
-rw-r--r--nuttx/configs/ntosd-dm320/nettest/defconfig16
-rw-r--r--nuttx/configs/ntosd-dm320/nsh/defconfig16
-rw-r--r--nuttx/configs/ntosd-dm320/ostest/defconfig16
-rw-r--r--nuttx/configs/ntosd-dm320/udp/defconfig16
-rw-r--r--nuttx/configs/ntosd-dm320/uip/defconfig16
-rw-r--r--nuttx/drivers/usbdev/usbdev_serial.c29
11 files changed, 164 insertions, 46 deletions
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 56c56d53d..091afedba 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -16,7 +16,7 @@
</b></big></h1>
<p><small>by</small></p>
<p>Gregory Nutt</p>
- <p><small>Last Update: October 1, 2008</small></p>
+ <p><small>Last Update: October 9, 2008</small></p>
</center>
<center><h1>Table of Contents</h1></center>
@@ -1627,7 +1627,8 @@ The system can be re-made subsequently by just typing <code>make</code>.
</li>
</ul>
-<h2>USB device controller driver</h2>
+<h2>USB Device-Side Support</h2>
+<h3>USB Device Controller Driver</h3>
<ul>
<li>
<code>CONFIG_USBDEV</code>: Enables USB device support
@@ -1652,6 +1653,31 @@ The system can be re-made subsequently by just typing <code>make</code>.
</li>
</ul>
+<h3>USB Serial Device Class Driver</h3>
+<ul>
+ <li>
+ <code>CONFIG_USBSER_EPINTIN</code>: The logical 7-bit address of a hardware endpoint that supports interrupt IN operation
+ </li>
+ <li>
+ <code>CONFIG_USBSER_EPBULKOUT</code>: The logical 7-bit address of a hardware endpoint that supports bulk OUT operation
+ </li>
+ <li>
+ <code>CONFIG_USBSER_EPBULKIN</code>: The logical 7-bit address of a hardware endpoint that supports bulk IN operation
+ </li>
+ <li>
+ <code>CONFIG_USBSER_NWRREQS</code> and <code>CONFIG_USBSER_NRDREQS</code>: The number of write/read requests that can be in flight
+ </li>
+ <li>
+ <code>CONFIG_USBSER_VENDORID</code> and <code>CONFIG_USBSER_VENDORSTR</code>: The vendor ID code/string
+ </li>
+ <li>
+ <code>CONFIG_USBSER_PRODUCTID</code> and <code>CONFIG_USBSER_PRODUCTSTR</code>: The product ID code/string
+ </li>
+ <li>
+ <code>CONFIG_USBSER_RXBUFSIZE</code> and <code>CONFIG_USBSER_TXBUFSIZE</code>: Size of the serial receive/transmit buffers
+ </li>
+</ul>
+
<h2>Stack and heap information</h2>
<ul>
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index c7f557d65..1b81cfb10 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -302,6 +302,25 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_USBDEV_TRACE - Enables USB tracing for debug
CONFIG_USBDEV_TRACE_NRECORDS - Number of trace entries to remember
+ USB serial device class driver
+ CONFIG_USBSER_EPINTIN
+ The logical 7-bit address of a hardware endpoint that supports
+ interrupt IN operation
+ CONFIG_USBSER_EPBULKOUT
+ The logical 7-bit address of a hardware endpoint that supports
+ bulk OUT operation
+ CONFIG_USBSER_EPBULKIN
+ The logical 7-bit address of a hardware endpoint that supports
+ bulk IN operation
+ CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
+ The number of write/read requests that can be in flight
+ CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
+ The vendor ID code/string
+ CONFIG_USBSER_PRODUCTID and CONFIG_USBSER_PRODUCTSTR
+ The product ID code/string
+ CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
+ Size of the serial receive/transmit buffers
+
Stack and heap information
CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/nuttx/configs/mcu123-lpc214x/nsh/defconfig b/nuttx/configs/mcu123-lpc214x/nsh/defconfig
index 266577649..11a9b1acc 100644
--- a/nuttx/configs/mcu123-lpc214x/nsh/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/nsh/defconfig
@@ -384,8 +384,15 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -394,8 +401,9 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=1
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=5
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/mcu123-lpc214x/ostest/defconfig b/nuttx/configs/mcu123-lpc214x/ostest/defconfig
index f0fe2f49a..3dfac1fb5 100644
--- a/nuttx/configs/mcu123-lpc214x/ostest/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/ostest/defconfig
@@ -384,9 +384,16 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
-# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
+# # CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
# The vendor ID code/string
@@ -394,8 +401,9 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=1
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=5
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
index df434376b..a93bf6e96 100644
--- a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
@@ -385,9 +385,16 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
-# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
+# # CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
# The vendor ID code/string
@@ -395,8 +402,9 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=1
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=5
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/ntosd-dm320/nettest/defconfig b/nuttx/configs/ntosd-dm320/nettest/defconfig
index 934b6d6d8..e94fed2d1 100644
--- a/nuttx/configs/ntosd-dm320/nettest/defconfig
+++ b/nuttx/configs/ntosd-dm320/nettest/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/ntosd-dm320/nsh/defconfig b/nuttx/configs/ntosd-dm320/nsh/defconfig
index bfe69b341..f1188ff87 100644
--- a/nuttx/configs/ntosd-dm320/nsh/defconfig
+++ b/nuttx/configs/ntosd-dm320/nsh/defconfig
@@ -369,8 +369,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -379,8 +386,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/ntosd-dm320/ostest/defconfig b/nuttx/configs/ntosd-dm320/ostest/defconfig
index b50367d0d..701a3ae50 100644
--- a/nuttx/configs/ntosd-dm320/ostest/defconfig
+++ b/nuttx/configs/ntosd-dm320/ostest/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/ntosd-dm320/udp/defconfig b/nuttx/configs/ntosd-dm320/udp/defconfig
index d90659a4d..1e93eda46 100644
--- a/nuttx/configs/ntosd-dm320/udp/defconfig
+++ b/nuttx/configs/ntosd-dm320/udp/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/configs/ntosd-dm320/uip/defconfig b/nuttx/configs/ntosd-dm320/uip/defconfig
index b69b86749..c3b7fc421 100644
--- a/nuttx/configs/ntosd-dm320/uip/defconfig
+++ b/nuttx/configs/ntosd-dm320/uip/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/nuttx/drivers/usbdev/usbdev_serial.c b/nuttx/drivers/usbdev/usbdev_serial.c
index 8a3e6ca35..b24b95db6 100644
--- a/nuttx/drivers/usbdev/usbdev_serial.c
+++ b/nuttx/drivers/usbdev/usbdev_serial.c
@@ -83,12 +83,19 @@
/* Logical endpoint numbers / max packet sizes */
-#ifndef CONFIG_USBSER_EPIN
-# define CONFIG_USBSER_EPIN 2
+#ifndef CONFIG_USBSER_EPINTIN
+# warning "EPINTIN not defined in the configuration"
+# define CONFIG_USBSER_EPINTIN 1
#endif
-#ifndef CONFIG_USBSER_EPOUT
-# define CONFIG_USBSER_EPOUT 1
+#ifndef CONFIG_USBSER_EPBULKOUT
+# warning "EPBULKOUT not defined in the configuration"
+# define CONFIG_USBSER_EPBULKOUT 2
+#endif
+
+#ifndef CONFIG_USBSER_EPBULKIN
+# warning "EPBULKIN not defined in the configuration"
+# define CONFIG_USBSER_EPBULKIN 3
#endif
#ifndef CONFIG_USBSER_EP0MAXPACKET
@@ -148,12 +155,14 @@
/* Endpoint configuration */
-#define USBSER_EPINTIN_ADDR (USB_DIR_IN|1)
+#define USBSER_EPINTIN_ADDR (USB_DIR_IN|CONFIG_USBSER_EPINTIN)
#define USBSER_EPINTIN_ATTR (USB_EP_ATTR_XFER_INT)
#define USBSER_EPINTIN_MXPACKET (10)
-#define USBSER_EPOUTBULK_ADDR (2)
+
+#define USBSER_EPOUTBULK_ADDR (CONFIG_USBSER_EPBULKOUT)
#define USBSER_EPOUTBULK_ATTR (USB_EP_ATTR_XFER_BULK)
-#define USBSER_EPINBULK_ADDR (USB_DIR_IN|3)
+
+#define USBSER_EPINBULK_ADDR (USB_DIR_IN|CONFIG_USBSER_EPBULKIN)
#define USBSER_EPINBULK_ATTR (USB_EP_ATTR_XFER_BULK)
/* Vender specific control requests */
@@ -1210,7 +1219,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
/* Pre-allocate the IN interrupt endpoint */
- priv->epintin = DEV_ALLOCEP(dev, 0, TRUE, USB_EP_ATTR_XFER_INT);
+ priv->epintin = DEV_ALLOCEP(dev, USBSER_EPINTIN_ADDR, TRUE, USB_EP_ATTR_XFER_INT);
if (!priv->epintin)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPINTINALLOCFAIL), 0);
@@ -1221,7 +1230,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
/* Pre-allocate the IN bulk endpoint */
- priv->epbulkin = DEV_ALLOCEP(dev, 0, TRUE, USB_EP_ATTR_XFER_BULK);
+ priv->epbulkin = DEV_ALLOCEP(dev, USBSER_EPINBULK_ADDR, TRUE, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkin)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPBULKINALLOCFAIL), 0);
@@ -1232,7 +1241,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
/* Pre-allocate the OUT bulk endpoint */
- priv->epbulkout = DEV_ALLOCEP(dev, 0, FALSE, USB_EP_ATTR_XFER_BULK);
+ priv->epbulkout = DEV_ALLOCEP(dev, USBSER_EPOUTBULK_ADDR, FALSE, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkout)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPBULKOUTALLOCFAIL), 0);