123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
- #include <avr/pgmspace.h>
- #define NUM_DIGITAL_PINS 82
- #define NUM_ANALOG_INPUTS 16
- #define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
- #define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
- static const uint8_t SS = 53;
- static const uint8_t MOSI = 51;
- static const uint8_t MISO = 50;
- static const uint8_t SCK = 52;
- static const uint8_t SDA = 20;
- static const uint8_t SCL = 21;
- static const uint8_t LED_BUILTIN = 13;
- static const uint8_t A0 = 54;
- static const uint8_t A1 = 55;
- static const uint8_t A2 = 56;
- static const uint8_t A3 = 57;
- static const uint8_t A4 = 58;
- static const uint8_t A5 = 59;
- static const uint8_t A6 = 60;
- static const uint8_t A7 = 61;
- static const uint8_t A8 = 62;
- static const uint8_t A9 = 63;
- static const uint8_t A10 = 64;
- static const uint8_t A11 = 65;
- static const uint8_t A12 = 66;
- static const uint8_t A13 = 67;
- static const uint8_t A14 = 68;
- static const uint8_t A15 = 69;
- #define digitalPinToPCICR(p) ( (((p) >= 10) && ((p) <= 13)) || \
- (((p) >= 50) && ((p) <= 53)) || \
- (((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
- #define digitalPinToPCICRbit(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? 0 : \
- ( (((p) >= 62) && ((p) <= 69)) ? 2 : \
- 0 ) )
- #define digitalPinToPCMSK(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? (&PCMSK0) : \
- ( (((p) >= 62) && ((p) <= 69)) ? (&PCMSK2) : \
- ((uint8_t *)0) ) )
- #define digitalPinToPCMSKbit(p) ( (((p) >= 10) && ((p) <= 13)) ? ((p) - 6) : \
- ( ((p) == 50) ? 3 : \
- ( ((p) == 51) ? 2 : \
- ( ((p) == 52) ? 1 : \
- ( ((p) == 53) ? 0 : \
- ( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
- 0 ) ) ) ) ) )
- #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,
- (uint16_t) &DDRE,
- (uint16_t) &DDRF,
- (uint16_t) &DDRG,
- (uint16_t) &DDRH,
- NOT_A_PORT,
- (uint16_t) &DDRJ,
- (uint16_t) &DDRK,
- (uint16_t) &DDRL,
- };
- const uint16_t PROGMEM port_to_output_PGM[] = {
- NOT_A_PORT,
- (uint16_t) &PORTA,
- (uint16_t) &PORTB,
- (uint16_t) &PORTC,
- (uint16_t) &PORTD,
- (uint16_t) &PORTE,
- (uint16_t) &PORTF,
- (uint16_t) &PORTG,
- (uint16_t) &PORTH,
- NOT_A_PORT,
- (uint16_t) &PORTJ,
- (uint16_t) &PORTK,
- (uint16_t) &PORTL,
- };
- const uint16_t PROGMEM port_to_input_PGM[] = {
- NOT_A_PIN,
- (uint16_t) &PINA,
- (uint16_t) &PINB,
- (uint16_t) &PINC,
- (uint16_t) &PIND,
- (uint16_t) &PINE,
- (uint16_t) &PINF,
- (uint16_t) &PING,
- (uint16_t) &PINH,
- NOT_A_PIN,
- (uint16_t) &PINJ,
- (uint16_t) &PINK,
- (uint16_t) &PINL,
- };
- const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
-
-
- PE ,
- PE ,
- PE ,
- PE ,
- PG ,
- PE ,
- PH ,
- PH ,
- PH ,
- PH ,
- PB ,
- PB ,
- PB ,
- PB ,
- PJ ,
- PJ ,
- PH ,
- PH ,
- PD ,
- PD ,
- PD ,
- PD ,
- PA ,
- PA ,
- PA ,
- PA ,
- PA ,
- PA ,
- PA ,
- PA ,
- PC ,
- PC ,
- PC ,
- PC ,
- PC ,
- PC ,
- PC ,
- PC ,
- PD ,
- PG ,
- PG ,
- PG ,
- PL ,
- PL ,
- PL ,
- PL ,
- PL ,
- PL ,
- PL ,
- PL ,
- PB ,
- PB ,
- PB ,
- PB ,
- PF ,
- PF ,
- PF ,
- PF ,
- PF ,
- PF ,
- PF ,
- PF ,
- PK ,
- PK ,
- PK ,
- PK ,
- PK ,
- PK ,
- PK ,
- PK ,
- PG ,
- PG ,
- PJ ,
- PJ ,
- PJ ,
- PJ ,
- PJ ,
- PJ ,
- PE ,
- PE ,
- PE ,
- PD ,
- PD ,
- PD ,
- PH ,
- PH ,
- };
- const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
-
-
- _BV( 0 ) ,
- _BV( 1 ) ,
- _BV( 4 ) ,
- _BV( 5 ) ,
- _BV( 5 ) ,
- _BV( 3 ) ,
- _BV( 3 ) ,
- _BV( 4 ) ,
- _BV( 5 ) ,
- _BV( 6 ) ,
- _BV( 4 ) ,
- _BV( 5 ) ,
- _BV( 6 ) ,
- _BV( 7 ) ,
- _BV( 1 ) ,
- _BV( 0 ) ,
- _BV( 1 ) ,
- _BV( 0 ) ,
- _BV( 3 ) ,
- _BV( 2 ) ,
- _BV( 1 ) ,
- _BV( 0 ) ,
- _BV( 0 ) ,
- _BV( 1 ) ,
- _BV( 2 ) ,
- _BV( 3 ) ,
- _BV( 4 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T_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 ,
- 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 ,
- TIMER5C ,
- TIMER5B ,
- TIMER5A ,
- 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 ,
- 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 ,
- NOT_ON_TIMER ,
- NOT_ON_TIMER ,
- NOT_ON_TIMER ,
- NOT_ON_TIMER ,
- NOT_ON_TIMER ,
- NOT_ON_TIMER ,
- NOT_ON_TIMER ,
- };
- #endif
- #endif
|