summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortfx2001 <[email protected]>2021-10-14 19:40:01 +0800
committertfx2001 <[email protected]>2021-10-15 00:49:11 +0800
commitc1d3d874948985f8f9c4f374e9b9858c9d54f220 (patch)
tree3ecb2e5d84e0c62da0ca62ee1316b08ff7f10bfa
parent7fe03a76e6fe6bf1f97d37202754353f76d5b359 (diff)
[bsp][stm32] add TinyUSB support
-rw-r--r--bsp/stm32/libraries/STM32F0xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32F1xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32F2xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32F3xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32F4xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32F7xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32G4xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32H7xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32L0xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32L1xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32L4xx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32MPxx_HAL/SConscript2
-rw-r--r--bsp/stm32/libraries/STM32WBxx_HAL/SConscript2
-rwxr-xr-xcomponents/drivers/Kconfig7
14 files changed, 20 insertions, 13 deletions
diff --git a/bsp/stm32/libraries/STM32F0xx_HAL/SConscript b/bsp/stm32/libraries/STM32F0xx_HAL/SConscript
index 83a63eae5e..b6445d228a 100644
--- a/bsp/stm32/libraries/STM32F0xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32F0xx_HAL/SConscript
@@ -42,7 +42,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_spi_ex.c']
src += ['STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_spi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c']
src += ['STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32F1xx_HAL/SConscript b/bsp/stm32/libraries/STM32F1xx_HAL/SConscript
index 36c204e860..135bb2e98c 100644
--- a/bsp/stm32/libraries/STM32F1xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32F1xx_HAL/SConscript
@@ -33,7 +33,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c']
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_spi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c']
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c']
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c']
diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/SConscript b/bsp/stm32/libraries/STM32F2xx_HAL/SConscript
index 37aee93257..bf11a01ddc 100644
--- a/bsp/stm32/libraries/STM32F2xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32F2xx_HAL/SConscript
@@ -28,7 +28,7 @@ if GetDepend(['RT_USING_I2C']):
if GetDepend(['RT_USING_SPI']):
src += ['STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_spi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pccard.c']
src += ['STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd.c']
src += ['STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32F3xx_HAL/SConscript b/bsp/stm32/libraries/STM32F3xx_HAL/SConscript
index d5a4f7d6cc..4f48470a5c 100644
--- a/bsp/stm32/libraries/STM32F3xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32F3xx_HAL/SConscript
@@ -37,7 +37,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.c']
src += ['STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pcd.c']
src += ['STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pcd_ex.c']
src += ['STM32F3xx_HAL_Driver/Src/stm32f3xx_ll_usb.c']
diff --git a/bsp/stm32/libraries/STM32F4xx_HAL/SConscript b/bsp/stm32/libraries/STM32F4xx_HAL/SConscript
index 00db00252b..754566e54c 100644
--- a/bsp/stm32/libraries/STM32F4xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32F4xx_HAL/SConscript
@@ -36,7 +36,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c']
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c']
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c']
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32F7xx_HAL/SConscript b/bsp/stm32/libraries/STM32F7xx_HAL/SConscript
index 50ec582b66..8aec53d69f 100644
--- a/bsp/stm32/libraries/STM32F7xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32F7xx_HAL/SConscript
@@ -41,7 +41,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_spi_ex.c']
src += ['STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pcd.c']
src += ['STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pcd_ex.c']
src += ['STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_hcd.c']
diff --git a/bsp/stm32/libraries/STM32G4xx_HAL/SConscript b/bsp/stm32/libraries/STM32G4xx_HAL/SConscript
index 025acb8c57..52d68e9609 100644
--- a/bsp/stm32/libraries/STM32G4xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32G4xx_HAL/SConscript
@@ -37,7 +37,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_spi.c']
src += ['STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pccard.c']
src += ['STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pcd.c']
src += ['STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32H7xx_HAL/SConscript b/bsp/stm32/libraries/STM32H7xx_HAL/SConscript
index 2292d8d40f..0f33bf8a0d 100644
--- a/bsp/stm32/libraries/STM32H7xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32H7xx_HAL/SConscript
@@ -41,7 +41,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi.c']
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
# src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pccard.c']
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c']
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32L0xx_HAL/SConscript b/bsp/stm32/libraries/STM32L0xx_HAL/SConscript
index 4da0214df9..804020e782 100644
--- a/bsp/stm32/libraries/STM32L0xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32L0xx_HAL/SConscript
@@ -38,7 +38,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_spi_ex.c']
src += ['STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_hcd.c']
src += ['STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pcd.c']
src += ['STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32L1xx_HAL/SConscript b/bsp/stm32/libraries/STM32L1xx_HAL/SConscript
index 4dcd76b906..9c3cd96838 100644
--- a/bsp/stm32/libraries/STM32L1xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32L1xx_HAL/SConscript
@@ -34,7 +34,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_spi.c']
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_ll_spi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_pcd.c']
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_pcd_ex.c']
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_ll_usb.c']
diff --git a/bsp/stm32/libraries/STM32L4xx_HAL/SConscript b/bsp/stm32/libraries/STM32L4xx_HAL/SConscript
index d3e360ddac..134b47cf52 100644
--- a/bsp/stm32/libraries/STM32L4xx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32L4xx_HAL/SConscript
@@ -41,7 +41,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c']
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_hcd.c']
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pcd.c']
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32MPxx_HAL/SConscript b/bsp/stm32/libraries/STM32MPxx_HAL/SConscript
index ce482829bd..746d835326 100644
--- a/bsp/stm32/libraries/STM32MPxx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32MPxx_HAL/SConscript
@@ -35,7 +35,7 @@ if GetDepend(['RT_USING_SERIAL']):
src += ['STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_uart.c']
src += ['STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_uart_ex.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
src += ['STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pccard.c']
src += ['STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pcd.c']
src += ['STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pcd_ex.c']
diff --git a/bsp/stm32/libraries/STM32WBxx_HAL/SConscript b/bsp/stm32/libraries/STM32WBxx_HAL/SConscript
index 75372b529e..9245975aee 100644
--- a/bsp/stm32/libraries/STM32WBxx_HAL/SConscript
+++ b/bsp/stm32/libraries/STM32WBxx_HAL/SConscript
@@ -42,7 +42,7 @@ if GetDepend(['RT_USING_SPI']):
src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_spi_ex.c']
src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_qspi.c']
-if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
+if GetDepend(['RT_USING_USB']):
# src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_hcd.c']
src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd.c']
src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd_ex.c']
diff --git a/components/drivers/Kconfig b/components/drivers/Kconfig
index d3fd14b52d..159a6cbda3 100755
--- a/components/drivers/Kconfig
+++ b/components/drivers/Kconfig
@@ -623,9 +623,14 @@ menuconfig RT_USING_WIFI
endif
menu "Using USB"
+ config RT_USING_USB
+ bool
+ default n
+
config RT_USING_USB_HOST
bool "Using USB host"
default n
+ select RT_USING_USB
if RT_USING_USB_HOST
config RT_USBH_MSTORAGE
@@ -648,6 +653,8 @@ menu "Using USB"
config RT_USING_USB_DEVICE
bool "Using USB device"
default n
+ select RT_USING_USB
+
if RT_USING_USB_DEVICE || RT_USING_USB_HOST
config RT_USBD_THREAD_STACK_SZ
int "usb thread stack size"