123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
- #include <avr/pgmspace.h>
- #undef UHCON
- #undef UHINT
- #undef UHIEN
- #undef UHADDR
- #undef UHFNUM
- #undef UHFNUML
- #undef UHFNUMH
- #undef UHFLEN
- #undef UPINRQX
- #undef UPINTX
- #undef UPNUM
- #undef UPRST
- #undef UPCONX
- #undef UPCFG0X
- #undef UPCFG1X
- #undef UPSTAX
- #undef UPCFG2X
- #undef UPIENX
- #undef UPDATX
- #undef TCCR2A
- #undef WGM20
- #undef WGM21
- #undef COM2B0
- #undef COM2B1
- #undef COM2A0
- #undef COM2A1
- #undef TCCR2B
- #undef CS20
- #undef CS21
- #undef CS22
- #undef WGM22
- #undef FOC2B
- #undef FOC2A
- #undef TCNT2
- #undef TCNT2_0
- #undef TCNT2_1
- #undef TCNT2_2
- #undef TCNT2_3
- #undef TCNT2_4
- #undef TCNT2_5
- #undef TCNT2_6
- #undef TCNT2_7
- #undef OCR2A
- #undef OCR2_0
- #undef OCR2_1
- #undef OCR2_2
- #undef OCR2_3
- #undef OCR2_4
- #undef OCR2_5
- #undef OCR2_6
- #undef OCR2_7
- #undef OCR2B
- #undef OCR2_0
- #undef OCR2_1
- #undef OCR2_2
- #undef OCR2_3
- #undef OCR2_4
- #undef OCR2_5
- #undef OCR2_6
- #undef OCR2_7
- #define NUM_DIGITAL_PINS 30
- #define NUM_ANALOG_INPUTS 12
- #define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
- #define TXLED0 PORTD |= (1<<5)
- #define TXLED1 PORTD &= ~(1<<5)
- #define RXLED0 PORTB |= (1<<0)
- #define RXLED1 PORTB &= ~(1<<0)
- static const uint8_t SDA = 2;
- static const uint8_t SCL = 3;
- #define LED_BUILTIN 13
- static const uint8_t SS = 17;
- static const uint8_t MOSI = 16;
- static const uint8_t MISO = 14;
- static const uint8_t SCK = 15;
- static const uint8_t ADC0 = 18;
- static const uint8_t ADC1 = 19;
- static const uint8_t ADC2 = 20;
- static const uint8_t ADC3 = 21;
- static const uint8_t ADC4 = 22;
- static const uint8_t ADC5 = 23;
- static const uint8_t ADC6 = 24;
- static const uint8_t ADC7 = 25;
- static const uint8_t ADC8 = 26;
- static const uint8_t ADC9 = 27;
- static const uint8_t ADC10 = 28;
- static const uint8_t ADC11 = 29;
- #define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
- #define digitalPinToPCICRbit(p) 0
- #define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
- #define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
- extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
- #define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
- #define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
- #ifdef ARDUINO_MAIN
- const uint16_t PROGMEM port_to_mode_PGM[] = {
- NOT_A_PORT,
- NOT_A_PORT,
- (uint16_t) &DDRB,
- (uint16_t) &DDRC,
- (uint16_t) &DDRD,
- (uint16_t) &DDRE,
- (uint16_t) &DDRF,
- };
- const uint16_t PROGMEM port_to_output_PGM[] = {
- NOT_A_PORT,
- NOT_A_PORT,
- (uint16_t) &PORTB,
- (uint16_t) &PORTC,
- (uint16_t) &PORTD,
- (uint16_t) &PORTE,
- (uint16_t) &PORTF,
- };
- const uint16_t PROGMEM port_to_input_PGM[] = {
- NOT_A_PORT,
- NOT_A_PORT,
- (uint16_t) &PINB,
- (uint16_t) &PINC,
- (uint16_t) &PIND,
- (uint16_t) &PINE,
- (uint16_t) &PINF,
- };
- const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
- PD,
- PD,
- PD,
- PD,
- PD,
- PC,
- PD,
- PE,
- PB,
- PB,
- PB,
- PB,
- PD,
- PC,
- PB,
- PB,
- PB,
- PB,
- PF,
- PF,
- PF,
- PF,
- PF,
- PF,
- PD,
- PD,
- PB,
- PB,
- PB,
- PD,
- };
- const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
- _BV(2),
- _BV(3),
- _BV(1),
- _BV(0),
- _BV(4),
- _BV(6),
- _BV(7),
- _BV(6),
- _BV(4),
- _BV(5),
- _BV(6),
- _BV(7),
- _BV(6),
- _BV(7),
- _BV(3),
- _BV(1),
- _BV(2),
- _BV(0),
- _BV(7),
- _BV(6),
- _BV(5),
- _BV(4),
- _BV(1),
- _BV(0),
- _BV(5),
- _BV(7),
- _BV(4),
- _BV(5),
- _BV(6),
- _BV(6),
- };
- const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- TIMER0B,
- NOT_ON_TIMER,
- TIMER3A,
- TIMER4D,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- TIMER1A,
- TIMER1B,
- TIMER0A,
- NOT_ON_TIMER,
- TIMER4A,
- 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,
- };
- const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
- 7,
- 6,
- 5,
- 4,
- 1,
- 0,
- 8,
- 10,
- 11,
- 12,
- 13,
- 9
- };
- #endif
- #define SERIAL_PORT_MONITOR Serial
- #define SERIAL_PORT_USBVIRTUAL Serial
- #define SERIAL_PORT_HARDWARE Serial1
- #define SERIAL_PORT_HARDWARE_OPEN Serial1
- #endif
|