From c8d460eefe4ef703f2d1a50ae0aae04270a2407a Mon Sep 17 00:00:00 2001 From: Robert Hartung Date: Thu, 1 Aug 2019 09:33:49 +0200 Subject: [PATCH] cpu/atmega256rfr2: pin change interrupts --- cpu/atmega256rfr2/Makefile.dep | 6 ++++++ cpu/atmega256rfr2/Makefile.features | 4 +++- cpu/atmega256rfr2/Makefile.include | 5 +++++ cpu/atmega256rfr2/include/atmega_pcint.h | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cpu/atmega256rfr2/Makefile.dep create mode 100644 cpu/atmega256rfr2/include/atmega_pcint.h diff --git a/cpu/atmega256rfr2/Makefile.dep b/cpu/atmega256rfr2/Makefile.dep new file mode 100644 index 0000000000..cc821137d3 --- /dev/null +++ b/cpu/atmega256rfr2/Makefile.dep @@ -0,0 +1,6 @@ +# additional PCINTs for atmega256rfr2 +ifneq (,$(filter atmega_pcint,$(USEMODULE))) + USEMODULE += atmega_pcint1 +endif + +include $(RIOTCPU)/atmega_common/Makefile.dep diff --git a/cpu/atmega256rfr2/Makefile.features b/cpu/atmega256rfr2/Makefile.features index f5ad466ab1..9e21413689 100644 --- a/cpu/atmega256rfr2/Makefile.features +++ b/cpu/atmega256rfr2/Makefile.features @@ -1,7 +1,9 @@ include $(RIOTCPU)/atmega_common/Makefile.features - # common feature are defined in atmega_common/Makefile.features # Only add Additional features +# additional PCINT for atmega256rfr2 +FEATURES_PROVIDED += atmega_pcint1 + # Various other features (if any) FEATURES_PROVIDED += periph_cpuid diff --git a/cpu/atmega256rfr2/Makefile.include b/cpu/atmega256rfr2/Makefile.include index c7e4d680ea..d573da94db 100644 --- a/cpu/atmega256rfr2/Makefile.include +++ b/cpu/atmega256rfr2/Makefile.include @@ -7,5 +7,10 @@ USEMODULE += periph RAM_LEN = 32K ROM_LEN = 256K +# expand atmega_pcint for atmega256rfr2 +ifneq (,$(filter atmega_pcint,$(USEMODULE))) + USEMODULE += atmega_pcint1 +endif + # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega256rfr2/include/atmega_pcint.h b/cpu/atmega256rfr2/include/atmega_pcint.h new file mode 100644 index 0000000000..c25d43c169 --- /dev/null +++ b/cpu/atmega256rfr2/include/atmega_pcint.h @@ -0,0 +1,15 @@ +#ifndef ATMEGA_PCINT_H +#define ATMEGA_PCINT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define ATMEGA_PCINT_MAP_PCINT0 GPIO_PIN(PORT_B, 0), GPIO_PIN(PORT_B, 1), GPIO_PIN(PORT_B, 2), GPIO_PIN(PORT_B, 3), GPIO_PIN(PORT_B, 4), GPIO_PIN(PORT_B, 5), GPIO_PIN(PORT_B, 6), GPIO_PIN(PORT_B, 7) +#define ATMEGA_PCINT_MAP_PCINT1 GPIO_PIN(PORT_E, 0), GPIO_UNDEF, GPIO_UNDEF, GPIO_UNDEF, GPIO_UNDEF, GPIO_UNDEF, GPIO_UNDEF, GPIO_UNDEF + +#ifdef __cplusplus +} +#endif + +#endif /* ATMEGA_PCINT_H */