123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
- #include <avr/pgmspace.h>
- #define NUM_DIGITAL_PINS 48
- #define NUM_ANALOG_INPUTS 8
- #define TX_RX_LED_INIT DDRE |= (1<<7)
- #define TXLED0 0
- #define TXLED1 0
- #define RXLED0 PORTE |= (1<<7)
- #define RXLED1 PORTE &= ~(1<<7)
- static const uint8_t SDA = 0;
- static const uint8_t SCL = 1;
- static const uint8_t SS = 20;
- static const uint8_t MOSI = 22;
- static const uint8_t MISO = 23;
- static const uint8_t SCK = 21;
- static const uint8_t A0 = 38;
- static const uint8_t A1 = 39;
- static const uint8_t A2 = 40;
- static const uint8_t A3 = 41;
- static const uint8_t A4 = 42;
- static const uint8_t A5 = 43;
- static const uint8_t A6 = 44;
- static const uint8_t A7 = 45;
- #define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
- #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))))))
- #define digitalPinHasPWM(p) ((p) == 12 || (p) == 13 || (p) == 14 || (p) == 20 || (p) == 21 || (p) == 22)
- extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
- #define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
- #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,
- };
- 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,
- };
- const uint16_t PROGMEM port_to_input_PGM[] = {
- NOT_A_PORT,
- (uint16_t) &PINA,
- (uint16_t) &PINB,
- (uint16_t) &PINC,
- (uint16_t) &PIND,
- (uint16_t) &PINE,
- };
- const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
- PA,
- PA,
- PA,
- PA,
- PA,
- PA,
- PA,
- PA,
- PB,
- PB,
- PB,
- PB,
- PB,
- PB,
- PB,
- PB,
- PC,
- PC,
- PC,
- PC,
- PC,
- PC,
- PC,
- PC,
- PD,
- PD,
- PD,
- PD,
- PD,
- PD,
- PD,
- PD,
- PE,
- PE,
- PE,
- PE,
- PE,
- PE,
- PE,
- PE,
- PF,
- PF,
- PF,
- PF,
- PF,
- PF,
- PF,
- PF,
- };
- 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(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),
- };
- const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
- 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,
- TIMER2A,
- TIMER1A,
- TIMER1B,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- NOT_ON_TIMER,
- TIMER3C,
- TIMER3B,
- TIMER3A,
- 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,
- };
- const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = {
- 7,
- 6,
- 5,
- 4,
- 1,
- 0,
- 8,
- 10,
- 11,
- 12,
- 13,
- 9
- };
- #endif /* ARDUINO_MAIN */
- #endif /* Pins_Arduino_h */
|