esp-idf/components/usb/Kconfig
Darian Leung accbaee57c Add USB Host Library
This commit adds the preliminary version of the USB Host Library. This commit contains:

- USBH (USB Host Driver)
- Hub Driver that only supports a single device and device enumeration
- USB Host Library (asychronous API)
- Test cases for USB Host Library asychronous API

The following changes were made to the existing HCD:
- Removed HCD_PIPE_STATE_INVALID. Pipes are no longer invalidated
- Changed pipe commands to halt, flush, and clear. Pipes need to be manually
  halted, flush, and cleared.
- Halting and flushing a pipe will execute the pipe callback if it causes a
  HCD_PIPE_EVENT_URB_DONE event
2021-08-24 23:28:00 +08:00

57 lines
2.7 KiB
Plaintext

menu "USB-OTG"
visible if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
# Invisible item, enabled when USB_OTG peripheral does exist
config USB_OTG_SUPPORTED
bool
default y if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
config USB_HOST_CONTROL_TRANSFER_MAX_SIZE
depends on USB_OTG_SUPPORTED
int "Largest size (in bytes) of transfers to/from default endpoints"
default 256
help
Each USB device attached is allocated a dedicated buffer for its OUT/IN transfers to/from the device's
control endpoint. The maximum size of that buffer is determined by this option. The limited size of the
transfer buffer have the following implications:
- The maximum length of control transfers is limited
- Device's with configuration descriptors larger than this limit cannot be supported
choice USB_HOST_HW_BUFFER_BIAS
depends on USB_OTG_SUPPORTED
prompt "Hardware FIFO size biasing"
default USB_HOST_HW_BUFFER_BIAS_BALANCED
help
The underlying hardware has size adjustable FIFOs to cache USB packets on reception (IN) or for
transmission (OUT). The size of these FIFOs will affect the largest MPS (maximum packet size) and the
maximum number of packets that can be cached at any one time. The hardware contains the following
FIFOS: RX (for all IN packets), Non-periodic TX (for Bulk and Control OUT packets), and Periodic TX
(for Interrupt and Isochronous OUT packets). This configuration option allows biasing the FIFO sizes
towards a particular use case, which may be necessary for devices that have endpoints with large MPS.
The MPS limits for each biasing are listed below:
Balanced:
- IN (all transfer types), 408 bytes
- OUT non-periodic (Bulk/Control), 192 bytes (i.e., 3 x 64 byte packets)
- OUT periodic (Interrupt/Isochronous), 192 bytes
Bias IN:
- IN (all transfer types), 600 bytes
- OUT non-periodic (Bulk/Control), 64 bytes (i.e., 1 x 64 byte packets)
- OUT periodic (Interrupt/Isochronous), 128 bytes
Bias Periodic OUT:
- IN (all transfer types), 128 bytes
- OUT non-periodic (Bulk/Control), 64 bytes (i.e., 1 x 64 byte packets)
- OUT periodic (Interrupt/Isochronous), 600 bytes
config USB_HOST_HW_BUFFER_BIAS_BALANCED
bool "Balanced"
config USB_HOST_HW_BUFFER_BIAS_IN
bool "Bias IN"
config USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT
bool "Periodic OUT"
endchoice
endmenu #USB-OTG