USB protocol definitions. More...
#include <types.h>Go to the source code of this file.
Data Structures | |
| struct | usb_setup_req |
| A USB Device SETUP request. More... | |
| struct | usb_device_descriptor |
| Standard USB device descriptor. More... | |
| struct | usb_device_qualifier_descriptor |
| Standard USB device qualifier descriptor. More... | |
| struct | usb_configuration_descriptor |
| Standard USB configuration descriptor. More... | |
| struct | usb_interface_descriptor |
| Standard USB interface descriptor. More... | |
| struct | usb_endpoint_descriptor |
| Standard USB endpoint descriptor. More... | |
| struct | usb_string_descriptor |
| A standard USB string descriptor. More... | |
Defines | |
| #define | USB_EP_ADDR_MASK 0x0f |
| Mask selecting the index part of an endpoint address. | |
| #define | USB_DIR_IN 0x80 |
| Endpoint transfer direction is IN. | |
| #define | USB_DIR_OUT 0x00 |
| Endpoint transfer direction is OUT. | |
| #define | USB_MAX_DESC_LEN 255 |
| Maximum length in bytes of a USB descriptor. | |
| #define | usb_setup_is_in(req) (!!((req)->bmRequestType & USB_DIR_IN)) |
| Return true if the setup request req indicates IN data transfer. | |
| #define | usb_setup_is_out(req) (!((req)->bmRequestType & USB_DIR_IN)) |
| Return true if the setup request req indicates OUT data transfer. | |
| #define | usb_setup_type(req) (((req)->bmRequestType >> 5) & 3) |
| Return the type of the SETUP request req. | |
| #define | usb_setup_recipient(req) ((req)->bmRequestType & 0x1f) |
| Return the recipient of the SETUP request req. | |
| #define | USB_CONFIG_ATTR_MUST_SET (1U << 7) |
| Must always be set. | |
| #define | USB_CONFIG_ATTR_SELF_POWERED (1U << 6) |
| Self-powered. | |
| #define | USB_CONFIG_ATTR_REMOTE_WAKEUP (1U << 5) |
| Supports remote wakeup. | |
| #define | USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) |
| Max power in mA. | |
| #define | usb_ep_index(desc) ((desc)->bEndpointAddress & USB_EP_ADDR_MASK) |
| Return the index of the endpoint represented by desc. | |
| #define | usb_ep_is_in(desc) (!!((desc)->bEndpointAddress & USB_DIR_IN)) |
| Return true if desc represents an IN endpoint. | |
| #define | usb_ep_is_out(desc) (!((desc)->bEndpointAddress & USB_DIR_IN)) |
| Return true if desc represents an OUT endpoint. | |
| #define | usb_ep_xfer(desc) ((desc)->bmAttributes & 0x03) |
| Return the transfer type of the endpoint represented by desc. | |
Enumerations | |
| enum | usb_device_state { USB_STATE_ATTACHED = 0, USB_STATE_POWERED, USB_STATE_DEFAULT, USB_STATE_ADDRESS, USB_STATE_CONFIGURED, USB_STATE_SUSPENDED = 0x80 } |
USB device state. More... | |
| enum | usb_device_speed { USB_SPEED_UNKNOWN = 0, USB_SPEED_LOW, USB_SPEED_FULL, USB_SPEED_HIGH } |
USB device speed. More... | |
| enum | usb_reqtype { USB_REQTYPE_STANDARD = 0, USB_REQTYPE_CLASS = 1, USB_REQTYPE_VENDOR = 2 } |
USB request types (bmRequestType). More... | |
| enum | usb_recipient |
USB recipient codes (bmRequestType). More... | |
| enum | usb_reqid |
Standard USB requests (bRequest). More... | |
| enum | usb_device_feature { USB_DEV_STATUS_SELF_POWERED = 0, USB_DEV_FEATURE_REMOTE_WAKEUP = 1, USB_DEV_FEATURE_TEST_MODE = 2 } |
Standard USB device feature/status flags. More... | |
| enum | usb_endpoint_feature |
Standard USB endpoint feature/status flags. More... | |
| enum | usb_test_mode_selector |
Standard USB Test Mode Selectors. More... | |
| enum | usb_descriptor_type |
Standard USB descriptor types. More... | |
| enum | usb_ep_xfer_type |
Standard USB endpoint transfer types. More... | |
| enum | usb_langid { USB_LANGID_EN_US = 0x0406 } |
Standard USB language IDs for string descriptors. More... | |
USB protocol definitions.
This file contains definitions and data structures taken from the USB 2.0 specification.
Copyright (C) 2009 Atmel Corporation. All rights reserved.
Definition in file usb_protocol.h.
1.6.3