From bb7b0e66a4df58e61acfe29635c871c443780524 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Sep 2011 16:52:20 +0000 Subject: Add examples/usbterm git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3976 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/stm3210e-eval/README.txt | 10 +++++++++ nuttx/configs/stm3210e-eval/usbserial/defconfig | 28 +++++++++++++++++++++++++ nuttx/drivers/usbdev/cdc_serial.c | 15 ++++++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) (limited to 'nuttx') diff --git a/nuttx/configs/stm3210e-eval/README.txt b/nuttx/configs/stm3210e-eval/README.txt index 017af14e5..3f260e9a8 100755 --- a/nuttx/configs/stm3210e-eval/README.txt +++ b/nuttx/configs/stm3210e-eval/README.txt @@ -631,6 +631,16 @@ Where is one of the following: -CONFIG_CDCSER=n +CONFIG_CDCSER=y + The example can also be converted to use the alternative + USB serial example at apps/examples/usbterm by changing the + following: + + -CONFIGURED_APPS += examples/usbserial + +CONFIGURED_APPS += examples/usbterm + + In either the original appconfig file (before configuring) + or in the final apps/.config file (after configuring). + usbstorage: ---------- This configuration directory exercises the USB mass storage diff --git a/nuttx/configs/stm3210e-eval/usbserial/defconfig b/nuttx/configs/stm3210e-eval/usbserial/defconfig index ec48e44c9..a23ef58f7 100755 --- a/nuttx/configs/stm3210e-eval/usbserial/defconfig +++ b/nuttx/configs/stm3210e-eval/usbserial/defconfig @@ -884,6 +884,34 @@ CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=n CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=n CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n +# +# Settings for examples/usbterm +# +# CONFIG_EXAMPLES_UBSTERM_BUILTIN - Build the usbterm example as an NSH +# built-in command. NOTE: This is not fully functional as of this +# writing.. It should work, but there is no mechanism in place yet +# to exit the USB terminal program and return to NSH. +# CONFIG_EXAMPLES_USBTERM_BUFLEN - The size of the input and output +# buffers used for receiving data. Default 256 bytes. +# +# If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB, or +# CONFIG_USBDEV_TRACE), then the example code will also manage the USB trace +# output. The amount of trace output can be controlled using: +# +# CONFIG_EXAMPLES_USBTERM_TRACEINIT - Show initialization events +# CONFIG_EXAMPLES_USBTERM_TRACECLASS - Show class driver events +# CONFIG_EXAMPLES_USBTERM_TRACETRANSFERS - Show data transfer events +# CONFIG_EXAMPLES_USBTERM_TRACECONTROLLER - Show controller events +# CONFIG_EXAMPLES_USBTERM_TRACEINTERRUPTS - Show interrupt-related events +# +CONFIG_EXAMPLES_UBSTERM_BUILTIN=n +CONFIG_EXAMPLES_USBTERM_BUFLEN=256 +CONFIG_EXAMPLES_USBTERM_TRACEINIT=n +CONFIG_EXAMPLES_USBTERM_TRACECLASS=n +CONFIG_EXAMPLES_USBTERM_TRACETRANSFERS=n +CONFIG_EXAMPLES_USBTERM_TRACECONTROLLER=n +CONFIG_EXAMPLES_USBTERM_TRACEINTERRUPTS=n + # # Stack and heap information # diff --git a/nuttx/drivers/usbdev/cdc_serial.c b/nuttx/drivers/usbdev/cdc_serial.c index d5d5739b2..bab4e3951 100644 --- a/nuttx/drivers/usbdev/cdc_serial.c +++ b/nuttx/drivers/usbdev/cdc_serial.c @@ -2170,7 +2170,20 @@ static int usbser_ioctl(FAR struct file *filep,int cmd,unsigned long arg) case CAIOC_NOTIFY: { /* Not yet implemented. I probably won't bother to implement until - * I com up with a usage model that needs it. + * I comr up with a usage model that needs it. + * + * Here is what the needs to be done: + * + * 1. Format and send a request header with: + * + * bmRequestType: + * USB_REQ_DIR_IN|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE + * bRequest: ACM_SERIAL_STATE + * wValue: 0 + * wIndex: 0 + * wLength: Length of data + * + * 2. Followed by the notification data (in a separate packet) */ ret = -ENOSYS; -- cgit v1.2.3