Update to apps/system/compsite assocated with big changes to the composite device logic
This commit is contained in:
parent
9043459c7b
commit
7652b67882
@ -1,33 +1,58 @@
|
||||
system/composite
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This logic adds a NXH command to control a USB composite device. The only
|
||||
supported composite is CDC/ACM serial with a USB mass storage device.
|
||||
This logic adds a NSH command to control a USB composite device. The only
|
||||
supported devices in the composite are CDC/ACM serial and a USB mass storage
|
||||
device. Which devices are enclosed in a composite device is configured with
|
||||
an array of configuration-structs, handed over to the function
|
||||
composite_initialize().
|
||||
|
||||
Required overall configuration:
|
||||
|
||||
CONFIG_USBDEV=y - USB device support
|
||||
CONFIG_USBDEV_COMPOSITE=y - USB composite device support
|
||||
CONFIG_COMPOSITE_IAD=y - Interface associate descriptor needed
|
||||
Enable the USB Support of your Hardware / Processor e.g. SAMV7_USBDEVHS=y
|
||||
|
||||
CONFIG_CDCACM=y - USB CDC/ACM serial device support
|
||||
CONFIG_CDCACM_COMPOSITE=y - USB CDC/ACM serial composite device support
|
||||
CONFIG_CDCACM_IFNOBASE=0 - CDC/ACM interfaces start with number 0
|
||||
CONFIG_CDCACM_STRBASE=4 - Base of string numbers (not really needed)
|
||||
CONFIG_CDCACM_EPINTIN=1 - Endpoint numbers must be unique
|
||||
CONFIG_CDCACM_EPBULKIN=2
|
||||
CONFIG_CDCACM_EPBULKOUT=3
|
||||
CONFIG_USBDEV=y - USB device support
|
||||
CONFIG_USBDEV_COMPOSITE=y - USB composite device support
|
||||
CONFIG_COMPOSITE_IAD=y - Interface associate descriptor needed
|
||||
|
||||
CONFIG_USBMSC - USB mass storage device support
|
||||
CONFIG_USBMSC_COMPOSITE=y - USB mass storage composite device support
|
||||
CONFIG_USBMSC_IFNOBASE=2 - USB mass storage interfaces start with number 2
|
||||
CONFIG_USBMSC_STRBASE=4 - Base of string numbers (needed)
|
||||
CONFIG_USBMSC_EPBULKOUT=4 - Endpoint numbers must be unique
|
||||
CONFIG_USBMSC_EPBULKIN=5
|
||||
CONFIG_CDCACM=y - USB CDC/ACM serial device support
|
||||
CONFIG_CDCACM_COMPOSITE=y - USB CDC/ACM serial composite device support
|
||||
|
||||
The interface-, string-descriptor- and endpoint-numbers are configured via the
|
||||
configuration-structs as noted above. The CDC/ACM serial device needs three
|
||||
endpoints; one interrupt-driven and two bulk endpoints.
|
||||
|
||||
CONFIG_USBMSC=y - USB mass storage device support
|
||||
CONFIG_USBMSC_COMPOSITE=y - USB mass storage composite device support
|
||||
|
||||
Like the configuration for the CDC/ACM, the descriptor- and endpoint-numbers
|
||||
are configured via the configuration struct.
|
||||
|
||||
Depending on the configuration struct you need to configure different vendor-
|
||||
and product-IDs. Each VID/PID is unique to a device and thus to a dedicated
|
||||
configuration.
|
||||
|
||||
Linux tries to detect the device types and installs default drivers if the
|
||||
VID/PID pair is unknown.
|
||||
|
||||
Windows insists on a known and installed configuration. With an Atmel
|
||||
hardware and Atmel-Studio or the Atmel-USB-drivers installed, you can test
|
||||
your configuration with Atmel Example Vendor- and Product-IDs.
|
||||
|
||||
If you have a USBMSC and a CDC/ACM configured in your combo, then you can try
|
||||
to use
|
||||
|
||||
- VID = 0x03EB (ATMEL)
|
||||
- PID = 0x2424 (ASF Example with MSC and CDC)
|
||||
|
||||
If for example you try to test a configuration with up to seven CDCs, then
|
||||
|
||||
- VID = 0x03EB (ATMEL)
|
||||
- PID = 0x2426 (ASF Example with up to seven CDCs)
|
||||
|
||||
CONFIG_NSH_BUILTIN_APPS
|
||||
This add-on can be built as two NSH "built-in" commands if this option
|
||||
is selected: 'conn' will connect the USB composite device; 'msdis'
|
||||
is selected: 'conn' will connect the USB composite device; 'disconn'
|
||||
will disconnect the USB composite device.
|
||||
|
||||
Configuration options unique to this add-on:
|
||||
|
@ -549,7 +549,8 @@ static void usbmsc_disconnect(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_mscclassobject(FAR struct usbdevclass_driver_s **classdev)
|
||||
int board_mscclassobject(int minor, FAR struct usbdev_description_s *devdesc,
|
||||
FAR struct usbdevclass_driver_s **classdev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -620,7 +621,7 @@ int board_mscclassobject(FAR struct usbdevclass_driver_s **classdev)
|
||||
|
||||
/* Get the mass storage device's class object */
|
||||
|
||||
ret = usbmsc_classobject(g_composite.mschandle, classdev);
|
||||
ret = usbmsc_classobject(g_composite.mschandle, devdesc, classdev);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("board_mscclassobject: usbmsc_classobject failed: %d\n", -ret);
|
||||
@ -672,14 +673,15 @@ void board_mscuninitialize(FAR struct usbdevclass_driver_s *classdev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_cdcclassobject(FAR struct usbdevclass_driver_s **classdev)
|
||||
int board_cdcclassobject(int minor, FAR struct usbdev_description_s *devdesc,
|
||||
FAR struct usbdevclass_driver_s **classdev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Initialize the USB serial driver */
|
||||
|
||||
printf("board_cdcclassobject: Initializing USB serial driver\n");
|
||||
ret = cdcacm_classobject(CONFIG_SYSTEM_COMPOSITE_TTYUSB, classdev);
|
||||
ret = cdcacm_classobject(minor, devdesc, classdev);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("board_cdcclassobject: ERROR: Failed to create the USB serial device: %d\n", -ret);
|
||||
|
Loading…
Reference in New Issue
Block a user