diff options
Diffstat (limited to 'variants/leonardo')
| -rw-r--r-- | variants/leonardo/pins_arduino.h | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/variants/leonardo/pins_arduino.h b/variants/leonardo/pins_arduino.h index 2c7f837..fd75373 100644 --- a/variants/leonardo/pins_arduino.h +++ b/variants/leonardo/pins_arduino.h @@ -101,6 +101,7 @@  static const uint8_t SDA = 2;  static const uint8_t SCL = 3; +#define LED_BUILTIN 13  // Map SPI port to 'new' pins D14..D17  static const uint8_t SS   = 17; @@ -132,6 +133,8 @@ static const uint8_t A11 = 29;	// D12  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  // On the Arduino board, digital pins are also used @@ -334,4 +337,25 @@ const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {  };  #endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use.  For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR        Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL     Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE    Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE       Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN  Hardware serial ports which are open for use.  Their RX & TX +//                            pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR        Serial +#define SERIAL_PORT_USBVIRTUAL     Serial +#define SERIAL_PORT_HARDWARE       Serial1 +#define SERIAL_PORT_HARDWARE_OPEN  Serial1 +  #endif /* Pins_Arduino_h */ | 
