Common workflow for all USB devices.
- Ensure that conf_usb.h is available and contains the following configuration which is the main USB device configuration:
#define USB_DEVICE_VENDOR_ID 0x03EB // Type Word
#define USB_DEVICE_PRODUCT_ID 0xXXXX // Type Word
#define USB_DEVICE_MAJOR_VERSION 1 // Type Byte
#define USB_DEVICE_MINOR_VERSION 0 // Type Byte
#define USB_DEVICE_POWER 100 // Type 9-bits
#define USB_DEVICE_ATTR USB_CONFIG_ATTR_BUS_POWERED // Flags
- Call the USB device stack start function to enable stack and start USB:
-
- Note
- In case of USB dual roles (Device and Host) managed through USB OTG connector (USB ID pin), the call of udc_start() must be removed and replaced by uhc_start(). SeRefer to "AVR4950 section 6.1 Dual roles" for further information about dual roles.