aboutsummaryrefslogtreecommitdiff
path: root/pins/standard
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2011-08-12 18:27:00 -0400
committerDavid A. Mellis <d.mellis@arduino.cc>2011-08-12 18:27:00 -0400
commit39573e5cf7e5db5f0892fc6d33e0d53ede5e0d17 (patch)
treeb2ba307118df780dbf05c6e02889d4f2983511c9 /pins/standard
parentcafbc48008ec9cb5cd68b29a93f59b81423322f7 (diff)
Adding basic macros for analog + digital pin information.
http://code.google.com/p/arduino/issues/detail?id=495
Diffstat (limited to 'pins/standard')
-rw-r--r--pins/standard/pins_arduino.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pins/standard/pins_arduino.h b/pins/standard/pins_arduino.h
index 8e25435..3999d1f 100644
--- a/pins/standard/pins_arduino.h
+++ b/pins/standard/pins_arduino.h
@@ -27,6 +27,16 @@
#include <avr/pgmspace.h>
+#define NUM_DIGITAL_PINS 20
+#define NUM_ANALOG_INPUTS 6
+#define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1)
+
+#if defined(__AVR_ATmega8__)
+#define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11)
+#else
+#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
+#endif
+
const static uint8_t SS = 10;
const static uint8_t MOSI = 11;
const static uint8_t MISO = 12;