| # Copyright (c) 2023 Linaro Limited |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| config UDC_STM32 |
| bool "STM32 USB device controller driver" |
| depends on DT_HAS_ST_STM32_OTGFS_ENABLED \ |
| || DT_HAS_ST_STM32_OTGHS_ENABLED \ |
| || DT_HAS_ST_STM32_USB_ENABLED |
| select USE_STM32_LL_USB |
| select USE_STM32_HAL_PCD |
| select USE_STM32_HAL_PCD_EX |
| select UDC_DRIVER_HAS_HIGH_SPEED_SUPPORT |
| select PINCTRL |
| default y |
| help |
| STM32 USB device controller driver. |
| |
| if UDC_STM32 |
| |
| config UDC_STM32_STACK_SIZE |
| int "UDC controller driver internal thread stack size" |
| default 512 |
| help |
| STM32 USB device controller driver internal thread stack size. |
| |
| config UDC_STM32_THREAD_PRIORITY |
| int "STM32 USB controller driver thread priority" |
| default 8 |
| help |
| STM32 USB device controller driver thread priority. |
| |
| config UDC_STM32_MAX_QMESSAGES |
| int "STM32 UDC driver maximum number of ISR event messages" |
| range 4 64 |
| default 8 |
| help |
| Maximum number of messages for handling of STM32 USBD ISR events. |
| |
| config UDC_STM32_OTG_RXFIFO_BASELINE_SIZE |
| int "Baseline RxFIFO size (in bytes)" |
| default 600 |
| depends on DT_HAS_ST_STM32_OTGFS_ENABLED \ |
| || DT_HAS_ST_STM32_OTGHS_ENABLED |
| help |
| Baseline value for RXFIFO size computation |
| |
| The OTG_FS and OTG_HS USB controllers use a single "RxFIFO" to hold |
| data received by all OUT endpoints. The RxFIFO's size is influenced |
| by various parameters: the optimal value depends on the exact USB |
| configuration that will be used, which the driver does not know by |
| the time it has to configure the RxFIFO size. |
| |
| The total RxFIFO size will be equal to the value of this option |
| plus a fixed overhead that the driver can derive from the hardware |
| configuration (e.g., number of endpoints implemented). |
| |
| Refer to STM32 Reference Manuals for more details about the RxFIFO. |
| |
| config UDC_STM32_CLOCK_CHECK |
| bool "Runtime USB 48MHz clock check" |
| default y if !(SOC_SERIES_STM32F1X || SOC_SERIES_STM32F3X || SOC_SERIES_STM32U5X) |
| help |
| Enable USB clock 48MHz configuration runtime check. |
| In specific cases, this check might provide wrong verdict and should |
| be disabled. |
| |
| endif |