This module defines constants and data structures provided by the USB 2.0 specification.
Modules | |
USB Personal Healthcare Device Class (PHDC) | |
protocol definitions | |
USB Mass Storage Class (MSC) protocol definitions | |
USB Vendor Class definitions | |
USB Human Interface Device (HID) | |
protocol definitions | |
Communication Device Class Definitions | |
USB Android Open Accessory | |
Data Structures | |
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_dev_bos_desc_t |
USB Device BOS descriptor structure. More... | |
struct | usb_dev_capa_ext_desc_t |
USB Device Capabilities - USB 2.0 Extension Descriptor structure. More... | |
struct | usb_dev_desc_t |
Standard USB device descriptor structure. More... | |
struct | usb_dev_lpm_desc_t |
USB Device LPM Descriptor structure. More... | |
struct | usb_dev_qual_desc_t |
Standard USB device qualifier descriptor structure. More... | |
struct | usb_ep_desc_t |
Standard USB endpoint 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_setup_req_t |
A USB Device SETUP request. More... | |
struct | usb_str_desc_t |
A standard USB string descriptor structure. More... | |
struct | usb_str_lgid_desc_t |
Macros | |
#define | HIRD_1025_US 13 |
#define | HIRD_1100_US 14 |
#define | HIRD_1175_US 15 |
#define | HIRD_125_US 1 |
#define | HIRD_200_US 2 |
#define | HIRD_275_US 3 |
#define | HIRD_350_US 4 |
#define | HIRD_425_US 5 |
#define | HIRD_500_US 6 |
#define | HIRD_50_US 0 |
#define | HIRD_575_US 7 |
#define | HIRD_650_US 8 |
#define | HIRD_725_US 9 |
#define | HIRD_800_US 10 |
#define | HIRD_875_US 11 |
#define | HIRD_950_US 12 |
#define | USB_CONFIG_ATTR_BUS_POWERED (0 << 6) |
Bus-powered. More... | |
#define | USB_CONFIG_ATTR_MUST_SET (1 << 7) |
Must always be set. More... | |
#define | USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) |
remote wakeup supported More... | |
#define | USB_CONFIG_ATTR_SELF_POWERED (1 << 6) |
Self-powered. More... | |
#define | USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) |
Max power in mA. More... | |
#define | USB_EP_ADDR_MASK 0x0f |
Mask selecting the index part of an endpoint address. More... | |
#define | USB_EP_DIR_IN 0x80 |
Endpoint transfer direction is IN. More... | |
#define | USB_EP_DIR_OUT 0x00 |
Endpoint transfer direction is OUT. More... | |
#define | USB_LPM_ATTRIBUT_BLINKSTATE(value) ((value & 0xF) << 0) |
#define | USB_LPM_ATTRIBUT_BLINKSTATE_L1 USB_LPM_ATTRIBUT_BLINKSTATE(1) |
#define | USB_LPM_ATTRIBUT_BLINKSTATE_MASK (0xF << 0) |
Fields definition from a LPM TOKEN. More... | |
#define | USB_LPM_ATTRIBUT_FIRD(value) ((value & 0xF) << 4) |
#define | USB_LPM_ATTRIBUT_FIRD_MASK (0xF << 4) |
#define | USB_LPM_ATTRIBUT_REMOTEWAKE(value) ((value & 1) << 8) |
#define | USB_LPM_ATTRIBUT_REMOTEWAKE_MASK (1 << 8) |
#define | USB_MAX_DESC_LEN 255 |
Maximum length in bytes of a USB descriptor. More... | |
#define | USB_REQ_DIR_IN (1<<7) |
Device to host. More... | |
#define | USB_REQ_DIR_MASK (1<<7) |
Mask. More... | |
#define | USB_REQ_DIR_OUT (0<<7) |
USB request data transfer direction (bmRequestType) More... | |
#define | USB_REQ_RECIP_DEVICE (0<<0) |
USB recipient codes (bmRequestType) More... | |
#define | USB_REQ_RECIP_ENDPOINT (2<<0) |
Recipient endpoint. More... | |
#define | USB_REQ_RECIP_INTERFACE (1<<0) |
Recipient interface. More... | |
#define | USB_REQ_RECIP_MASK (0x1F) |
Mask. More... | |
#define | USB_REQ_RECIP_OTHER (3<<0) |
Recipient other. More... | |
#define | USB_REQ_TYPE_CLASS (1<<5) |
Class-specific request. More... | |
#define | USB_REQ_TYPE_MASK (3<<5) |
Mask. More... | |
#define | USB_REQ_TYPE_STANDARD (0<<5) |
USB request types (bmRequestType) More... | |
#define | USB_REQ_TYPE_VENDOR (2<<5) |
Vendor-specific request. More... | |
#define | USB_V2_0 0x0200 |
Value for field bcdUSB. More... | |
#define | USB_V2_1 0x0201 |
USB Specification version 2.01. More... | |
Typedefs | |
typedef uint8_t | usb_add_t |
USB address identifier. More... | |
typedef uint8_t | usb_ep_t |
Endpoint identifier. More... | |
Generic definitions (Class, subclass and protocol) | |
#define | NO_CLASS 0x00 |
#define | CLASS_VENDOR_SPECIFIC 0xFF |
#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 |
#define CLASS_IAD 0xEF |
#define CLASS_VENDOR_SPECIFIC 0xFF |
Referenced by uhi_aoa_install().
#define HIRD_1025_US 13 |
#define HIRD_1100_US 14 |
#define HIRD_1175_US 15 |
#define HIRD_125_US 1 |
#define HIRD_200_US 2 |
#define HIRD_275_US 3 |
#define HIRD_350_US 4 |
#define HIRD_425_US 5 |
#define HIRD_500_US 6 |
#define HIRD_50_US 0 |
#define HIRD_575_US 7 |
#define HIRD_650_US 8 |
#define HIRD_725_US 9 |
#define HIRD_800_US 10 |
#define HIRD_875_US 11 |
#define HIRD_950_US 12 |
#define NO_CLASS 0x00 |
#define NO_PROTOCOL 0x00 |
#define NO_SUBCLASS 0x00 |
#define PROTOCOL_IAD 0x01 |
#define SUB_CLASS_IAD 0x02 |
#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) |
Bus-powered.
#define USB_CONFIG_ATTR_MUST_SET (1 << 7) |
Must always be set.
#define USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) |
remote wakeup supported
Referenced by uhc_remotewakeup().
#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) |
Self-powered.
Referenced by uhc_enumeration_step13().
#define USB_CONFIG_MAX_POWER | ( | ma | ) | (((ma) + 1) / 2) |
Max power in mA.
#define USB_EP_ADDR_MASK 0x0f |
Mask selecting the index part of an endpoint address.
Referenced by udi_phdc_metadata_ack(), udi_phdc_preamplemsg_ack(), udi_phdc_send_metadata(), udi_phdc_send_preamplemsg(), and uhd_ep_alloc().
#define USB_EP_DIR_IN 0x80 |
Endpoint transfer direction is IN.
Referenced by main_transfer_done(), uhd_ep_alloc(), uhi_aoa_install(), uhi_cdc_install(), uhi_hid_mouse_install(), and uhi_vendor_install().
#define USB_EP_DIR_OUT 0x00 |
Endpoint transfer direction is OUT.
#define USB_LPM_ATTRIBUT_BLINKSTATE | ( | value | ) | ((value & 0xF) << 0) |
#define USB_LPM_ATTRIBUT_BLINKSTATE_L1 USB_LPM_ATTRIBUT_BLINKSTATE(1) |
#define USB_LPM_ATTRIBUT_BLINKSTATE_MASK (0xF << 0) |
Fields definition from a LPM TOKEN.
#define USB_LPM_ATTRIBUT_FIRD | ( | value | ) | ((value & 0xF) << 4) |
#define USB_LPM_ATTRIBUT_FIRD_MASK (0xF << 4) |
#define USB_LPM_ATTRIBUT_REMOTEWAKE | ( | value | ) | ((value & 1) << 8) |
#define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK (1 << 8) |
#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.
#define USB_REQ_DIR_IN (1<<7) |
Device to host.
Referenced by udi_cdc_comm_enable(), uhc_dev_get_string(), uhc_dev_is_high_speed_support(), uhc_enumeration_step11(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_enumeration_step5(), uhd_ctrl_interrupt(), uhi_aoa_mode_enable_step1(), uhi_msc_enable_step1(), and uhi_vendor_control_in_run().
#define USB_REQ_DIR_MASK (1<<7) |
Mask.
Referenced by uhd_ctrl_interrupt().
#define USB_REQ_DIR_OUT (0<<7) |
USB request data transfer direction (bmRequestType)
Host to device
Referenced by uhc_enumeration_step14(), uhc_enumeration_step9(), uhc_remotewakeup(), uhi_aoa_mode_enable_step3(), uhi_aoa_register_hid(), uhi_aoa_send_hid_event(), uhi_aoa_send_info_string(), uhi_aoa_unregister_hid(), uhi_cdc_set_conf(), uhi_cdc_set_ctrl_line(), and uhi_msc_reset_endpoint().
#define USB_REQ_RECIP_DEVICE (0<<0) |
USB recipient codes (bmRequestType)
Recipient device
Referenced by udc_reqstd(), uhc_dev_get_string(), uhc_dev_is_high_speed_support(), uhc_enumeration_step11(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_enumeration_step14(), uhc_enumeration_step5(), uhc_enumeration_step9(), uhc_remotewakeup(), uhi_aoa_mode_enable_step1(), uhi_aoa_mode_enable_step3(), uhi_aoa_register_hid(), uhi_aoa_send_hid_event(), uhi_aoa_send_info_string(), and uhi_aoa_unregister_hid().
#define USB_REQ_RECIP_ENDPOINT (2<<0) |
Recipient endpoint.
Referenced by udc_process_setup(), udc_reqstd(), and uhi_msc_reset_endpoint().
#define USB_REQ_RECIP_INTERFACE (1<<0) |
Recipient interface.
Referenced by udc_process_setup(), udc_reqstd(), udi_cdc_comm_enable(), uhi_cdc_set_conf(), uhi_cdc_set_ctrl_line(), uhi_msc_enable_step1(), uhi_vendor_control_in_run(), uhi_vendor_control_out_run(), and uhi_vendor_enable().
#define USB_REQ_RECIP_MASK (0x1F) |
Mask.
#define USB_REQ_RECIP_OTHER (3<<0) |
Recipient other.
#define USB_REQ_TYPE_CLASS (1<<5) |
Class-specific request.
Referenced by udi_cdc_comm_enable(), udi_cdc_comm_setup(), udi_hid_setup(), udi_msc_setup(), udi_phdc_setup(), uhi_cdc_set_conf(), uhi_cdc_set_ctrl_line(), and uhi_msc_enable_step1().
#define USB_REQ_TYPE_MASK (3<<5) |
Mask.
#define USB_REQ_TYPE_STANDARD (0<<5) |
USB request types (bmRequestType)
Standard request
Referenced by udc_process_setup(), udi_hid_setup(), uhc_dev_get_string(), uhc_dev_is_high_speed_support(), uhc_enumeration_step11(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_enumeration_step14(), uhc_enumeration_step5(), uhc_enumeration_step9(), uhc_remotewakeup(), and uhi_msc_reset_endpoint().
#define USB_REQ_TYPE_VENDOR (2<<5) |
Vendor-specific request.
Referenced by udi_vendor_setup(), uhi_aoa_mode_enable_step1(), uhi_aoa_mode_enable_step3(), uhi_aoa_register_hid(), uhi_aoa_send_hid_event(), uhi_aoa_send_info_string(), uhi_aoa_unregister_hid(), uhi_vendor_control_in_run(), and uhi_vendor_control_out_run().
#define USB_V2_0 0x0200 |
Value for field bcdUSB.
USB Specification version 2.00
#define USB_V2_1 0x0201 |
USB Specification version 2.01.
Referenced by uhc_enumeration_step15().
typedef uint8_t usb_add_t |
USB address identifier.
typedef uint8_t usb_ep_t |
Endpoint identifier.
enum usb_capability_type |
enum usb_descriptor_type |
enum usb_device_feature |
enum usb_device_status |
enum usb_endpoint_feature |
enum usb_endpoint_status |
enum usb_ep_type |
enum usb_interface_status |
enum usb_langid |
enum usb_reqid |