123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
- #include <avr/pgmspace.h>
- #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;
- 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 A0 = 18;
- static const uint8_t A1 = 19;
- static const uint8_t A2 = 20;
- static const uint8_t A3 = 21;
- static const uint8_t A4 = 22;
- static const uint8_t A5 = 23;
- static const uint8_t A6 = 24;
- static const uint8_t A7 = 25;
- static const uint8_t A8 = 26;
- static const uint8_t A9 = 27;
- static const uint8_t A10 = 28;
- static const uint8_t A11 = 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) ) )
- #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[30] = {
- 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[30] = {
- _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(4),
- _BV(7),
- _BV(4),
- _BV(5),
- _BV(6),
- _BV(6),
- };
- const uint8_t PROGMEM digital_pin_to_timer_PGM[16] = {
- 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,
- };
- const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = {
- 7,
- 6,
- 5,
- 4,
- 1,
- 0,
- 8,
- 10,
- 11,
- 12,
- 13,
- 9
- };
- #endif
- #endif
|