FabGL
ESP32 Display Controller and Graphics Library
|
void connectSerialPort | ( | uint32_t | baud, |
int | dataLength, | ||
char | parity, | ||
float | stopBits, | ||
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).
baud | Baud rate. |
dataLength | Data word length. 5 = 5 bits, 6 = 6 bits, 7 = 7 bits, 8 = 8 bits |
parity | Parity. 'N' = none, 'E' = even, 'O' = odd |
stopBits | Number of stop bits. 1 = 1 bit, 1.5 = 1.5 bits, 2 = 2 bits, 3 = 3 bits |
rxPin | UART RX pin GPIO number. |
txPin | UART TX pin GPIO number. |
flowControl | Flow control. |
inverted | If true RX and TX signals are inverted. |
rtsPin | RTS signal GPIO number (-1 = not used) |
ctsPin | CTS signal GPIO number (-1 = not used) |
Example:
Terminal.begin(&DisplayController); Terminal.connectSerialPort(115200, 8, 'N', 1, 34, 2, FlowControl::Software);
Definition at line 542 of file terminal.cpp.