EasyManua.ls Logo

Espressif ESP32-S2 - Page 503

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
• 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())
• If the endpoint has any queued up transfers, clearing a halt will resume their execution
Note This function can block
Return esp_err_t
Parameters
• dev_hdl: Device handle
• bEndpointAddress: Endpoint address
esp_err_t usb_host_transfer_alloc(size_t data_buffer_size, int num_isoc_packets, usb_transfer_t
**transfer)
Allocate a transfer object.
• This function allocates a transfer object
• Each transfer object has a fixed sized buffer specified on allocation
• A transfer object can be re-used indefinitely
• A transfer can be submitted using usb_host_transfer_submit() or usb_host_transfer_submit_control()
Return esp_err_t
Parameters
• [in] data_buffer_size: Size of the transfer’s data buffer
• [in] num_isoc_packets: Number of isochronous packets in transfer (set to 0 for non-
isochronous transfers)
• [out] transfer: Transfer object
esp_err_t usb_host_transfer_free(usb_transfer_t *transfer)
Free a transfer object.
• Free a transfer object previously allocated using usb_host_transfer_alloc()
• The transfer must not be in-flight when attempting to free it
• If a NULL pointer is passed, this function will simply return ESP_OK
Return esp_err_t
Parameters
• [in] transfer: Transfer object
esp_err_t usb_host_transfer_submit(usb_transfer_t *transfer)
Submit a non-control transfer.
• Submit a transfer to a particular endpoint. The device and endpoint number is specified inside the transfer
• The transfer must be properly initialized before submitting
• On completion, the transfer’s callback will be called from the client’s usb_host_client_handle_events()
function.
Return esp_err_t
Parameters
• [in] transfer: Initialized transfer object
esp_err_t usb_host_transfer_submit_control(usb_host_client_handle_t client_hdl,
usb_transfer_t *transfer)
Submit a control transfer.
• Submit a control transfer to a particular device. The client must have opened the device first
• The transfer must be properly initialized before submitting. The first 8 bytes of the transfer’s data buffer
should contain the control transfer setup packet
• On completion, the transfer’s callback will be called from the client’s usb_host_client_handle_events()
function.
Return esp_err_t
Parameters
• [in] client_hdl: Client handle
• [in] transfer: Initialized transfer object
Espressif Systems 492
Submit Document Feedback
Release v4.4

Table of Contents