diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-28 18:14:55 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-28 18:14:55 +0000 |
commit | 6875348aa9e7edca7e3404cf25135ded052cde5c (patch) | |
tree | 299af02425127a965549141a2b9155d43e99e52a /nuttx/include/nuttx | |
parent | 933dda93fc98d3cfd445371c9ea29363ce26f085 (diff) | |
download | px4-nuttx-6875348aa9e7edca7e3404cf25135ded052cde5c.tar.gz px4-nuttx-6875348aa9e7edca7e3404cf25135ded052cde5c.tar.bz2 px4-nuttx-6875348aa9e7edca7e3404cf25135ded052cde5c.zip |
Extend CDC/ACM driver so that can be connected/disconnected under software control; Add new NSH commands sercon and serdis that will connect and disconnect the CDC/ACM serial device
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4436 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/nuttx')
-rw-r--r-- | nuttx/include/nuttx/usb/cdcacm.h | 25 | ||||
-rw-r--r-- | nuttx/include/nuttx/usb/usbdev_trace.h | 15 |
2 files changed, 28 insertions, 12 deletions
diff --git a/nuttx/include/nuttx/usb/cdcacm.h b/nuttx/include/nuttx/usb/cdcacm.h index 012bc55db..1c27f731f 100644 --- a/nuttx/include/nuttx/usb/cdcacm.h +++ b/nuttx/include/nuttx/usb/cdcacm.h @@ -344,7 +344,7 @@ EXTERN void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev); * * Input Parameter: * minor - Device minor number. E.g., minor 0 would correspond to - * /dev/ttyUSB0. + * /dev/ttyACM0. * classdev - The location to return the CDC serial class' device * instance. * @@ -364,7 +364,10 @@ int cdcacm_classobject(int minor, FAR struct usbdevclass_driver_s **classdev); * Register USB serial port (and USB serial console if so configured). * * Input Parameter: - * Device minor number. E.g., minor 0 would correspond to /dev/ttyUSB0. + * minor - Device minor number. E.g., minor 0 would correspond to + * /dev/ttyACM0. + * handle - An optional opaque reference to the CDC/ACM class object that + * may subsequently be used with cdcacm_uninitialize(). * * Returned Value: * Zero (OK) means that the driver was successfully registered. On any @@ -373,17 +376,27 @@ int cdcacm_classobject(int minor, FAR struct usbdevclass_driver_s **classdev); ****************************************************************************/ #if !defined(CONFIG_USBDEV_COMPOSITE) || !defined(CONFIG_CDCACM_COMPOSITE) -EXTERN int cdcacm_initialize(int minor); +EXTERN int cdcacm_initialize(int minor, FAR void **handle); #endif /**************************************************************************** * Name: cdcacm_uninitialize * * Description: - * Un-initialize the USB storage class driver + * Un-initialize the USB storage class driver. This function is used + * internally by the USB composite driver to unitialized the CDC/ACM + * driver. This same interface is available (with an untyped input + * parameter) when the CDC/ACM driver is used standalone. * * Input Parameters: - * handle - The handle returned by a previous call to cdcacm_configure(). + * There is one parameter, it differs in typing depending upon whether the + * CDC/ACM driver is an internal part of a composite device, or a standalone + * USB driver: + * + * classdev - The class object returned by board_cdcclassobject() or + * cdcacm_classobject() + * handle - The opaque handle represetning the class object returned by + * a previous call to cdcacm_initialize(). * * Returned Value: * None @@ -392,6 +405,8 @@ EXTERN int cdcacm_initialize(int minor); #if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_CDCACM_COMPOSITE) EXTERN void cdcacm_uninitialize(FAR struct usbdevclass_driver_s *classdev); +#else +EXTERN void cdcacm_uninitialize(FAR void *handle); #endif #undef EXTERN diff --git a/nuttx/include/nuttx/usb/usbdev_trace.h b/nuttx/include/nuttx/usb/usbdev_trace.h index bde6b227b..051b4ffa6 100644 --- a/nuttx/include/nuttx/usb/usbdev_trace.h +++ b/nuttx/include/nuttx/usb/usbdev_trace.h @@ -215,13 +215,14 @@ #define USBSER_TRACEERR_SETUPNOTCONNECTED 0x0019 #define USBSER_TRACEERR_SUBMITFAIL 0x001a #define USBSER_TRACEERR_UARTREGISTER 0x001b -#define USBSER_TRACEERR_UNSUPPORTEDCTRLREQ 0x001c -#define USBSER_TRACEERR_UNSUPPORTEDCLASSREQ 0x001d -#define USBSER_TRACEERR_UNSUPPORTEDSTDREQ 0x001e -#define USBSER_TRACEERR_UNSUPPORTEDTYPE 0x001f -#define USBSER_TRACEERR_WRALLOCREQ 0x0020 -#define USBSER_TRACEERR_WRSHUTDOWN 0x0021 -#define USBSER_TRACEERR_WRUNEXPECTED 0x0022 +#define USBSER_TRACEERR_UARTUNREGISTER 0x001c +#define USBSER_TRACEERR_UNSUPPORTEDCTRLREQ 0x001d +#define USBSER_TRACEERR_UNSUPPORTEDCLASSREQ 0x001e +#define USBSER_TRACEERR_UNSUPPORTEDSTDREQ 0x001f +#define USBSER_TRACEERR_UNSUPPORTEDTYPE 0x0020 +#define USBSER_TRACEERR_WRALLOCREQ 0x0021 +#define USBSER_TRACEERR_WRSHUTDOWN 0x0022 +#define USBSER_TRACEERR_WRUNEXPECTED 0x0023 /* USB Storage driver class events ******************************************/ |