2020-05-03 14:35:01 +02:00
|
|
|
MODULE = periph
|
|
|
|
|
|
|
|
# Select the specific implementation for `periph_i2c`
|
|
|
|
ifneq (,$(filter periph_i2c,$(USEMODULE)))
|
2024-01-25 22:45:17 +01:00
|
|
|
ifneq (,$(filter $(CPU_FAM),f0 f3 f7 g0 g4 l0 l4 l5 u5 wb wl c0))
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += i2c_1.c
|
2021-03-08 01:00:00 +01:00
|
|
|
else ifneq (,$(filter $(CPU_FAM),f1 f2 f4 l1))
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += i2c_2.c
|
2021-03-08 01:00:00 +01:00
|
|
|
else
|
|
|
|
$(error STM32 series I2C implementation not found.)
|
2020-05-03 14:35:01 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Select the specific implementation for `periph_adc`
|
|
|
|
ifneq (,$(filter periph_adc,$(USEMODULE)))
|
2020-12-28 19:23:13 +01:00
|
|
|
ifneq (,$(filter $(CPU_FAM),f4 f7))
|
|
|
|
SRC += adc_f4_f7.c
|
2024-01-25 22:45:17 +01:00
|
|
|
else ifneq (,$(filter $(CPU_FAM),f0 g0 c0))
|
|
|
|
SRC += adc_f0_g0_c0.c
|
2020-12-28 19:23:13 +01:00
|
|
|
else
|
|
|
|
SRC += adc_$(CPU_FAM).c
|
|
|
|
endif
|
2020-05-03 14:35:01 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Select the correct implementation for `periph_gpio`
|
|
|
|
ifneq (,$(filter periph_gpio,$(USEMODULE)))
|
2020-05-26 11:12:06 +02:00
|
|
|
ifeq (f1,$(CPU_FAM))
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += gpio_f1.c
|
|
|
|
else
|
|
|
|
SRC += gpio_all.c
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Select the correct implementation for `periph_rtc`
|
|
|
|
ifneq (,$(filter periph_rtc,$(USEMODULE)))
|
2020-05-26 11:12:06 +02:00
|
|
|
ifeq (f1,$(CPU_FAM))
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += rtc_f1.c
|
|
|
|
else
|
|
|
|
SRC += rtc_all.c
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Select the correct implementation for `periph_rtt`
|
|
|
|
ifneq (,$(filter periph_rtt,$(USEMODULE)))
|
2020-05-26 11:12:06 +02:00
|
|
|
ifeq (f1,$(CPU_FAM))
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += rtt_f1.c
|
|
|
|
else
|
|
|
|
SRC += rtt_all.c
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-12-01 20:35:11 +01:00
|
|
|
# Select the correct implementation for `periph_usbdev`
|
|
|
|
ifneq (,$(filter periph_usbdev,$(USEMODULE)))
|
2022-10-14 12:25:57 +02:00
|
|
|
ifeq (,$(filter usbdev_synopsys_dwc2,$(USEMODULE)))
|
2021-12-01 20:35:11 +01:00
|
|
|
SRC += usbdev_fs.c
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-05-03 14:35:01 +02:00
|
|
|
# flashpage and eeprom periph implementations share flash lock/unlock functions
|
|
|
|
# defined in flash_common.c
|
|
|
|
ifneq (,$(filter periph_flashpage periph_eeprom,$(USEMODULE)))
|
|
|
|
SRC += flash_common.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(filter periph_wdt,$(USEMODULE)))
|
|
|
|
$(warning Attention! WDT is clocked by CLOCK_LSI, it needs manual measuring\
|
|
|
|
since values can deviate up to 50% from reference)
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(RIOTMAKE)/periph.mk
|