43 TUSB_ROLE_INVALID = 0,
44 TUSB_ROLE_DEVICE = 0x1,
222#define TUSB_DESC_CONFIG_POWER_MA(x) ((x)/2)
291TU_ATTR_BIT_FIELD_ORDER_BEGIN
495TU_ATTR_BIT_FIELD_ORDER_END
508 return (uint8_t)(addr & (~TUSB_DIR_IN_MASK));
511TU_ATTR_ALWAYS_INLINE
static inline uint8_t
tu_edpt_addr(uint8_t num, uint8_t dir) {
521 tu_static
const char *str[] = {
"control",
"isochronous",
"bulk",
"interrupt"};
532 uint8_t
const* desc8 = (uint8_t
const*)
desc;
547uint8_t
const *
tu_desc_find(uint8_t
const*
desc, uint8_t
const* end, uint8_t byte1);
550uint8_t
const *
tu_desc_find2(uint8_t
const*
desc, uint8_t
const* end, uint8_t byte1, uint8_t byte2);
553uint8_t
const *
tu_desc_find3(uint8_t
const*
desc, uint8_t
const* end, uint8_t byte1, uint8_t byte2, uint8_t byte3);
static usb_descriptor_buffers_t desc
AUDIO Channel Cluster Descriptor (4.1)
uint8_t iFunction
Index of the string descriptor describing the interface association.
uint8_t bFunctionSubClass
Interface subclass ID.
uint8_t bFunctionClass
Interface class ID.
uint8_t bNumInterfaces
Number of interfaces supported by this configuration.
uint8_t bConfigurationValue
Value to use as an argument to the SetConfiguration() request to select this configuration.
uint8_t iConfiguration
Index of string descriptor describing this configuration.
uint8_t bitManifestationTolerant
uint8_t bNumConfigurations
Number of possible configurations.
uint8_t type
Request type tusb_request_type_t.
uint16_t wTotalLength
Total number of bytes returned for the class-specific AudioControl interface descriptor....
uint16_t idProduct
Product ID (assigned by the manufacturer).
uint8_t iSerialNumber
Index of string descriptor describing the device's serial number.
uint8_t bDeviceProtocol
Protocol code (assigned by the USB-IF).
struct TU_ATTR_PACKED::@16::TU_ATTR_PACKED bmRequestType_bit
uint8_t bmAttributes
See: audio_clock_source_attribute_t.
uint8_t bDeviceClass
Class code (assigned by the USB-IF).
uint8_t PlatformCapabilityUUID[16]
uint16_t idVendor
Vendor ID (assigned by the USB-IF).
uint8_t direction
Direction type. tusb_dir_t.
uint8_t bDeviceSubClass
Subclass code (assigned by the USB-IF).
uint8_t iManufacturer
Index of string descriptor describing manufacturer.
uint8_t bInterfaceCount
Total number of associated interfaces.
uint8_t bDescriptorType
Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
uint8_t bDevCapabilityType
uint8_t bFunctionProtocol
Interface protocol ID.
uint8_t iInterface
Index of string descriptor describing this interface.
uint8_t bInterfaceClass
Class code (assigned by the USB-IF).
uint8_t bLength
Size of this descriptor in bytes: 9.
uint8_t bMaxPower
Maximum power consumption of the USB device from the bus in this specific configuration when the devi...
uint8_t iProduct
Index of string descriptor describing product.
uint8_t bMaxPacketSize0
Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid). For HS devices is fixed to 6...
uint16_t unicode_string[]
uint8_t bInterfaceSubClass
Subclass code (assigned by the USB-IF). These codes are qualified by the value of the bInterfaceCla...
uint8_t recipient
Recipient type tusb_request_recipient_t.
uint16_t bcdUSB
BUSB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H).
uint8_t bRequest
Request type audio_cs_req_t.
uint8_t bReserved
Reserved for future use, must be zero.
uint16_t bcdDevice
Device release number in binary-coded decimal.
uint8_t bNumEndpoints
Number of endpoints used by this interface (excluding endpoint zero). If this value is zero,...
uint8_t bInterfaceProtocol
Protocol code (assigned by the USB). These codes are qualified by the value of the bInterfaceClass ...
uint8_t bFirstInterface
Index of the first associated interface.
uint8_t bInterfaceNumber
Number of this interface. Zero-based value identifying the index in the array of concurrent interface...
uint8_t bAlternateSetting
Value used to select this alternate setting for the interface identified in the prior field.
uint8_t bNumDeviceCaps
Number of device capability descriptors in the BOS.
struct TU_ATTR_PACKED tusb_desc_string_t
uint8_t const * tu_desc_find(uint8_t const *desc, uint8_t const *end, uint8_t byte1)
@ TUSB_REQ_GET_DESCRIPTOR
@ TUSB_REQ_SET_CONFIGURATION
@ TUSB_REQ_GET_CONFIGURATION
@ TUSB_REQ_SET_DESCRIPTOR
uint8_t const * tu_desc_find2(uint8_t const *desc, uint8_t const *end, uint8_t byte1, uint8_t byte2)
uint8_t const * tu_desc_find3(uint8_t const *desc, uint8_t const *end, uint8_t byte1, uint8_t byte2, uint8_t byte3)
tusb_speed_t
defined base on EHCI specs value for Endpoint Speed
@ TUSB_CLASS_CONTENT_SECURITY
@ TUSB_CLASS_WIRELESS_CONTROLLER
@ TUSB_CLASS_APPLICATION_SPECIFIC
@ TUSB_CLASS_VENDOR_SPECIFIC
@ TUSB_CLASS_PERSONAL_HEALTHCARE
struct TU_ATTR_PACKED tusb_control_request_t
static TU_ATTR_ALWAYS_INLINE uint8_t tu_edpt_number(uint8_t addr)
tusb_iso_ep_attribute_t
Isochronous Endpoint Attributes.
@ TUSB_ISO_EP_ATT_IMPLICIT_FB
Data endpoint that also serves as an implicit feedback.
@ TUSB_ISO_EP_ATT_ASYNCHRONOUS
@ TUSB_ISO_EP_ATT_NO_SYNC
@ TUSB_ISO_EP_ATT_SYNCHRONOUS
@ TUSB_ISO_EP_ATT_EXPLICIT_FB
Feedback End Point.
@ TUSB_ISO_EP_ATT_ADAPTIVE
@ TUSB_ISO_EP_ATT_DATA
Data End Point.
struct TU_ATTR_PACKED tusb_desc_bos_t
@ TUSB_FEATURE_TEST_FORCE_ENABLE
@ TUSB_FEATURE_TEST_SE0_NAK
@ TUSB_FEATURE_TEST_PACKET
static TU_ATTR_ALWAYS_INLINE uint8_t tu_desc_len(void const *desc)
struct TU_ATTR_PACKED tusb_desc_device_qualifier_t
USB Device Qualifier Descriptor.
@ TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP
@ TUSB_DESC_CONFIG_ATT_SELF_POWERED
struct TU_ATTR_PACKED tusb_desc_webusb_url_t
TU_ATTR_PACKED_BEGIN TU_ATTR_BIT_FIELD_ORDER_BEGIN struct TU_ATTR_PACKED tusb_desc_device_t
USB Device Descriptor.
struct TU_ATTR_PACKED tusb_desc_other_speed_t
USB Other Speed Configuration Descriptor.
@ INTERFACE_INVALID_NUMBER
static TU_ATTR_ALWAYS_INLINE const char * tu_edpt_type_str(tusb_xfer_type_t t)
@ TUSB_REQ_RCPT_INTERFACE
static TU_ATTR_ALWAYS_INLINE uint16_t tu_edpt_packet_size(tusb_desc_endpoint_t const *desc_ep)
tusb_xfer_type_t
defined base on USB Specs Endpoint's bmAttributes
TU_ATTR_PACKED_END TU_ATTR_BIT_FIELD_ORDER_END static TU_ATTR_ALWAYS_INLINE tusb_dir_t tu_edpt_dir(uint8_t addr)
struct TU_ATTR_PACKED tusb_desc_endpoint_t
USB Endpoint Descriptor.
struct TU_ATTR_PACKED tusb_desc_bos_platform_t
struct TU_ATTR_PACKED tusb_desc_interface_assoc_t
USB Interface Association Descriptor (IAD ECN)
static TU_ATTR_ALWAYS_INLINE uint8_t tu_edpt_addr(uint8_t num, uint8_t dir)
static TU_ATTR_ALWAYS_INLINE uint8_t tu_desc_type(void const *desc)
struct TU_ATTR_PACKED tusb_desc_dfu_functional_t
struct TU_ATTR_PACKED tusb_desc_interface_t
USB Interface Descriptor.
static TU_ATTR_ALWAYS_INLINE uint8_t const * tu_desc_next(void const *desc)
tusb_desc_type_t
USB Descriptor Types.
@ TUSB_DESC_SUPERSPEED_ENDPOINT_COMPANION
@ TUSB_DESC_INTERFACE_ASSOCIATION
@ TUSB_DESC_CONFIGURATION
@ TUSB_DESC_INTERFACE_POWER
@ TUSB_DESC_DEVICE_QUALIFIER
@ TUSB_DESC_SUPERSPEED_ISO_ENDPOINT_COMPANION
@ TUSB_DESC_CS_CONFIGURATION
@ TUSB_DESC_OTHER_SPEED_CONFIG
@ TUSB_DESC_DEVICE_CAPABILITY
tusb_request_feature_selector_t
@ TUSB_REQ_FEATURE_EDPT_HALT
@ TUSB_REQ_FEATURE_REMOTE_WAKEUP
@ TUSB_REQ_FEATURE_TEST_MODE
TU_VERIFY_STATIC(sizeof(tusb_desc_device_t)==18, "size is not correct")
struct TU_ATTR_PACKED tusb_desc_configuration_t
USB Configuration Descriptor.
@ DEVICE_CAPABILITY_PRECESION_TIME_MEASUREMENT
@ DEVICE_CAPABILITY_USB20_EXTENSION
@ DEVICE_CAPABILITY_CONTAINER_id
@ DEVICE_CAPABILITY_PD_PROVIDER_PORT
@ DEVICE_CAPABILITY_PLATFORM
@ DEVICE_CAPABILITY_CONFIGURATION_SUMMARY
@ DEVICE_CAPABILITY_SUPERSPEED_USB
@ DEVICE_CAPABILITY_WIRELESS_USB
@ DEVICE_CAPABILITY_BATTERY_INFO
@ DEVICE_CAPABILITY_PD_CONSUMER_PORT
@ DEVICE_CAPABILITY_AUTHENTICATION
@ DEVICE_CAPABILITY_BILLBOARD_EX
@ DEVICE_CAPABILITY_POWER_DELIVERY
@ DEVICE_CAPABILITY_BILLBOARD
@ DEVICE_CAPABILITY_WIRELESS_USB_EXT
@ DEVICE_CAPABILITY_SUPERSPEED_PLUS
@ MS_OS_20_SUBSET_HEADER_FUNCTION
@ MS_OS_20_FEATURE_VENDOR_REVISION
@ MS_OS_20_FEATURE_MIN_RESUME_TIME
@ MS_OS_20_FEATURE_CCGP_DEVICE
@ MS_OS_20_FEATURE_COMPATBLE_ID
@ MS_OS_20_SET_HEADER_DESCRIPTOR
@ MS_OS_20_FEATURE_MODEL_ID
@ MS_OS_20_FEATURE_REG_PROPERTY
@ MS_OS_20_SUBSET_HEADER_CONFIGURATION
@ APP_SUBCLASS_DFU_RUNTIME