EasyManua.ls Logo

Espressif ESP32-S2 - Page 501

Espressif ESP32-S2
1695 pages
Print Icon
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
• This function marks all devices as waiting to be freed
• If a device is not opened by any clients, it will be freed immediately
• If a device is opened by at least one client, the device will be free when the last client closes that device.
• Wait for the USB_HOST_LIB_EVENT_FLAGS_ALL_FREE flag to be set by
usb_host_lib_handle_events() in order to know when all devices have been freed
• This function is useful when cleaning up devices before uninstalling the USB Host Library
Return
• ESP_ERR_NOT_FINISHED: There are one or more devices that still need to be freed. Wait for
USB_HOST_LIB_EVENT_FLAGS_ALL_FREE event
• ESP_OK: All devices already freed (i.e., there were no devices)
• Other: Error
esp_err_t usb_host_device_addr_list_fill(int list_len, uint8_t *dev_addr_list, int
*num_dev_ret)
Fill a list of device address.
• This function fills an empty list with the address of connected devices
• The Device addresses can then used in usb_host_device_open()
• If there are more devices than the list_len, this function will only fill up to list_len number of devices.
Return esp_err_t
Parameters
• [in] list_len: Length of the empty list
• [inout] dev_addr_list: Empty list to be filled
• [out] num_dev_ret: Number of devices
esp_err_t usb_host_device_info(usb_device_handle_t dev_hdl, usb_device_info_t *dev_info)
Get device’s information.
• This function gets some basic information of a device
• The device must be opened first before attempting to get its information
Note This function can block
Return esp_err_t
Parameters
• [in] dev_hdl: Device handle
• [out] dev_info: Device information
esp_err_t usb_host_get_device_descriptor(usb_device_handle_t dev_hdl, const
usb_device_desc_t **device_desc)
Get device’s device descriptor.
• A client must call usb_host_device_open() first
• No control transfer is sent. The device’s descriptor is cached on enumeration
• This function simple returns a pointer to the cached descriptor
Note No control transfer is sent. The device’s descriptor is cached on enumeration
Return esp_err_t
Parameters
• [in] dev_hdl: Device handle
• [out] device_desc: Device descriptor
esp_err_t usb_host_get_active_config_descriptor(usb_device_handle_t dev_hdl, const
usb_config_desc_t **config_desc)
Get device’s active configuration descriptor.
• A client must call usb_host_device_open() first
• No control transfer is sent. The device’s active configuration descriptor is cached on enumeration
• This function simple returns a pointer to the cached descriptor
Note This function can block
Note No control transfer is sent. A device’s active configuration descriptor is cached on enumeration
Return esp_err_t
Parameters
Espressif Systems 490
Submit Document Feedback
Release v4.4

Table of Contents