Skip to content

Commit 56572fa

Browse files
committed
Added SERIAL metadata into variant files.
1 parent 78abc56 commit 56572fa

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

hardware/arduino/avr/variants/yun/pins_arduino.h

+24
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,27 @@
2525
#include "../leonardo/pins_arduino.h"
2626

2727
#define LED_BUILTIN 13
28+
29+
// These serial port names are intended to allow libraries and architecture-neutral
30+
// sketches to automatically default to the correct port name for a particular type
31+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
32+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
33+
//
34+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
35+
//
36+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
37+
//
38+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
39+
//
40+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
41+
//
42+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
43+
// pins are NOT connected to anything by default.
44+
#define SERIAL_PORT_MONITOR Serial
45+
#define SERIAL_PORT_USBVIRTUAL Serial
46+
#define SERIAL_PORT_HARDWARE Serial1
47+
#define SERIAL_PORT_LINUXBRIDGE Serial1
48+
49+
// this is defined in the Leonardo variant
50+
#undef SERIAL_PORT_HARDWARE_OPEN
51+

hardware/arduino/sam/variants/arduino_due_x/variant.h

+25
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,30 @@ extern USARTClass Serial3;
222222

223223
#endif
224224

225+
// These serial port names are intended to allow libraries and architecture-neutral
226+
// sketches to automatically default to the correct port name for a particular type
227+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
228+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
229+
//
230+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
231+
//
232+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
233+
//
234+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
235+
//
236+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
237+
//
238+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
239+
// pins are NOT connected to anything by default.
240+
#define SERIAL_PORT_MONITOR Serial
241+
#define SERIAL_PORT_USBVIRTUAL SerialUSB
242+
#define SERIAL_PORT_HARDWARE_OPEN Serial1
243+
#define SERIAL_PORT_HARDWARE_OPEN1 Serial2
244+
#define SERIAL_PORT_HARDWARE_OPEN2 Serial3
245+
#define SERIAL_PORT_HARDWARE Serial
246+
#define SERIAL_PORT_HARDWARE1 Serial1
247+
#define SERIAL_PORT_HARDWARE2 Serial2
248+
#define SERIAL_PORT_HARDWARE3 Serial3
249+
225250
#endif /* _VARIANT_ARDUINO_DUE_X_ */
226251

0 commit comments

Comments
 (0)