2020-05-03 14:35:01 +02:00
|
|
|
MODULE = periph
|
|
|
|
|
|
|
|
# Select the specific implementation for `periph_i2c`
|
|
|
|
ifneq (,$(filter periph_i2c,$(USEMODULE)))
|
2020-05-03 22:22:10 +02:00
|
|
|
ifneq (,$(filter $(CPU_FAM),f0 f3 f7 g0 g4 l0 l4 wb))
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += i2c_1.c
|
2020-05-26 11:12:06 +02:00
|
|
|
else # f1/f2/f4/l1
|
2020-05-03 14:35:01 +02:00
|
|
|
SRC += i2c_2.c
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Select the specific implementation for `periph_adc`
|
|
|
|
ifneq (,$(filter periph_adc,$(USEMODULE)))
|
2020-05-26 11:12:06 +02:00
|
|
|
SRC += adc_$(CPU_FAM).c
|
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
|
|
|
|
|
|
|
|
# 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
|