From cafbc48008ec9cb5cd68b29a93f59b81423322f7 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Fri, 12 Aug 2011 17:31:22 -0400 Subject: Adding pin-change interrupt pin mapping macros to pins_arduino.h. http://code.google.com/p/arduino/issues/detail?id=490 --- pins/standard/pins_arduino.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pins/standard/pins_arduino.h') diff --git a/pins/standard/pins_arduino.h b/pins/standard/pins_arduino.h index b42755d..8e25435 100644 --- a/pins/standard/pins_arduino.h +++ b/pins/standard/pins_arduino.h @@ -45,6 +45,11 @@ const static uint8_t A5 = 19; const static uint8_t A6 = 20; const static uint8_t A7 = 21; +#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1)) +#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0)))) +#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14))) + #ifdef ARDUINO_MAIN // On the Arduino board, digital pins are also used -- cgit v1.2.3-18-g5258