Skip to content

Commit

Permalink
cpu/atmega256rfr2: pin change interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
roberthartung committed Aug 1, 2019
1 parent 18117b4 commit c8d460e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cpu/atmega256rfr2/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# additional PCINTs for atmega256rfr2
ifneq (,$(filter atmega_pcint,$(USEMODULE)))
USEMODULE += atmega_pcint1
endif

include $(RIOTCPU)/atmega_common/Makefile.dep
4 changes: 3 additions & 1 deletion cpu/atmega256rfr2/Makefile.features
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions cpu/atmega256rfr2/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions cpu/atmega256rfr2/include/atmega_pcint.h
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit c8d460e

Please sign in to comment.