123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
- #include <avr/pgmspace.h>
- #define NOT_A_PIN 0
- #define NOT_A_PORT 0
- #define NOT_ON_TIMER 0
- #define TIMER0A 1
- #define TIMER0B 2
- #define TIMER1A 3
- #define TIMER1B 4
- #define TIMER2 5
- #define TIMER2A 6
- #define TIMER2B 7
- #define TIMER3A 8
- #define TIMER3B 9
- #define TIMER3C 10
- #define TIMER4A 11
- #define TIMER4B 12
- #define TIMER4C 13
- #define TIMER5A 14
- #define TIMER5B 15
- #define TIMER5C 16
- const static uint8_t SS = 4;
- const static uint8_t MOSI = 5;
- const static uint8_t MISO = 6;
- const static uint8_t SCK = 7;
- static const uint8_t SDA = 17;
- static const uint8_t SCL = 16;
- static const uint8_t LED_BUILTIN = 13;
- static const uint8_t A0 = 31;
- static const uint8_t A1 = 30;
- static const uint8_t A2 = 29;
- static const uint8_t A3 = 28;
- static const uint8_t A4 = 27;
- static const uint8_t A5 = 26;
- static const uint8_t A6 = 25;
- static const uint8_t A7 = 24;
- #define NUM_DIGITAL_PINS 24
- #define NUM_ANALOG_INPUTS 8
- #define analogInputToDigitalPin(p) ((p < 7) ? (p) + 24 : -1)
- #define digitalPinHasPWM(p) ((p) == 3 || (p) == 4 || (p) == 12 || (p) == 13 || (p) == 14 || (p) == 15 )
- #define digitalPinToPCICR(p) ( (((p) >= 0) && ((p) <= 31)) ? (&PCICR) : ((uint8_t *)0) )
- #define digitalPinToPCICRbit(p) ( (((p) >= 24) && ((p) <= 31)) ? 0 : \
- ( (((p) >= 0) && ((p) <= 7)) ? 1 : \
- ( (((p) >= 16) && ((p) <= 23)) ? 2 : \
- ( (((p) >= 8) && ((p) <= 15)) ? 3 : \
- 0 ) ) ) )
- #define digitalPinToPCMSK(p) ( (((p) >= 24) && ((p) <= 31)) ? (&PCMSK0) : \
- ( (((p) >= 0) && ((p) <= 7)) ? (&PCMSK1) : \
- ( (((p) >= 16) && ((p) <= 23)) ? (&PCMSK2) : \
- ( (((p) >= 8) && ((p) <= 15)) ? (&PCMSK3) : \
- ((uint8_t *)0) ) ) ) )
- #define digitalPinToPCMSKbit(p) ( (((p) >= 24) && ((p) <= 31)) ? (31 - (p)) : \
- ( (((p) >= 0) && ((p) <= 7)) ? (p) : \
- ( (((p) >= 16) && ((p) <= 23)) ? ((p) - 16) : \
- ( (((p) >= 8) && ((p) <= 15)) ? ((p) - 8) : \
- 0 ) ) ) )
- #define PA 1
- #define PB 2
- #define PC 3
- #define PD 4
- #define PE 5
- #define PF 6
- #define PG 7
- #define PH 8
- #define PJ 10
- #define PK 11
- #define PL 12
- #ifdef ARDUINO_MAIN
- const uint16_t PROGMEM port_to_mode_PGM[] =
- {
- NOT_A_PORT,
- (uint16_t) &DDRA,
- (uint16_t) &DDRB,
- (uint16_t) &DDRC,
- (uint16_t) &DDRD,
- };
- const uint16_t PROGMEM port_to_output_PGM[] =
- {
- NOT_A_PORT,
- (uint16_t) &PORTA,
- (uint16_t) &PORTB,
- (uint16_t) &PORTC,
- (uint16_t) &PORTD,
- };
- const uint16_t PROGMEM port_to_input_PGM[] =
- {
- NOT_A_PORT,
- (uint16_t) &PINA,
- (uint16_t) &PINB,
- (uint16_t) &PINC,
- (uint16_t) &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
- #endif
|