EasyManua.ls Logo

Espressif ESP32-S2 - Page 507

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
Given a configuration descriptor, get an endpoint descriptor based on its bEndpointAddress, bAlternateSet-
ting, and bInterfaceNumber.
Return const usb_ep_desc_t* Pointer to endpoint descriptor, NULL if not found.
Parameters
[in] config_desc: Pointer to the start of a full configuration descriptor
[in] bInterfaceNumber: Interface number
[in] bAlternateSetting: Alternate setting number
[in] bEndpointAddress: Endpoint address
[out] offset: Byte offset of the endpoint descriptor relative to the start of the configuration
descriptor. Can be NULL
static int usb_round_up_to_mps(int num_bytes, int mps)
Round up to an integer multiple of endpoints MPS.
This is a convenience function to round up a size/length to an endpoints MPS (Maximum packet size). This
is useful when calculating transfer or buffer lengths of IN endpoints.
Return int Round up integer multiple of MPS
Parameters
[in] num_bytes: Number of bytes
[in] mps: MPS
esp_err_t usb_print_descriptors(usb_device_handle_t device, print_class_descriptor_cb
class_specific_cb)
Prints usb descriptors.
Return esp_err_t
Parameters
[in] device: Handle to device
[in] class_specific_cb: Optional callback to print class specific descriptors
Type Definitions
typedef void (*print_class_descriptor_cb)(const usb_standard_desc_t *)
Print class specic descriptor callback.
Optional callback to be provided to usb_print_descriptors() function. The callback is called when when a
non-standard descriptor is encountered. The callback should decode the descriptor as print it.
Header File
components/usb/include/usb/usb_types_stack.h
Structures
struct usb_device_info_t
Basic information of an enumerated device.
Public Members
usb_speed_t speed
Devices speed
uint8_t dev_addr
Devices address
uint8_t bMaxPacketSize0
The maximum packet size of the devices default endpoint
uint8_t bConfigurationValue
Devices current configuration number
Espressif Systems 496
Submit Document Feedback
Release v4.4

Table of Contents