FabGL
ESP32 Display Controller and Graphics Library

◆ connectSerialPort() [2/2]

void connectSerialPort ( uint32_t  baud,
uint32_t  config,
int  rxPin,
int  txPin,
FlowControl  flowControl,
bool  inverted = false,
int  rtsPin = -1,
int  ctsPin = -1 
)

Connects a remote host using UART.

When serial port is set, the typed keys on PS/2 keyboard are encoded as ANSI/VT100 codes and then sent to the specified serial port.
Also replies to terminal queries like terminal identification, cursor position, etc.. will be sent to the serial port.
This method setups the UART2 with specified parameters. Received characters are handlded using interrupts freeing main loop to do something other.

This is the preferred way to connect the Terminal with a serial port.
You may call connectSerialPort whenever a parameters needs to be changed (except for rx and tx pins).

Parameters
baudBaud rate.
configDefines word length, parity and stop bits. Example: SERIAL_8N1.
rxPinUART RX pin GPIO number.
txPinUART TX pin GPIO number.
flowControlFlow control.
invertedIf true RX and TX signals are inverted.
rtsPinRTS signal GPIO number (-1 = not used)
ctsPinCTS signal GPIO number (-1 = not used)

Example:

Terminal.begin(&DisplayController);
Terminal.connectSerialPort(115200, SERIAL_8N1, 34, 2, FlowControl::Software);

Definition at line 543 of file terminal.cpp.