4 #include <avr/pgmspace.h>
6 #define NUM_DIGITAL_PINS 20
7 #define NUM_ANALOG_INPUTS 6
8 #define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1)
10 #if defined(__AVR_ATmega8__)
11 #define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11)
13 #define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
16 #define PIN_SPI_SS (10)
17 #define PIN_SPI_MOSI (11)
18 #define PIN_SPI_MISO (12)
19 #define PIN_SPI_SCK (13)
21 static const uint8_t SS = PIN_SPI_SS;
22 static const uint8_t MOSI = PIN_SPI_MOSI;
23 static const uint8_t MISO = PIN_SPI_MISO;
24 static const uint8_t SCK = PIN_SPI_SCK;
26 #define PIN_WIRE_SDA (18)
27 #define PIN_WIRE_SCL (19)
29 static const uint8_t SDA = PIN_WIRE_SDA;
30 static const uint8_t SCL = PIN_WIRE_SCL;
32 #define LED_BUILTIN 13
43 static const uint8_t A0 = PIN_A0;
44 static const uint8_t A1 = PIN_A1;
45 static const uint8_t A2 = PIN_A2;
46 static const uint8_t A3 = PIN_A3;
47 static const uint8_t A4 = PIN_A4;
48 static const uint8_t A5 = PIN_A5;
49 static const uint8_t A6 = PIN_A6;
50 static const uint8_t A7 = PIN_A7;
52 #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
53 #define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
54 #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))
55 #define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14)))
57 #define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : NOT_AN_INTERRUPT))