6.1 USB Configuration

USB Device Configuration

The following configuration must be included in the conf_usb.h file of the application, which is the main USB device configuration.

Table 6-1. USB Device Configuration
Define nameTypeDescription
USB_DEVICE_VENDOR_IDWordVendor ID provided by USB org (ATMEL 0x03EB)
USB_DEVICE_PRODUCT_IDWordProduct ID (referenced in usb_atmel.h)
USB_DEVICE_MAJOR_VERSIONByteMajor version of the device
USB_DEVICE_MINOR_VERSIONByteMinor version of the device
USB_DEVICE_MANUFACTURE_NAME(1)String(2)Static ASCII name for the manufacture
USB_DEVICE_PRODUCT_NAME(1)String(2)Static ASCII name for the product
USB_DEVICE_SERIAL_NAME(1)String(2)Static ASCII name to enable and set a serial number
USB_DEVICE_GET_SERIAL_NAME_POINTER()(1)const uint8_t* function(void)Give a pointer on a dynamic ASCII name to enable and set a serial number.

Require USB_DEVICE_GET_SERIAL_NAME_LENGTH and ignore USB_DEVICE_SERIAL_NAME.

USB_DEVICE_GET_SERIAL_NAME_LENGTH()(1)uint8_t function(void)Give the length of dynamic ASCII name used to enable a serial number.
USB_DEVICE_POWERNumericMaximum device power (mA)
USB_DEVICE_ATTRByteUSB attributes to add to enable feature:
  • USB_CONFIG_ATTR_SELF_POWERED
  • USB_CONFIG_ATTR_REMOTE_WAKEUP(3)
USB_DEVICE_LOW_SPEED(1)Only definedForce the USB device to run in Low Speed
USB_DEVICE_HS_SUPPORT(1)Only definedAuthorize the USB device to run in High Speed
USB_DEVICE_MAX_EPByteDefine the maximum endpoint number used by the device (don’t include control endpoint)
Note: (1) Optional configuration. Comment the define statement to disable it (ex: // #define USB_DEVICE_X).
Note: (2) Examples of String syntax: #define USB_DEVICE_MANUFACTURE_NAME “ATMEL”. The Define can be omitted, thus the string is removed of USB enumeration.
Note: (3) If the remote wake feature is enabled, remote wake-up callbacks must be implemented.

USB Interface Configuration

The UDI configurations are described in USB device class application notes.

USB Drivers Configuration

The following configuration must be included in the conf_usb.h file of the application.

The AVR products provide specific hardware features that can be enabled here.

Table 6-2. USB Device Driver Configuration
Define nameValuesUDDDescription
UDD_NO_SLEEP_MGROnly definedAllRemove the management of sleepmgr service
UDD_ISOCHRONOUS_NB_BANK1, 2, 3AVR32 - USBBReduces or increases isochronous endpoint buffering. Default value: 2
UDD_BULK_NB_BANK1, 2, 3AVR32 - USBBReduces or increases bulk endpoint buffering.
Default value: 2
UDD_INTERRUPT_NB_BANK1, 2, 3AVR32 - USBBReduces or increases interrupt endpoint buffering.
Default value: 1
UDD_USB_INT_LEVEL0 to 3AVR32 - USBB AVR32 - USBCSets the USB interrupt level on AVR32 core.
Default value: 0 (recommended)
UDD_USB_INT_LEVELUSB_INTLVL_LO_gc

USB_INTLVL_...

XMEGA - USBSets the USB interrupt level on Xmega core.

Default value: USB_INTLVL_LO_gc (recommended)