libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
USB Standard Structure Definitions

Defined Constants and Types for the USB Standard Structure Definitions More...

Data Structures

struct  usb_setup_data
 
struct  usb_device_descriptor
 
struct  usb_device_qualifier_descriptor
 
struct  usb_interface
 
struct  usb_config_descriptor
 
struct  usb_interface_descriptor
 
struct  usb_endpoint_descriptor
 
struct  usb_string_descriptor
 
struct  usb_iface_assoc_descriptor
 

Macros

#define USB_CLASS_VENDOR   0xFF
 
#define USB_REQ_TYPE_DIRECTION   0x80
 
#define USB_REQ_TYPE_IN   0x80
 
#define USB_REQ_TYPE_OUT   0x0
 
#define USB_REQ_TYPE_TYPE   0x60
 
#define USB_REQ_TYPE_STANDARD   0x00
 
#define USB_REQ_TYPE_CLASS   0x20
 
#define USB_REQ_TYPE_VENDOR   0x40
 
#define USB_REQ_TYPE_RECIPIENT   0x1F
 
#define USB_REQ_TYPE_DEVICE   0x00
 
#define USB_REQ_TYPE_INTERFACE   0x01
 
#define USB_REQ_TYPE_ENDPOINT   0x02
 
#define USB_REQ_TYPE_OTHER   0x03
 
#define USB_REQ_GET_STATUS   0
 
#define USB_REQ_CLEAR_FEATURE   1
 
#define USB_REQ_SET_FEATURE   3
 
#define USB_REQ_SET_ADDRESS   5
 
#define USB_REQ_GET_DESCRIPTOR   6
 
#define USB_REQ_SET_DESCRIPTOR   7
 
#define USB_REQ_GET_CONFIGURATION   8
 
#define USB_REQ_SET_CONFIGURATION   9
 
#define USB_REQ_GET_INTERFACE   10
 
#define USB_REQ_SET_INTERFACE   11
 
#define USB_REQ_SET_SYNCH_FRAME   12
 
#define USB_DT_DEVICE   1
 
#define USB_DT_CONFIGURATION   2
 
#define USB_DT_STRING   3
 
#define USB_DT_INTERFACE   4
 
#define USB_DT_ENDPOINT   5
 
#define USB_DT_DEVICE_QUALIFIER   6
 
#define USB_DT_OTHER_SPEED_CONFIGURATION   7
 
#define USB_DT_INTERFACE_POWER   8
 
#define USB_DT_OTG   9
 
#define USB_DT_DEBUG   10
 
#define USB_DT_INTERFACE_ASSOCIATION   11
 
#define USB_FEAT_ENDPOINT_HALT   0
 
#define USB_FEAT_DEVICE_REMOTE_WAKEUP   1
 
#define USB_FEAT_TEST_MODE   2
 
#define USB_DEV_STATUS_SELF_POWERED   0x01
 
#define USB_DEV_STATUS_REMOTE_WAKEUP   0x02
 
#define USB_DT_DEVICE_SIZE   sizeof(struct usb_device_descriptor)
 
#define USB_DT_CONFIGURATION_SIZE   9
 
#define USB_CONFIG_ATTR_DEFAULT   0x80 /** always required (USB2.0 table 9-10) */
 
#define USB_CONFIG_ATTR_SELF_POWERED   0x40
 
#define USB_CONFIG_ATTR_REMOTE_WAKEUP   0x20
 
#define USB_DT_INTERFACE_SIZE   9
 
#define USB_DT_ENDPOINT_SIZE   7
 
#define USB_ENDPOINT_ADDR_OUT(x)   (x)
 
#define USB_ENDPOINT_ADDR_IN(x)   (0x80 | (x))
 
#define USB_ENDPOINT_ATTR_CONTROL   0x00
 
#define USB_ENDPOINT_ATTR_ISOCHRONOUS   0x01
 
#define USB_ENDPOINT_ATTR_BULK   0x02
 
#define USB_ENDPOINT_ATTR_INTERRUPT   0x03
 
#define USB_ENDPOINT_ATTR_TYPE   0x03
 
#define USB_ENDPOINT_ATTR_NOSYNC   0x00
 
#define USB_ENDPOINT_ATTR_ASYNC   0x04
 
#define USB_ENDPOINT_ATTR_ADAPTIVE   0x08
 
#define USB_ENDPOINT_ATTR_SYNC   0x0C
 
#define USB_ENDPOINT_ATTR_SYNCTYPE   0x0C
 
#define USB_ENDPOINT_ATTR_DATA   0x00
 
#define USB_ENDPOINT_ATTR_FEEDBACK   0x10
 
#define USB_ENDPOINT_ATTR_IMPLICIT_FEEDBACK_DATA   0x20
 
#define USB_ENDPOINT_ATTR_USAGETYPE   0x30
 
#define USB_DT_INTERFACE_ASSOCIATION_SIZE    sizeof(struct usb_iface_assoc_descriptor)
 

Enumerations

enum  usb_language_id { USB_LANGID_ENGLISH_US = 0x409 }
 

Detailed Description

Defined Constants and Types for the USB Standard Structure Definitions

Version
1.0.0
Author
© 2010 Gareth McMullin garet.nosp@m.h@bl.nosp@m.acksp.nosp@m.here.nosp@m..co.n.nosp@m.z
Date
10 March 2013

A set of structure definitions for the USB control structures defined in chapter 9 of the "Universal Serial Bus Specification Revision 2.0" Available from the USB Implementers Forum - http://www.usb.org/

LGPL License Terms libopencm3 License

Macro Definition Documentation

◆ USB_CLASS_VENDOR

#define USB_CLASS_VENDOR   0xFF

Definition at line 65 of file usbstd.h.

◆ USB_CONFIG_ATTR_DEFAULT

#define USB_CONFIG_ATTR_DEFAULT   0x80 /** always required (USB2.0 table 9-10) */

Definition at line 184 of file usbstd.h.

◆ USB_CONFIG_ATTR_REMOTE_WAKEUP

#define USB_CONFIG_ATTR_REMOTE_WAKEUP   0x20

Definition at line 186 of file usbstd.h.

◆ USB_CONFIG_ATTR_SELF_POWERED

#define USB_CONFIG_ATTR_SELF_POWERED   0x40

Definition at line 185 of file usbstd.h.

◆ USB_DEV_STATUS_REMOTE_WAKEUP

#define USB_DEV_STATUS_REMOTE_WAKEUP   0x02

Definition at line 120 of file usbstd.h.

◆ USB_DEV_STATUS_SELF_POWERED

#define USB_DEV_STATUS_SELF_POWERED   0x01

Definition at line 119 of file usbstd.h.

◆ USB_DT_CONFIGURATION

#define USB_DT_CONFIGURATION   2

Definition at line 101 of file usbstd.h.

◆ USB_DT_CONFIGURATION_SIZE

#define USB_DT_CONFIGURATION_SIZE   9

Definition at line 181 of file usbstd.h.

◆ USB_DT_DEBUG

#define USB_DT_DEBUG   10

Definition at line 110 of file usbstd.h.

◆ USB_DT_DEVICE

#define USB_DT_DEVICE   1

Definition at line 100 of file usbstd.h.

◆ USB_DT_DEVICE_QUALIFIER

#define USB_DT_DEVICE_QUALIFIER   6

Definition at line 105 of file usbstd.h.

◆ USB_DT_DEVICE_SIZE

#define USB_DT_DEVICE_SIZE   sizeof(struct usb_device_descriptor)

Definition at line 140 of file usbstd.h.

◆ USB_DT_ENDPOINT

#define USB_DT_ENDPOINT   5

Definition at line 104 of file usbstd.h.

◆ USB_DT_ENDPOINT_SIZE

#define USB_DT_ENDPOINT_SIZE   7

Definition at line 224 of file usbstd.h.

◆ USB_DT_INTERFACE

#define USB_DT_INTERFACE   4

Definition at line 103 of file usbstd.h.

◆ USB_DT_INTERFACE_ASSOCIATION

#define USB_DT_INTERFACE_ASSOCIATION   11

Definition at line 111 of file usbstd.h.

◆ USB_DT_INTERFACE_ASSOCIATION_SIZE

#define USB_DT_INTERFACE_ASSOCIATION_SIZE    sizeof(struct usb_iface_assoc_descriptor)

Definition at line 269 of file usbstd.h.

◆ USB_DT_INTERFACE_POWER

#define USB_DT_INTERFACE_POWER   8

Definition at line 107 of file usbstd.h.

◆ USB_DT_INTERFACE_SIZE

#define USB_DT_INTERFACE_SIZE   9

Definition at line 209 of file usbstd.h.

◆ USB_DT_OTG

#define USB_DT_OTG   9

Definition at line 109 of file usbstd.h.

◆ USB_DT_OTHER_SPEED_CONFIGURATION

#define USB_DT_OTHER_SPEED_CONFIGURATION   7

Definition at line 106 of file usbstd.h.

◆ USB_DT_STRING

#define USB_DT_STRING   3

Definition at line 102 of file usbstd.h.

◆ USB_ENDPOINT_ADDR_IN

#define USB_ENDPOINT_ADDR_IN (   x)    (0x80 | (x))

Definition at line 228 of file usbstd.h.

◆ USB_ENDPOINT_ADDR_OUT

#define USB_ENDPOINT_ADDR_OUT (   x)    (x)

Definition at line 227 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_ADAPTIVE

#define USB_ENDPOINT_ATTR_ADAPTIVE   0x08

Definition at line 240 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_ASYNC

#define USB_ENDPOINT_ATTR_ASYNC   0x04

Definition at line 239 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_BULK

#define USB_ENDPOINT_ATTR_BULK   0x02

Definition at line 234 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_CONTROL

#define USB_ENDPOINT_ATTR_CONTROL   0x00

Definition at line 232 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_DATA

#define USB_ENDPOINT_ATTR_DATA   0x00

Definition at line 244 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_FEEDBACK

#define USB_ENDPOINT_ATTR_FEEDBACK   0x10

Definition at line 245 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_IMPLICIT_FEEDBACK_DATA

#define USB_ENDPOINT_ATTR_IMPLICIT_FEEDBACK_DATA   0x20

Definition at line 246 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_INTERRUPT

#define USB_ENDPOINT_ATTR_INTERRUPT   0x03

Definition at line 235 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_ISOCHRONOUS

#define USB_ENDPOINT_ATTR_ISOCHRONOUS   0x01

Definition at line 233 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_NOSYNC

#define USB_ENDPOINT_ATTR_NOSYNC   0x00

Definition at line 238 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_SYNC

#define USB_ENDPOINT_ATTR_SYNC   0x0C

Definition at line 241 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_SYNCTYPE

#define USB_ENDPOINT_ATTR_SYNCTYPE   0x0C

Definition at line 242 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_TYPE

#define USB_ENDPOINT_ATTR_TYPE   0x03

Definition at line 236 of file usbstd.h.

◆ USB_ENDPOINT_ATTR_USAGETYPE

#define USB_ENDPOINT_ATTR_USAGETYPE   0x30

Definition at line 247 of file usbstd.h.

◆ USB_FEAT_DEVICE_REMOTE_WAKEUP

#define USB_FEAT_DEVICE_REMOTE_WAKEUP   1

Definition at line 115 of file usbstd.h.

◆ USB_FEAT_ENDPOINT_HALT

#define USB_FEAT_ENDPOINT_HALT   0

Definition at line 114 of file usbstd.h.

◆ USB_FEAT_TEST_MODE

#define USB_FEAT_TEST_MODE   2

Definition at line 116 of file usbstd.h.

◆ USB_REQ_CLEAR_FEATURE

#define USB_REQ_CLEAR_FEATURE   1

Definition at line 86 of file usbstd.h.

◆ USB_REQ_GET_CONFIGURATION

#define USB_REQ_GET_CONFIGURATION   8

Definition at line 93 of file usbstd.h.

◆ USB_REQ_GET_DESCRIPTOR

#define USB_REQ_GET_DESCRIPTOR   6

Definition at line 91 of file usbstd.h.

◆ USB_REQ_GET_INTERFACE

#define USB_REQ_GET_INTERFACE   10

Definition at line 95 of file usbstd.h.

◆ USB_REQ_GET_STATUS

#define USB_REQ_GET_STATUS   0

Definition at line 85 of file usbstd.h.

◆ USB_REQ_SET_ADDRESS

#define USB_REQ_SET_ADDRESS   5

Definition at line 90 of file usbstd.h.

◆ USB_REQ_SET_CONFIGURATION

#define USB_REQ_SET_CONFIGURATION   9

Definition at line 94 of file usbstd.h.

◆ USB_REQ_SET_DESCRIPTOR

#define USB_REQ_SET_DESCRIPTOR   7

Definition at line 92 of file usbstd.h.

◆ USB_REQ_SET_FEATURE

#define USB_REQ_SET_FEATURE   3

Definition at line 88 of file usbstd.h.

◆ USB_REQ_SET_INTERFACE

#define USB_REQ_SET_INTERFACE   11

Definition at line 96 of file usbstd.h.

◆ USB_REQ_SET_SYNCH_FRAME

#define USB_REQ_SET_SYNCH_FRAME   12

Definition at line 97 of file usbstd.h.

◆ USB_REQ_TYPE_CLASS

#define USB_REQ_TYPE_CLASS   0x20

Definition at line 75 of file usbstd.h.

◆ USB_REQ_TYPE_DEVICE

#define USB_REQ_TYPE_DEVICE   0x00

Definition at line 79 of file usbstd.h.

◆ USB_REQ_TYPE_DIRECTION

#define USB_REQ_TYPE_DIRECTION   0x80

Definition at line 69 of file usbstd.h.

◆ USB_REQ_TYPE_ENDPOINT

#define USB_REQ_TYPE_ENDPOINT   0x02

Definition at line 81 of file usbstd.h.

◆ USB_REQ_TYPE_IN

#define USB_REQ_TYPE_IN   0x80

Definition at line 70 of file usbstd.h.

◆ USB_REQ_TYPE_INTERFACE

#define USB_REQ_TYPE_INTERFACE   0x01

Definition at line 80 of file usbstd.h.

◆ USB_REQ_TYPE_OTHER

#define USB_REQ_TYPE_OTHER   0x03

Definition at line 82 of file usbstd.h.

◆ USB_REQ_TYPE_OUT

#define USB_REQ_TYPE_OUT   0x0

Definition at line 71 of file usbstd.h.

◆ USB_REQ_TYPE_RECIPIENT

#define USB_REQ_TYPE_RECIPIENT   0x1F

Definition at line 78 of file usbstd.h.

◆ USB_REQ_TYPE_STANDARD

#define USB_REQ_TYPE_STANDARD   0x00

Definition at line 74 of file usbstd.h.

◆ USB_REQ_TYPE_TYPE

#define USB_REQ_TYPE_TYPE   0x60

Definition at line 73 of file usbstd.h.

◆ USB_REQ_TYPE_VENDOR

#define USB_REQ_TYPE_VENDOR   0x40

Definition at line 76 of file usbstd.h.

Enumeration Type Documentation

◆ usb_language_id

Enumerator
USB_LANGID_ENGLISH_US 

Definition at line 272 of file usbstd.h.