Chapter 2. API Reference
• [in] dev_hdl: Device handle
• [out] config_desc: Configuration descriptor
esp_err_t usb_host_interface_claim(usb_host_client_handle_t
Function for a client to claim a device's interface.
• A client must claim a device's interface before attempting to communicate with any of its endpoints
• Once an interface is claimed by a client, it cannot be claimed by any other client.
Note This function can block
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
• [in] dev_hdl: Device handle
• [in] bInterfaceNumber: Interface number
• [in] bAlternateSetting: Interface alternate setting number
esp_err_t usb_host_interface_release(usb_host_client_handle_t
Function for a client to release a previously claimed interface.
• A client should release a device's interface after it no longer needs to communicate with the interface
• A client must release all of its interfaces of a device it has claimed before being able to close the device
Note This function can block
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
• [in] dev_hdl: Device handle
• [in] bInterfaceNumber: Interface number
esp_err_t usb_host_endpoint_halt(usb_device_handle_t
Halt a particular endpoint.
• The device must have been opened by a client
• The endpoint must be part of an interface claimed by a client
• Once halted, the endpoint must be cleared using usb_host_endpoint_clear() before it can communicate
again
Note This function can block
Return esp_err_t
Parameters
• dev_hdl: Device handle
• bEndpointAddress: Endpoint address
esp_err_t usb_host_endpoint_flush(usb_device_handle_t
Flush a particular endpoint.
• The device must have been opened by a client
• The endpoint must be part of an interface claimed by a client
• The endpoint must have been halted (either through a transfer error, or usb_host_endpoint_halt())
• Flushing an endpoint will caused an queued up transfers to be canceled
Note This function can block
Return esp_err_t
Parameters
• dev_hdl: Device handle
• bEndpointAddress: Endpoint address
esp_err_t usb_host_endpoint_clear(usb_device_handle_t
Clear a halt on a particular endpoint.
• The device must have been opened by a client
Espressif Systems
dev_hdl, uint8_t bInterfaceNumber, uint8_t bAlternateSet-
ting)
dev_hdl, uint8_t bInterfaceNumber)
dev_hdl, uint8_t bEndpointAddress)
491
Submit Document Feedback
client_hdl,
usb_device_handle_t
client_hdl,
usb_device_handle_t
dev_hdl, uint8_t bEndpointAddress)
dev_hdl, uint8_t bEndpointAddress)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers