A USB Composite Device is a USB Device, which uses more than one USB class.
A USB Composite Device is a USB Device which uses more than one USB class.
In this use case, the "USB Vendor (Composite Device)" module is used to create a USB composite device. Thus, this USB module can be associated with another "Composite Device" module, like "USB HID Mouse (Composite Device)".
Also, you can refer to application note AVR4902 ASF - USB Composite Device.
Setup Steps
For the setup code of this use case to work, the basic use case must be followed.
Usage Steps
Example Code
Content of conf_usb.h:
#define USB_DEVICE_EP_CTRL_SIZE 64
#define USB_DEVICE_NB_INTERFACE (X+1)
#define USB_DEVICE_MAX_EP (X) to (X+6)
#define UDI_VENDOR_EP_INTERRUPT_IN (1 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_INTERRUPT_OUT (2 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_BULK_IN (3 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_BULK_OUT (4 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_ISO_IN (5 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_ISO_OUT (6 | USB_EP_DIR_OUT)
#define UDI_VENDOR_IFACE_NUMBER X
#define UDI_COMPOSITE_DESC_T \
udi_vendor_desc_t udi_vendor; \
...
#define UDI_COMPOSITE_DESC_FS \
.udi_vendor = UDI_VENDOR_DESC, \
...
#define UDI_COMPOSITE_DESC_HS \
.udi_vendor = UDI_VENDOR_DESC, \
...
#define UDI_COMPOSITE_API \
&udi_api_vendor, \
...
Workflow
- Ensure that conf_usb.h is available and contains the following parameters required for a USB composite device configuration:
#define USB_DEVICE_EP_CTRL_SIZE 64
#define USB_DEVICE_NB_INTERFACE (X+1)
#define USB_DEVICE_MAX_EP (X) to (X+6)
- Ensure that conf_usb.h contains the description of composite device:
#define UDI_VENDOR_EP_INTERRUPT_IN (1 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_INTERRUPT_OUT (2 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_BULK_IN (3 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_BULK_OUT (4 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_ISO_IN (5 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_ISO_OUT (6 | USB_EP_DIR_OUT)
#define UDI_VENDOR_IFACE_NUMBER X
- Ensure that conf_usb.h contains the following parameters required for a USB composite device configuration:
#define UDI_COMPOSITE_DESC_T \
...
...
#define UDI_COMPOSITE_DESC_FS \
...
...
#define UDI_COMPOSITE_DESC_HS \
...
...
#define UDI_COMPOSITE_API \
...
...
- Note
- The descriptors order given in the four lists above must be the same as the order defined by all interface indexes. The interface index orders are defined through UDI_X_IFACE_NUMBER defines.
A USB Composite Device is a USB Device, which uses more than one USB class.
In this use case, the "USB Vendor (Composite Device)" module is used to create a USB composite device. Thus, this USB module can be associated with another "Composite Device" module, like "USB HID Mouse (Composite Device)".
Also, you can refer to application note AVR4902 ASF - USB Composite Device.
Setup Steps
For the setup code of this use case to work, the Basic Use Case must be followed.
Usage Steps
Example Code
Content of conf_usb.h:
#define USB_DEVICE_EP_CTRL_SIZE 64
#define USB_DEVICE_NB_INTERFACE (X+1)
#define USB_DEVICE_MAX_EP (X) to (X+6)
#define UDI_VENDOR_EP_INTERRUPT_IN (1 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_INTERRUPT_OUT (2 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_BULK_IN (3 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_BULK_OUT (4 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_ISO_IN (5 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_ISO_OUT (6 | USB_EP_DIR_OUT)
#define UDI_VENDOR_IFACE_NUMBER X
#define UDI_COMPOSITE_DESC_T \
udi_vendor_desc_t udi_vendor; \
...
#define UDI_COMPOSITE_DESC_FS \
.udi_vendor = UDI_VENDOR_DESC, \
...
#define UDI_COMPOSITE_DESC_HS \
.udi_vendor = UDI_VENDOR_DESC, \
...
#define UDI_COMPOSITE_API \
&udi_api_vendor, \
...
Workflow
- Ensure that conf_usb.h is available and contains the following parameters required for a USB composite device configuration:
#define USB_DEVICE_EP_CTRL_SIZE 64
#define USB_DEVICE_NB_INTERFACE (X+1)
#define USB_DEVICE_MAX_EP (X) to (X+6)
- Ensure that conf_usb.h contains the description of composite device:
#define UDI_VENDOR_EP_INTERRUPT_IN (1 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_INTERRUPT_OUT (2 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_BULK_IN (3 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_BULK_OUT (4 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_ISO_IN (5 | USB_EP_DIR_IN)
#define UDI_VENDOR_EP_ISO_OUT (6 | USB_EP_DIR_OUT)
#define UDI_VENDOR_IFACE_NUMBER X
- Ensure that conf_usb.h contains the following parameters required for a USB composite device configuration:
#define UDI_COMPOSITE_DESC_T \
...
...
...
...
...
...
...
...
- Note
- The descriptors order given in the four lists above must be the same as the order defined by all interface indexes. The interface index orders are defined through UDI_X_IFACE_NUMBER defines.