123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
- #include <avr/pgmspace.h>
- #define NUM_DIGITAL_PINS 32
- #define NUM_ANALOG_INPUTS 8
- #define analogInputToDigitalPin(p) ((p < 8) ? (p) + 24 : -1)
- #define digitalPinHasPWM(p) ((p) == 3 || (p) == 4 || (p) == 12 || (p) == 13 || (p) == 14 || (p) == 15)
- static const uint8_t SS = 4;
- static const uint8_t MOSI = 5;
- static const uint8_t MISO = 6;
- static const uint8_t SCK = 7;
- static const uint8_t SDA = 17;
- static const uint8_t SCL = 16;
- static const uint8_t LED_BUILTIN = -1;
- static const uint8_t A0 = 24;
- static const uint8_t A1 = 25;
- static const uint8_t A2 = 26;
- static const uint8_t A3 = 27;
- static const uint8_t A4 = 28;
- static const uint8_t A5 = 29;
- static const uint8_t A6 = 20;
- static const uint8_t A7 = 21;
- #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 33) ? (&PCICR) : ((uint8_t *)0))
- #define digitalPinToPCICRbit(p) (((p) <= 9) ? 2 : (((p) <= 23) ? 0 : 1))
- #define digitalPinToPCMSK(p) (((p) <= 9) ? (&PCMSK2) : (((p) <= 23) ? (&PCMSK0) : (((p) <= 33) ? (&PCMSK1) : ((uint8_t *)0))))
- #define digitalPinToPCMSKbit(p) (((p) <= 9) ? (p) : (((p) <= 23) ? ((p) - 10) : ((p) - 24)))
- #ifdef ARDUINO_MAIN
- const uint16_t PROGMEM port_to_mode_PGM[] = {
- NOT_A_PORT,
- &DDRA,
- &DDRB,
- &DDRC,
- &DDRD,
- };
- const uint16_t PROGMEM port_to_output_PGM[] = {
- NOT_A_PORT,
- &PORTA,
- &PORTB,
- &PORTC,
- &PORTD,
- };
- const uint16_t PROGMEM port_to_input_PGM[] = {
- NOT_A_PORT,
- &PINA,
- &PINB,
- &PINC,
- &PIND,
- };
- const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
- PB,
- PB,
- PB,
- PB,
- PB,
- PB,
- PB,
- PB,
- PD,
- PD,
- PD,
- PD,
- PD,
- PD,
- PD,
- PD,
- PC,
- PC,
- PC,
- PC,
- PC,
- PC,
- PC,
- PC,
- PA,
- PA,
- PA,
- PA,
- PA,
- PA,
- PA,
- PA
- };
- const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
- _BV(0),
- _BV(1),
- _BV(2),
- _BV(3),
- _BV(4),
- _BV(5),
- _BV(6),
- _BV(7),
- _BV(0),
- _BV(1),
- _BV(2),
- _BV(3),
- _BV(4),
- _BV(5),
- _BV(6),
- _BV(7),
- _BV(0),
- _BV(1),
- _BV(2),
- _BV(3),
- _BV(4),
- _BV(5),
- _BV(6),
- _BV(7),
- _BV(7),
- _BV(6),
- _BV(5),
- _BV(4),
- _BV(3),
- _BV(2),
- _BV(1),
- _BV(0)
- };
- const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- TIMER0A,
- TIMER0B,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- TIMER1B,
- TIMER1A,
- TIMER2B,
- TIMER2A,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER
- };
- #endif /* ARDUINO_MAIN */
- #endif /* Pins_Arduino_h */
|