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 1. USB Device Configuration
Define name Type Description
USB_DEVICE_VENDOR_ID Word Vendor ID provided by USB org (ATMEL 0x03EB)
USB_DEVICE_PRODUCT_ID Word Product ID (referenced in usb_atmel.h)
USB_DEVICE_MAJOR_VERSION Byte Major version of the device
USB_DEVICE_MINOR_VERSION Byte Minor 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_POWER Numeric Maximum device power (mA)
USB_DEVICE_ATTR Byte USB attributes to add to enable feature:
  • USB_CONFIG_ATTR_SELF_POWERED
  • USB_CONFIG_ATTR_REMOTE_WAKEUP(3)
USB_DEVICE_LOW_SPEED(1) Only defined Force the USB device to run in Low Speed
USB_DEVICE_HS_SUPPORT(1) Only defined Authorize the USB device to run in High Speed
USB_DEVICE_MAX_EP Byte Define 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 2. USB Device Driver Configuration
Define name Values UDD Description
UDD_NO_SLEEP_MGR Only defined All Remove the management of sleepmgr service
UDD_ISOCHRONOUS_NB_BANK 1, 2, 3 AVR32 - USBB Reduces or increases isochronous endpoint buffering. Default value: 2
UDD_BULK_NB_BANK 1, 2, 3 AVR32 - USBB Reduces or increases bulk endpoint buffering.
Default value: 2
UDD_INTERRUPT_NB_BANK 1, 2, 3 AVR32 - USBB Reduces or increases interrupt endpoint buffering.
Default value: 1
UDD_USB_INT_LEVEL 0 to 3 AVR32 - USBB AVR32 - USBC Sets the USB interrupt level on AVR32 core.
Default value: 0 (recommended)
UDD_USB_INT_LEVEL USB_INTLVL_LO_gc

USB_INTLVL_...

XMEGA - USB Sets the USB interrupt level on Xmega core.

Default value: USB_INTLVL_LO_gc (recommended)