Espressif ESP32-S2 Programming Manual page 503

Table of Contents

Advertisement

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,
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
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
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
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
**transfer)
*transfer)
*transfer)
usb_transfer_t
492
Submit Document Feedback
usb_transfer_t
client_hdl,
*transfer)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF