// folder. The Windows installer puts Arduino in C:\Program Files (x86)\Arduino | // folder. The Windows installer puts Arduino in C:\Program Files (x86)\Arduino | ||||
// On Macintosh, you must control-click Arduino and select "Show Package Contents", then | // On Macintosh, you must control-click Arduino and select "Show Package Contents", then | ||||
// look in Contents/Java/hardware/teensy/avr/cores/teensy3 to find this file. | // look in Contents/Java/hardware/teensy/avr/cores/teensy3 to find this file. | ||||
// | |||||
// Teensy 3.x boards support 9 bit mode on all their serial ports | |||||
// Teensy LC only supports 9 bit mode on Serial1. Serial2 & Serial3 can't use 9 bits. | |||||
#define SERIAL_7E1 0x02 | #define SERIAL_7E1 0x02 |
c = UART1_C3 & ~0x10; | c = UART1_C3 & ~0x10; | ||||
if (format & 0x20) c |= 0x10; // tx invert | if (format & 0x20) c |= 0x10; // tx invert | ||||
UART1_C3 = c; | UART1_C3 = c; | ||||
#ifdef SERIAL_9BIT_SUPPORT | |||||
#if defined(SERIAL_9BIT_SUPPORT) && !defined(KINETISL) | |||||
c = UART1_C4 & 0x1F; | c = UART1_C4 & 0x1F; | ||||
if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits) | if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits) | ||||
UART1_C4 = c; | UART1_C4 = c; |
c = UART2_C3 & ~0x10; | c = UART2_C3 & ~0x10; | ||||
if (format & 0x20) c |= 0x10; // tx invert | if (format & 0x20) c |= 0x10; // tx invert | ||||
UART2_C3 = c; | UART2_C3 = c; | ||||
#ifdef SERIAL_9BIT_SUPPORT | |||||
#if defined(SERIAL_9BIT_SUPPORT) && !defined(KINETISL) | |||||
c = UART2_C4 & 0x1F; | c = UART2_C4 & 0x1F; | ||||
if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits) | if (format & 0x08) c |= 0x20; // 9 bit mode with parity (requires 10 bits) | ||||
UART2_C4 = c; | UART2_C4 = c; |