It is possible to specify inverted pins on UART ports when using Teensy. This is documented here: https://www.pjrc.com/teensy/td_uart.html under the Serial1.begin(baud, format) section.
For MIDI, the relevant formats are :
Format Name
Data Bits
Parity
RX Polarity
TX Polarity
SERIAL_8N1
8
None
Normal
Normal
SERIAL_8N1_RXINV
8
None
Inverted
Normal
SERIAL_8N1_TXINV
8
None
Normal
Inverted
SERIAL_8N1_RXINV_TXINV
8
None
Inverted
Inverted
This allows more flexibility with input and output circuits that may be inverting.
In order to configure the polarity, it is important to inherit the custom settings struct from DefaultSerialSettings instead of DefaultSettings
It is possible to specify inverted pins on UART ports when using Teensy. This is documented here: https://www.pjrc.com/teensy/td_uart.html under the
Serial1.begin(baud, format)
section.For MIDI, the relevant formats are :
SERIAL_8N1
SERIAL_8N1_RXINV
SERIAL_8N1_TXINV
SERIAL_8N1_RXINV_TXINV
This allows more flexibility with input and output circuits that may be inverting.
In order to configure the polarity, it is important to inherit the custom settings struct from
DefaultSerialSettings
instead ofDefaultSettings