aboutsummaryrefslogtreecommitdiff
path: root/pins/standard
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2011-08-12 17:31:22 -0400
committerDavid A. Mellis <d.mellis@arduino.cc>2011-08-12 17:31:22 -0400
commitcafbc48008ec9cb5cd68b29a93f59b81423322f7 (patch)
tree2a19661b7144ad2c1a29984b1e150e589705d0a3 /pins/standard
parentca1f64682a51c9097ab699694f85aa0a47bee1d0 (diff)
Adding pin-change interrupt pin mapping macros to pins_arduino.h.
http://code.google.com/p/arduino/issues/detail?id=490
Diffstat (limited to 'pins/standard')
-rw-r--r--pins/standard/pins_arduino.h5
1 files changed, 5 insertions, 0 deletions
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