1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/stm32/Makefile.dep
Gunar Schorcht 31efa61eda cpu/stm32: improvement of USB driver selection
There are STM32 families where all models use only the Synopsys DWC2 USB OTG core while others completely use only the USB Device FS core. For these families then either the driver `drivers/usbdev_synopsys_dwc2` or the driver `cpu/stm32/periph/usbdev` is used depending on the respective family. However, the STM32 families F1 and L4 use both cores. The correct driver must therefore be selected depending on the CPU line or CPU model.
2022-11-03 13:52:01 +01:00

83 lines
2.4 KiB
Makefile

# All stm32 families provide pm support
# include stm32 common periph drivers, clock configurations and vectors
USEMODULE += periph stm32_clk stm32_vectors
ifneq (,$(filter periph_usbdev,$(FEATURES_USED)))
ifneq (,$(filter f2 f4 f7 h7 u5,$(CPU_FAM)))
# Whole STM32 families F2, F4, F7, H7 and U5 use the Synopsys DWC2 USB OTG core
USEMODULE += usbdev_synopsys_dwc2
else ifneq (,$(filter stm32f105% stm32f107%,$(CPU_MODEL)))
# STM32F105xx and STM32F107xx also use the Synopsys DWC2 USB OTG core
USEMODULE += usbdev_synopsys_dwc2
else ifneq (,$(filter stm32l47% stm32l48% stm32l49%,$(CPU_MODEL)))
# STM32L475xx, STM32L476xx, STM32L485xx, STM32L486xx and STM32L496xx
# also use the Synopsys DWC2 USB OTG core
USEMODULE += usbdev_synopsys_dwc2
else ifneq (,$(filter stm32l4a% stm32l4p% stm32l4q% stm32l4r% stm32l4s%,$(CPU_MODEL)))
# STM32L4Axxx, STM32L4Pxxx, STM32L4Qxxx, STM32L4Rxxx and STM32L4Sxxx
# also use the Synopsys DWC2 USB OTG core
USEMODULE += usbdev_synopsys_dwc2
endif
USEMODULE += ztimer
USEMODULE += ztimer_msec
endif
ifneq (,$(filter periph_uart_nonblocking,$(USEMODULE)))
USEMODULE += tsrb
endif
ifneq (,$(filter stm32_eth_%,$(USEMODULE)))
USEMODULE += stm32_eth
endif
ifneq (,$(filter stm32_eth_tracing,$(USEMODULE)))
FEATURES_REQUIRED += periph_gpio_ll
endif
ifneq (,$(filter stm32_eth_auto,$(USEMODULE)))
USEMODULE += stm32_eth_link_up
endif
ifneq (,$(filter stm32_eth,$(USEMODULE)))
FEATURES_REQUIRED += periph_eth
USEMODULE += iolist
USEMODULE += netdev_eth
USEMODULE += netdev_legacy_api
USEMODULE += ztimer
USEMODULE += ztimer_msec
# lwip IPv6 supports needs link up events to perform duplicate address
# detection
ifneq (,$(filter lwip_ipv6,$(USEMODULE)))
USEMODULE += stm32_eth_link_up
endif
endif
ifneq (,$(filter periph_can,$(FEATURES_USED)))
FEATURES_REQUIRED += periph_gpio
FEATURES_REQUIRED += periph_gpio_irq
endif
ifneq (,$(filter periph_eth periph_ptp,$(USEMODULE)))
USEMODULE += periph_eth_common
endif
# periph_rtc_mem is currently tied to the periph_rtc
ifneq (,$(filter periph_rtc_mem,$(USEMODULE)))
FEATURES_REQUIRED += periph_rtc
endif
ifneq (,$(filter periph_adc,$(FEATURES_USED)))
ifneq (,$(filter f3 l4 wl, $(CPU_FAM)))
USEMODULE += ztimer
USEMODULE += ztimer_msec
endif
endif
ifneq (,$(filter periph_vbat,$(USEMODULE)))
FEATURES_REQUIRED += periph_adc
endif
include $(RIOTCPU)/cortexm_common/Makefile.dep