feat(usb/host): Add option to choose peripheral for USB host library

Starting with ESP32-P4 we can have targets that have more than 1 USB-OTG peripheral.
This commit adds an option to choose which peripherals will be used by USB Host lib.

Internally, we will still have only 1 Root HUB but with multiple Root ports.
This commit is contained in:
Tomas Rezucha
2024-12-03 08:52:48 +01:00
parent 66e5cc8801
commit b961f42e8b
14 changed files with 169 additions and 75 deletions
+7
View File
@@ -121,6 +121,13 @@ typedef struct {
} fifo_settings_custom; /**< Optional custom FIFO configuration (advanced use).
RX and NPTX must be > 0. If all fields are zero,
a default configuration will be selected based on Kconfig bias. */
unsigned peripheral_map; /**< Selects the USB peripheral(s) to use.
- On targets with multiple USB peripherals, this field can be used to specify which ones to enable.
- Set to 0 to use the default peripheral.
- On High-Speed capable targets, the default is the High-Speed peripheral.
- On Full-Speed only targets, the default is the Full-Speed peripheral.
- Example: peripheral_map = BIT1; installs USB host on peripheral 1.
- The mapping of bits to specific peripherals is defined in the USB_DWC_LL_GET_HW() macro. */
} usb_host_config_t;
/**