From e7c24c66a931c9a06e89cd2f61baffc00af0d238 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 11 Nov 2013 11:39:37 +0100 Subject: [PATCH] Added SERIAL metadata into variant files. --- .../arduino/variants/ethernet/pins_arduino.h | 18 ++++++++++++++ .../arduino/variants/leonardo/pins_arduino.h | 21 ++++++++++++++++ hardware/arduino/variants/mega/pins_arduino.h | 24 +++++++++++++++++++ .../variants/robot_control/pins_arduino.h | 20 ++++++++++++++++ .../variants/robot_motor/pins_arduino.h | 20 ++++++++++++++++ .../arduino/variants/standard/pins_arduino.h | 18 ++++++++++++++ 6 files changed, 121 insertions(+) diff --git a/hardware/arduino/variants/ethernet/pins_arduino.h b/hardware/arduino/variants/ethernet/pins_arduino.h index 967669822..b7030d0e2 100644 --- a/hardware/arduino/variants/ethernet/pins_arduino.h +++ b/hardware/arduino/variants/ethernet/pins_arduino.h @@ -215,4 +215,22 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { #endif +// 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_HARDWARE Serial +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + #endif diff --git a/hardware/arduino/variants/leonardo/pins_arduino.h b/hardware/arduino/variants/leonardo/pins_arduino.h index 9f3246a49..473b92e3b 100644 --- a/hardware/arduino/variants/leonardo/pins_arduino.h +++ b/hardware/arduino/variants/leonardo/pins_arduino.h @@ -335,4 +335,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 */ diff --git a/hardware/arduino/variants/mega/pins_arduino.h b/hardware/arduino/variants/mega/pins_arduino.h index b0b4290a3..9991a21c1 100644 --- a/hardware/arduino/variants/mega/pins_arduino.h +++ b/hardware/arduino/variants/mega/pins_arduino.h @@ -360,4 +360,28 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { #endif +// 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_HARDWARE Serial +#define SERIAL_PORT_HARDWARE1 Serial1 +#define SERIAL_PORT_HARDWARE2 Serial2 +#define SERIAL_PORT_HARDWARE3 Serial3 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 +#define SERIAL_PORT_HARDWARE_OPEN1 Serial2 +#define SERIAL_PORT_HARDWARE_OPEN2 Serial3 + #endif diff --git a/hardware/arduino/variants/robot_control/pins_arduino.h b/hardware/arduino/variants/robot_control/pins_arduino.h index 1967845c0..4acfc0df8 100644 --- a/hardware/arduino/variants/robot_control/pins_arduino.h +++ b/hardware/arduino/variants/robot_control/pins_arduino.h @@ -278,4 +278,24 @@ const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = { }; #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 + #endif /* Pins_Arduino_h */ diff --git a/hardware/arduino/variants/robot_motor/pins_arduino.h b/hardware/arduino/variants/robot_motor/pins_arduino.h index 36d2742ad..fdb4c6773 100644 --- a/hardware/arduino/variants/robot_motor/pins_arduino.h +++ b/hardware/arduino/variants/robot_motor/pins_arduino.h @@ -273,4 +273,24 @@ const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = { }; #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 + #endif /* Pins_Arduino_h */ diff --git a/hardware/arduino/variants/standard/pins_arduino.h b/hardware/arduino/variants/standard/pins_arduino.h index b024ca1b9..2e24e1979 100644 --- a/hardware/arduino/variants/standard/pins_arduino.h +++ b/hardware/arduino/variants/standard/pins_arduino.h @@ -215,4 +215,22 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { #endif +// 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_HARDWARE Serial + #endif