Data Structures | |
struct | usb_setup_req_t |
A USB Device SETUP request. More... | |
struct | usb_dev_desc_t |
Standard USB device descriptor stucture. More... | |
struct | usb_dev_qual_desc_t |
Standard USB device qualifier descriptor structure. More... | |
struct | usb_association_desc_t |
Standard USB Interface Association Descriptor structure. More... | |
struct | usb_conf_desc_t |
Standard USB configuration descriptor structure. More... | |
struct | usb_iad_desc_t |
Standard USB association descriptor structure. More... | |
struct | usb_iface_desc_t |
Standard USB interface descriptor structure. More... | |
struct | usb_ep_desc_t |
Standard USB endpoint descriptor stcuture. More... | |
struct | usb_str_desc_t |
A standard USB string descriptor sructure. More... | |
struct | usb_str_lgid_desc_t |
Defines | |
#define | USB_V2_0 0x0200 |
Value for field bcdUSB. | |
#define | USB_REQ_DIR_OUT (0<<7) |
USB request data transfer direction (bmRequestType). | |
#define | USB_REQ_DIR_IN (1<<7) |
Device to host. | |
#define | USB_REQ_DIR_MASK (1<<7) |
Mask. | |
#define | USB_REQ_TYPE_STANDARD (0<<5) |
USB request types (bmRequestType). | |
#define | USB_REQ_TYPE_CLASS (1<<5) |
Class-specific request. | |
#define | USB_REQ_TYPE_VENDOR (2<<5) |
Vendor-specific request. | |
#define | USB_REQ_TYPE_MASK (3<<5) |
Mask. | |
#define | USB_REQ_RECIP_DEVICE (0<<0) |
USB recipient codes (bmRequestType). | |
#define | USB_REQ_RECIP_INTERFACE (1<<0) |
Recipient interface. | |
#define | USB_REQ_RECIP_ENDPOINT (2<<0) |
Recipient endpoint. | |
#define | USB_REQ_RECIP_OTHER (3<<0) |
Recipient other. | |
#define | USB_REQ_RECIP_MASK (0x1F) |
Mask. | |
#define | USB_EP_ADDR_MASK 0x0f |
Mask selecting the index part of an endpoint address. | |
#define | USB_EP_DIR_IN 0x80 |
Endpoint transfer direction is IN. | |
#define | USB_EP_DIR_OUT 0x00 |
Endpoint transfer direction is OUT. | |
#define | USB_MAX_DESC_LEN 255 |
Maximum length in bytes of a USB descriptor. | |
#define | USB_CONFIG_ATTR_MUST_SET (1 << 7) |
Must always be set. | |
#define | USB_CONFIG_ATTR_BUS_POWERED (0 << 6) |
Bus-powered. | |
#define | USB_CONFIG_ATTR_SELF_POWERED (1 << 6) |
Self-powered. | |
#define | USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) |
remote wakeup supported | |
#define | USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) |
Max power in mA. | |
Enumerations | |
enum | usb_reqid { USB_REQ_GET_STATUS = 0, USB_REQ_CLEAR_FEATURE = 1, USB_REQ_SET_FEATURE = 3, USB_REQ_SET_ADDRESS = 5, USB_REQ_GET_DESCRIPTOR = 6, USB_REQ_SET_DESCRIPTOR = 7, USB_REQ_GET_CONFIGURATION = 8, USB_REQ_SET_CONFIGURATION = 9, USB_REQ_GET_INTERFACE = 10, USB_REQ_SET_INTERFACE = 11, USB_REQ_SYNCH_FRAME = 12 } |
Standard USB requests (bRequest). | |
enum | usb_device_status { USB_DEV_STATUS_BUS_POWERED = 0, USB_DEV_STATUS_SELF_POWERED = 1, USB_DEV_STATUS_REMOTEWAKEUP = 2 } |
Standard USB device status flags. | |
enum | usb_interface_status { USB_IFACE_STATUS_RESERVED = 0 } |
Standard USB Interface status flags. | |
enum | usb_endpoint_status { USB_EP_STATUS_HALTED = 1 } |
Standard USB endpoint status flags. | |
enum | usb_device_feature { USB_DEV_FEATURE_REMOTE_WAKEUP = 1, USB_DEV_FEATURE_TEST_MODE = 2, USB_DEV_FEATURE_OTG_B_HNP_ENABLE = 3, USB_DEV_FEATURE_OTG_A_HNP_SUPPORT = 4, USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT = 5 } |
Standard USB device feature flags. More... | |
enum | usb_device_hs_test_mode { USB_DEV_TEST_MODE_J = 1, USB_DEV_TEST_MODE_K = 2, USB_DEV_TEST_MODE_SE0_NAK = 3, USB_DEV_TEST_MODE_PACKET = 4, USB_DEV_TEST_MODE_FORCE_ENABLE = 5 } |
Test Mode possible on HS USB device. More... | |
enum | usb_endpoint_feature { USB_EP_FEATURE_HALT = 0 } |
Standard USB endpoint feature/status flags. | |
enum | usb_test_mode_selector { USB_TEST_J = 0x01, USB_TEST_K = 0x02, USB_TEST_SE0_NAK = 0x03, USB_TEST_PACKET = 0x04, USB_TEST_FORCE_ENABLE = 0x05 } |
Standard USB Test Mode Selectors. | |
enum | usb_descriptor_type { USB_DT_DEVICE = 1, USB_DT_CONFIGURATION = 2, USB_DT_STRING = 3, USB_DT_INTERFACE = 4, USB_DT_ENDPOINT = 5, USB_DT_DEVICE_QUALIFIER = 6, USB_DT_OTHER_SPEED_CONFIGURATION = 7, USB_DT_INTERFACE_POWER = 8, USB_DT_OTG = 9, USB_DT_IAD = 0x0B } |
Standard USB descriptor types. | |
enum | usb_ep_type { USB_EP_TYPE_CONTROL = 0x00, USB_EP_TYPE_ISOCHRONOUS = 0x01, USB_EP_TYPE_BULK = 0x02, USB_EP_TYPE_INTERRUPT = 0x03, USB_EP_TYPE_MASK = 0x03 } |
Standard USB endpoint transfer types. | |
enum | usb_langid { USB_LANGID_EN_US = 0x0409 } |
Standard USB language IDs for string descriptors. More... | |
Variables | |
enum usb_reqid | __attribute__ |
Standard USB requests (bRequest). | |
Generic definitions (Class, subclass and protocol) | |
| |
#define | NO_CLASS 0x00 |
#define | NO_SUBCLASS 0x00 |
#define | NO_PROTOCOL 0x00 |
IAD (Interface Association Descriptor) constants | |
| |
#define | CLASS_IAD 0xEF |
#define | SUB_CLASS_IAD 0x02 |
#define | PROTOCOL_IAD 0x01 |
Apple VID & PID for host application | |
| |
#define | USB_VID_APPLE 0x05AC |
#define | USB_PID_IPOD 0x1200 |
#define | USB_PID_IPOD_SHUFFLE 0x1300 |
This module defines constants and data structures provided by the USB 2.0 specification.
#define USB_MAX_DESC_LEN 255 |
Maximum length in bytes of a USB descriptor.
The maximum length of a USB descriptor is limited by the 8-bit bLength field.
Definition at line 245 of file USBD_Protocol.h.
#define USB_REQ_DIR_OUT (0<<7) |
USB request data transfer direction (bmRequestType).
Host to device
Definition at line 84 of file USBD_Protocol.h.
#define USB_REQ_RECIP_DEVICE (0<<0) |
USB recipient codes (bmRequestType).
Recipient device
Definition at line 99 of file USBD_Protocol.h.
#define USB_REQ_TYPE_STANDARD (0<<5) |
#define USB_V2_0 0x0200 |
Value for field bcdUSB.
USB Specification version 2.00
Definition at line 57 of file USBD_Protocol.h.
enum usb_device_feature |
Standard USB device feature flags.
USB_DEV_FEATURE_REMOTE_WAKEUP |
Remote wakeup enabled. |
USB_DEV_FEATURE_TEST_MODE |
USB test mode. |
Definition at line 153 of file USBD_Protocol.h.
Test Mode possible on HS USB device.
Definition at line 166 of file USBD_Protocol.h.
enum usb_langid |
Standard USB language IDs for string descriptors.
Definition at line 222 of file USBD_Protocol.h.
struct _USBEndpointDescriptor __attribute__ |
Standard USB requests (bRequest).
SBCTestUnitReady Data structure for the TEST UNIT READY command.
Audio header descriptor with 2 interface
Feature unit descriptor with 3 channel controls (master, right, left).
List of descriptors for detailing the audio control interface of a device using a USB audio speaker function.
List of descriptors for detailing the audio control interface of a device using a USB Audio Speakerphoneer function.
Format type I descriptor with one discrete sampling frequency.
Configuration descriptor list for a device implementing CDC(Serial) + Audio(Speaker) composite driver.
Configuration descriptor list for a device implementing CDC(Serial) + Audio(SpeakerPhone) composite driver.
USB CDC SerialState struct (bitmap)
List of descriptors for detailing the audio control interface of a device using a USB audio speaker driver.
HID Physical Descriptor set 0: specifies the number of additional descriptor sets.
HID Physical Descriptor