Chapter 2. API Reference
Return esp_err_t
Parameters
• [in] client_config: Client configuration
• [out] client_hdl_ret: Client handle
esp_err_t usb_host_client_deregister(usb_host_client_handle_t client_hdl)
Deregister a USB Host Library client.
• This function deregisters a client of the USB Host Library
• The client must have closed all previously opened devices before attempting to deregister
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
esp_err_t usb_host_client_handle_events(usb_host_client_handle_t client_hdl, TickType_t
timeout_ticks
)
USB Host Library client processing function.
• This function handles all of a client’s processing and should be called repeatedly in a loop
Note This function can block
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
• [in] timeout_ticks: Timeout in ticks to wait for an event to occur
esp_err_t usb_host_client_unblock(usb_host_client_handle_t client_hdl)
Unblock a client.
• This function simply unblocks a client if it is blocked on the usb_host_client_handle_events() function.
• This function is useful when need to unblock a client in order to deregister it.
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
esp_err_t usb_host_device_open(usb_host_client_handle_t client_hdl, uint8_t dev_addr,
usb_device_handle_t *dev_hdl_ret)
Open a device.
• This function allows a client to open a device
• A client must open a device first before attempting to use it (e.g., sending transfers, device requests etc.)
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
• [in] dev_addr: Device’s address
• [out] dev_hdl_ret: Device’s handle
esp_err_t usb_host_device_close(usb_host_client_handle_t client_hdl, usb_device_handle_t
dev_hdl)
Close a device.
• This function allows a client to close a device
• A client must close a device after it has finished using the device (claimed interfaces must also be released)
• A client must close all devices it has opened before deregistering
Note This function can block
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
• [in] dev_hdl: Device handle
esp_err_t usb_host_device_free_all(void)
Indicate that all devices can be freed when possible.
Espressif Systems 489
Submit Document Feedback
Release v4.4