40 #ifndef _USB_PROTOCOL_H_ 41 #define _USB_PROTOCOL_H_ 55 #define USB_V2_0 0x0200 57 #define USB_V2_1 0x0201 63 #define CLASS_VENDOR_SPECIFIC 0xFF 64 #define NO_SUBCLASS 0x00 65 #define NO_PROTOCOL 0x00 70 #define CLASS_IAD 0xEF 71 #define SUB_CLASS_IAD 0x02 72 #define PROTOCOL_IAD 0x01 78 #define USB_REQ_DIR_OUT (0<<7) 79 #define USB_REQ_DIR_IN (1<<7) 80 #define USB_REQ_DIR_MASK (1<<7) 85 #define USB_REQ_TYPE_STANDARD (0<<5) 86 #define USB_REQ_TYPE_CLASS (1<<5) 87 #define USB_REQ_TYPE_VENDOR (2<<5) 88 #define USB_REQ_TYPE_MASK (3<<5) 93 #define USB_REQ_RECIP_DEVICE (0<<0) 94 #define USB_REQ_RECIP_INTERFACE (1<<0) 95 #define USB_REQ_RECIP_ENDPOINT (2<<0) 96 #define USB_REQ_RECIP_OTHER (3<<0) 97 #define USB_REQ_RECIP_MASK (0x1F) 220 #define HIRD_125_US 1 221 #define HIRD_200_US 2 222 #define HIRD_275_US 3 223 #define HIRD_350_US 4 224 #define HIRD_425_US 5 225 #define HIRD_500_US 6 226 #define HIRD_575_US 7 227 #define HIRD_650_US 8 228 #define HIRD_725_US 9 229 #define HIRD_800_US 10 230 #define HIRD_875_US 11 231 #define HIRD_950_US 12 232 #define HIRD_1025_US 13 233 #define HIRD_1100_US 14 234 #define HIRD_1175_US 15 237 #define USB_LPM_ATTRIBUT_BLINKSTATE_MASK (0xF << 0) 238 #define USB_LPM_ATTRIBUT_FIRD_MASK (0xF << 4) 239 #define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK (1 << 8) 240 #define USB_LPM_ATTRIBUT_BLINKSTATE(value) ((value & 0xF) << 0) 241 #define USB_LPM_ATTRIBUT_FIRD(value) ((value & 0xF) << 4) 242 #define USB_LPM_ATTRIBUT_REMOTEWAKE(value) ((value & 1) << 8) 243 #define USB_LPM_ATTRIBUT_BLINKSTATE_L1 USB_LPM_ATTRIBUT_BLINKSTATE(1) 266 #define USB_EP_ADDR_MASK 0x0f 274 #define USB_EP_DIR_IN 0x80 279 #define USB_EP_DIR_OUT 0x00 290 #define USB_MAX_DESC_LEN 255 422 #define USB_CONFIG_ATTR_MUST_SET (1 << 7) 423 #define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) 424 #define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) 425 #define USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) 427 #define USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2)
usb_interface_status
Standard USB Interface status flags.
uint8_t iFunction
Index of string descriptor.
usb_endpoint_feature
Standard USB endpoint feature/status flags.
A standard USB string descriptor structure.
uint8_t bNumConfigurations
uint8_t bDescriptorType
INTERFACE descriptor type.
#define COMPILER_PACK_RESET()
Set default alignment for subsequent struct and union definitions.
Standard USB device descriptor structure.
usb_descriptor_type
Standard USB descriptor types.
Standard USB configuration descriptor structure.
A USB Device SETUP request.
uint8_t bInterfaceProtocol
usb_dev_capa_ext_desc_t capa_ext
uint8_t bInterfaceCount
value to select alternate setting
usb_device_feature
Standard USB device feature flags.
#define COMPILER_PACK_SET(alignment)
Set maximum alignment for subsequent struct and union definitions to alignment.
uint8_t bFunctionSubClass
Sub-class code assigned by the USB.
usb_capability_extension_attr
USB Device Capability - USB 2.0 Extension To fill bmAttributes field of usb_capa_ext_desc_t structure...
USB Device Capabilities - USB 2.0 Extension Descriptor structure.
All USB VIDs and PIDs from Atmel USB applications.
usb_reqid
Standard USB requests (bRequest)
Standard USB device qualifier descriptor structure.
usb_device_status
Standard USB device status flags.
uint8_t bConfigurationValue
uint8_t usb_ep_t
Endpoint identifier.
uint8_t bInterfaceCount
value to select alternate setting
uint8_t iFunction
Index of string descriptor.
usb_ep_type
Standard USB endpoint transfer types.
Standard USB interface descriptor structure.
uint8_t bFunctionSubClass
Sub-class code assigned by the USB.
Standard USB association descriptor structure.
uint8_t bFirstInterface
Number of interface.
uint8_t bFunctionProtocol
Protocol code assigned by the USB.
uint8_t bAlternateSetting
uint8_t bFirstInterface
Number of interface.
uint8_t usb_add_t
USB address identifier.
uint8_t bLength
Size of this descriptor in bytes.
usb_endpoint_status
Standard USB endpoint status flags.
uint8_t bFunctionClass
Class code assigned by the USB.
Standard USB endpoint descriptor structure.
Standard USB Interface Association Descriptor structure.
usb_device_hs_test_mode
Test Mode possible on HS USB device.
uint8_t bNumConfigurations
uint8_t bDevCapabilityType
USB Device LPM Descriptor structure.
uint8_t bFunctionClass
Class code assigned by the USB.
uint8_t bInterfaceSubClass
usb_test_mode_selector
Standard USB Test Mode Selectors.
uint8_t bFunctionProtocol
Protocol code assigned by the USB.
usb_capability_type
USB Device Capability types.
uint8_t bLength
size of this descriptor in bytes
usb_langid
Standard USB language IDs for string descriptors.
uint8_t bDescriptorType
Interface descriptor type.
USB Device BOS descriptor structure.