LUFA Library  140302
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
StdDescriptors.h File Reference

Common standard USB Descriptor definitions for all architectures. More...

#include "../../../Common/Common.h"
#include "USBMode.h"
#include "Events.h"

Data Structures

struct  USB_Descriptor_Configuration_Header_t
 Standard USB Configuration Descriptor (LUFA naming conventions). More...
 
struct  USB_Descriptor_Device_t
 Standard USB Device Descriptor (LUFA naming conventions). More...
 
struct  USB_Descriptor_DeviceQualifier_t
 Standard USB Device Qualifier Descriptor (LUFA naming conventions). More...
 
struct  USB_Descriptor_Endpoint_t
 Standard USB Endpoint Descriptor (LUFA naming conventions). More...
 
struct  USB_Descriptor_Header_t
 Standard USB Descriptor Header (LUFA naming conventions). More...
 
struct  USB_Descriptor_Interface_Association_t
 Standard USB Interface Association Descriptor (LUFA naming conventions). More...
 
struct  USB_Descriptor_Interface_t
 Standard USB Interface Descriptor (LUFA naming conventions). More...
 
struct  USB_Descriptor_String_t
 Standard USB String Descriptor (LUFA naming conventions). More...
 
struct  USB_StdDescriptor_Configuration_Header_t
 Standard USB Configuration Descriptor (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_Device_t
 Standard USB Device Descriptor (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_DeviceQualifier_t
 Standard USB Device Qualifier Descriptor (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_Endpoint_t
 Standard USB Endpoint Descriptor (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_Header_t
 Standard USB Descriptor Header (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_Interface_Association_t
 Standard USB Interface Association Descriptor (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_Interface_t
 Standard USB Interface Descriptor (USB-IF naming conventions). More...
 
struct  USB_StdDescriptor_String_t
 Standard USB String Descriptor (USB-IF naming conventions). More...
 

Macros

#define LANGUAGE_ID_ENG   0x0409
 
#define NO_DESCRIPTOR   0
 
#define USB_CONFIG_POWER_MA(mA)   ((mA) >> 1)
 
#define USB_STRING_DESCRIPTOR(String)   { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String }
 
#define USB_STRING_DESCRIPTOR_ARRAY(...)   { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} }
 
#define USB_STRING_LEN(UnicodeChars)   (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1))
 
#define VERSION_BCD(Major, Minor, Revision)
 
USB Configuration Descriptor Attribute Masks
#define USB_CONFIG_ATTR_RESERVED   0x80
 
#define USB_CONFIG_ATTR_SELFPOWERED   0x40
 
#define USB_CONFIG_ATTR_REMOTEWAKEUP   0x20
 
Endpoint Descriptor Attribute Masks
#define ENDPOINT_ATTR_NO_SYNC   (0 << 2)
 
#define ENDPOINT_ATTR_ASYNC   (1 << 2)
 
#define ENDPOINT_ATTR_ADAPTIVE   (2 << 2)
 
#define ENDPOINT_ATTR_SYNC   (3 << 2)
 
Endpoint Descriptor Usage Masks
#define ENDPOINT_USAGE_DATA   (0 << 4)
 
#define ENDPOINT_USAGE_FEEDBACK   (1 << 4)
 
#define ENDPOINT_USAGE_IMPLICIT_FEEDBACK   (2 << 4)
 

Enumerations

enum  USB_Descriptor_ClassSubclassProtocol_t {
  USB_CSCP_NoDeviceClass = 0x00,
  USB_CSCP_NoDeviceSubclass = 0x00,
  USB_CSCP_NoDeviceProtocol = 0x00,
  USB_CSCP_VendorSpecificClass = 0xFF,
  USB_CSCP_VendorSpecificSubclass = 0xFF,
  USB_CSCP_VendorSpecificProtocol = 0xFF,
  USB_CSCP_IADDeviceClass = 0xEF,
  USB_CSCP_IADDeviceSubclass = 0x02,
  USB_CSCP_IADDeviceProtocol = 0x01
}
 
enum  USB_DescriptorTypes_t {
  DTYPE_Device = 0x01,
  DTYPE_Configuration = 0x02,
  DTYPE_String = 0x03,
  DTYPE_Interface = 0x04,
  DTYPE_Endpoint = 0x05,
  DTYPE_DeviceQualifier = 0x06,
  DTYPE_Other = 0x07,
  DTYPE_InterfacePower = 0x08,
  DTYPE_InterfaceAssociation = 0x0B,
  DTYPE_CSInterface = 0x24,
  DTYPE_CSEndpoint = 0x25
}
 

Detailed Description

Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains structures and macros for the easy creation of standard USB descriptors in USB device projects.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.