Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
USB device descriptors for a single interface

The following structures provide the USB device descriptors required for USB Device with a single interface Vendor Class.

It is ready to use and do not require more definition.

Data Structures

struct  udc_desc_t
 Structure for USB Device Configuration Descriptor. More...
 

Macros

#define UDI_VENDOR_EP_BULK_IN
 
#define UDI_VENDOR_EP_BULK_OUT
 
#define UDI_VENDOR_EP_INTERRUPT_IN   (1 | USB_EP_DIR_IN)
 Endpoint numbers used by vendor interface. More...
 
#define UDI_VENDOR_EP_INTERRUPT_OUT   (2 | USB_EP_DIR_OUT)
 
#define UDI_VENDOR_EP_ISO_IN
 
#define UDI_VENDOR_EP_ISO_OUT
 
#define UDI_VENDOR_IFACE_NUMBER   0
 Interface number is 0 because it is the unique interface. More...
 
#define USB_DEVICE_EP_CTRL_SIZE   64
 Control endpoint size. More...
 
#define USB_DEVICE_NB_INTERFACE   1
 Only one interface for this device. More...
 

Variables

UDC_DESC_STORAGE udc_desc_t udc_desc_fs
 USB Device Configuration Descriptor filled for FS. More...
 
UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc
 USB Device Descriptor. More...
 

UDC structures which contains all USB Device definitions

UDC_DESC_STORAGE udi_api_tudi_apis [USB_DEVICE_NB_INTERFACE]
 Associate an UDI for each USB interface. More...
 
UDC_DESC_STORAGE udc_config_speed_t udc_config_lsfs [1]
 Add UDI with USB Descriptors FS. More...
 
UDC_DESC_STORAGE udc_config_t udc_config
 Add all information about USB Device in global structure for UDC. More...
 

UDD Configuration

#define UDI_VENDOR_EP_NB_INT   ((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0)
 Maximum 6 endpoints used by vendor interface. More...
 
#define UDI_VENDOR_EP_NB_BULK   ((UDI_VENDOR_EPS_SIZE_BULK_FS)?2:0)
 
#define UDI_VENDOR_EP_NB_ISO   ((UDI_VENDOR_EPS_SIZE_ISO_FS)?2:0)
 
#define USB_DEVICE_MAX_EP   (UDI_VENDOR_EP_NB_INT+UDI_VENDOR_EP_NB_BULK+UDI_VENDOR_EP_NB_ISO)
 

#define UDI_VENDOR_EP_BULK_IN
Value:
((((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0)+1)\
#define USB_EP_DIR_IN
Endpoint transfer direction is IN.
Definition: usb_protocol.h:288
#define UDI_VENDOR_EP_BULK_OUT
Value:
((((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0)+2)\
#define USB_EP_DIR_OUT
Endpoint transfer direction is OUT.
Definition: usb_protocol.h:293
#define UDI_VENDOR_EP_INTERRUPT_IN   (1 | USB_EP_DIR_IN)

Endpoint numbers used by vendor interface.

Note: The order of endpoint can depend on USB hardware capability when a specific mapping is used on USB DPRAM.

#define UDI_VENDOR_EP_INTERRUPT_OUT   (2 | USB_EP_DIR_OUT)
#define UDI_VENDOR_EP_ISO_IN
Value:
((((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0)+ \
((UDI_VENDOR_EPS_SIZE_BULK_FS)?2:0)+1)\
#define USB_EP_DIR_IN
Endpoint transfer direction is IN.
Definition: usb_protocol.h:288
#define UDI_VENDOR_EP_ISO_OUT
Value:
((((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0)+ \
((UDI_VENDOR_EPS_SIZE_BULK_FS)?2:0)+2)\
#define USB_EP_DIR_OUT
Endpoint transfer direction is OUT.
Definition: usb_protocol.h:293
#define UDI_VENDOR_EP_NB_BULK   ((UDI_VENDOR_EPS_SIZE_BULK_FS)?2:0)
#define UDI_VENDOR_EP_NB_INT   ((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0)

Maximum 6 endpoints used by vendor interface.

#define UDI_VENDOR_EP_NB_ISO   ((UDI_VENDOR_EPS_SIZE_ISO_FS)?2:0)
#define UDI_VENDOR_IFACE_NUMBER   0

Interface number is 0 because it is the unique interface.

#define USB_DEVICE_EP_CTRL_SIZE   64

Control endpoint size.

#define USB_DEVICE_NB_INTERFACE   1

Only one interface for this device.

Initial value:
= {
.confdev_lsfs = &udc_device_desc,
.conf_lsfs = udc_config_lsfs,
}
COMPILER_WORD_ALIGNED UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc
Pointer on the selected speed device configuration.
Definition: udi_phdc_desc.c:63
UDC_DESC_STORAGE udc_config_speed_t udc_config_lsfs[1]
Add UDI with USB Descriptors FS.
Definition: udi_composite_desc.c:155

Add all information about USB Device in global structure for UDC.

Global variables of USB Device Descriptor and UDI links.

Initial value:
= {{
}}
Standard USB configuration descriptor structure.
Definition: usb_protocol.h:424
UDC_DESC_STORAGE udi_api_t * udi_apis[USB_DEVICE_NB_INTERFACE]
Definition: udi_phdc_desc.c:135
#define UDC_DESC_STORAGE
Defines the memory's location of USB descriptors.
Definition: udc_desc.h:77
COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udc_desc_t udc_desc_fs
USB Device Configuration Descriptor filled for full and high speed.
Definition: udi_cdc_desc.c:163

Add UDI with USB Descriptors FS.

Initial value:
= {
.conf.bLength = sizeof(usb_conf_desc_t),
.conf.bDescriptorType = USB_DT_CONFIGURATION,
.conf.wTotalLength = LE16(sizeof(udc_desc_t)),
.conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE,
.conf.bConfigurationValue = 1,
.conf.iConfiguration = 0,
.conf.bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_DEVICE_ATTR,
.udi_vendor = UDI_VENDOR_DESC_FS,
}
Definition: usb_protocol.h:198
#define USB_CONFIG_ATTR_MUST_SET
Must always be set.
Definition: usb_protocol.h:436
#define LE16(x)
Definition: compiler.h:1112
Standard USB configuration descriptor structure.
Definition: usb_protocol.h:424
#define USB_DEVICE_ATTR
Definition: common/services/usb/class/cdc/device/unit_tests/conf_usb.h:60
#define UDI_VENDOR_DESC_FS
Content of vendor interface descriptor for full speed only.
Definition: udi_vendor.h:241
#define USB_DEVICE_POWER
Definition: common/services/usb/class/cdc/device/unit_tests/conf_usb.h:59
#define USB_CONFIG_MAX_POWER(ma)
Max power in mA.
Definition: usb_protocol.h:441
#define USB_DEVICE_NB_INTERFACE
Only one interface for this device.
Definition: udi_vendor_desc.c:62
Structure for USB Device Configuration Descriptor.
Definition: udi_phdc_desc.c:109

USB Device Configuration Descriptor filled for FS.

USB Device Configuration Descriptor filled for full and high speed.

Initial value:
= {
.bLength = sizeof(usb_dev_desc_t),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = LE16(USB_V2_0),
.bDeviceClass = 0,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE,
.idVendor = LE16(USB_DEVICE_VENDOR_ID),
.idProduct = LE16(USB_DEVICE_PRODUCT_ID),
.bcdDevice = LE16((USB_DEVICE_MAJOR_VERSION << 8)
.iManufacturer = 0,
.iProduct = 0,
.iSerialNumber = 0,
.bNumConfigurations = 1
}
#define USB_V2_0
Value for field bcdUSB.
Definition: usb_protocol.h:63
#define USB_DEVICE_PRODUCT_ID
Definition: common/services/usb/class/cdc/device/unit_tests/conf_usb.h:56
Standard USB device descriptor structure.
Definition: usb_protocol.h:327
#define LE16(x)
Definition: compiler.h:1112
Definition: usb_protocol.h:197
#define USB_DEVICE_MINOR_VERSION
Definition: common/services/usb/class/cdc/device/unit_tests/conf_usb.h:58
#define USB_DEVICE_EP_CTRL_SIZE
Definition: udi_phdc_conf.h:53
#define USB_DEVICE_VENDOR_ID
USB Device Configuration.
Definition: common/services/usb/class/cdc/device/unit_tests/conf_usb.h:55
#define USB_DEVICE_MAJOR_VERSION
Definition: common/services/usb/class/cdc/device/unit_tests/conf_usb.h:57

USB Device Descriptor.

Pointer on the selected speed device configuration.

Initial value:
= {
}
UDC_DESC_STORAGE udi_api_t udi_api_vendor
Global structure which contains standard UDI API for UDC.
Definition: udi_vendor.c:74

Associate an UDI for each USB interface.