37 #include "freertos/FreeRTOS.h" 38 #include "freertos/task.h" 39 #include "freertos/timers.h" 40 #include "freertos/semphr.h" 221 struct TerminalCursorState {
222 TerminalCursorState * next;
226 bool cursorPastLastCol;
228 GlyphOptions glyphOptions;
229 uint8_t characterSetIndex;
230 uint8_t characterSet[4];
243 uint8_t characterSetIndex;
246 uint8_t characterSet[4];
248 Color foregroundColor;
249 Color backgroundColor;
255 bool cursorPastLastCol;
262 int scrollingRegionTop;
263 int scrollingRegionDown;
268 bool cursorBlinkingEnabled;
290 KeypadMode keypadMode;
296 int conformanceLevel;
303 bool allow132ColumnMode;
305 bool reverseWraparoundMode;
308 bool backarrowKeyMode;
314 bool VT52GraphicsMode;
499 void logFmt(
const char * format, ...);
500 void log(
const char * txt);
512 void loadFont(FontInfo
const * font);
563 void flush(
bool waitVSync);
651 int write(
const uint8_t * buffer,
int size);
662 size_t write(uint8_t c);
671 void clearMap(uint32_t * map);
675 void freeGlyphsMap();
677 void set132ColumnMode(
bool value);
681 void setCursorPos(
int X,
int Y);
682 int getAbsoluteRow(
int Y);
684 void int_setBackgroundColor(
Color color);
685 void int_setForegroundColor(
Color color);
689 void setTabStop(
int column,
bool set);
690 void resetTabStops();
694 void scrollDownAt(
int startingRow);
696 void scrollUpAt(
int startingRow);
697 void setScrollingRegion(
int top,
int down,
bool resetCursorPos =
true);
698 void updateCanvasScrollingRegion();
701 void saveCursorState();
702 void restoreCursorState();
703 void clearSavedCursorStates();
705 void erase(
int X1,
int Y1,
int X2,
int Y2,
char c,
bool maintainDoubleWidth,
bool selective);
707 void consumeInputQueue();
710 void consumeCSIQUOT(
int * params,
int paramsCount);
711 void consumeCSISPC(
int * params,
int paramsCount);
712 char consumeParamsAndGetCode(
int * params,
int * paramsCount,
bool * questionMarkFound);
713 void consumeDECPrivateModes(
int const * params,
int paramsCount,
char c);
715 void execSGRParameters(
int const * params,
int paramsCount);
716 void consumeESCVT52();
718 void execCtrlCode(
char c);
720 static void charsConsumerTask(
void * pvParameters);
721 static void keyboardReaderTask(
void * pvParameters);
723 static void blinkTimerFunc(TimerHandle_t xTimer);
725 bool enableBlinkingText(
bool value);
727 bool int_enableCursor(
bool value);
729 char getNextCode(
bool processCtrlCodes);
731 void setChar(
char c);
734 void insertAt(
int column,
int row,
int count);
735 void deleteAt(
int column,
int row,
int count);
737 void reverseVideo(
bool value);
740 void refresh(
int X,
int Y);
741 void refresh(
int X1,
int Y1,
int X2,
int Y2);
745 void setLineDoubleWidth(
int row,
int value);
746 int getCharWidthAt(
int row);
747 int getColumnsAt(
int row);
749 void useAlternateScreenBuffer(
bool value);
752 void send(
char const * str);
756 void sendCursorKeyCode(
char c);
757 void sendKeypadCursorKeyCode(
char applicationCode,
const char * numericCode);
762 Stream * m_logStream;
766 GlyphsBuffer m_glyphsBuffer;
769 uint32_t * m_alternateMap;
772 bool m_alternateScreenBuffer;
775 int m_alternateCursorX;
776 int m_alternateCursorY;
785 Color m_defaultForegroundColor;
786 Color m_defaultBackgroundColor;
789 bool m_prevCursorEnabled;
790 bool m_prevBlinkingTextEnabled;
793 TaskHandle_t m_charsConsumerTaskHandle;
796 TaskHandle_t m_keyboardReaderTaskHandle;
799 volatile bool m_cursorState;
802 TimerHandle_t m_blinkTimer;
803 volatile SemaphoreHandle_t m_blinkTimerMutex;
805 volatile bool m_blinkingTextVisible;
806 volatile bool m_blinkingTextEnabled;
808 volatile int m_columns;
814 HardwareSerial * m_serialPort;
817 QueueHandle_t m_inputQueue;
820 QueueHandle_t m_outputQueue;
823 TerminalCursorState * m_savedCursorStateList;
826 bool m_resetRequested;
void connectSerialPort(HardwareSerial &serialPort, bool autoXONXOFF=true)
Connects a remove host using the specified serial port.
Definition: terminal.cpp:132
void flush()
Waits for all codes sent to the display has been processed.
Definition: terminal.cpp:963
void pollSerialPort()
Pools the serial port for incoming data.
Definition: terminal.cpp:969
void clear()
Clears the screen.
Definition: terminal.cpp:413
Color
This enum defines named colors.
Definition: vgacontroller.h:212
This file contains fabgl::KeyboardClass definition and the Keyboard instance.
void localWrite(uint8_t c)
Injects keys into the keyboard queue.
Definition: terminal.cpp:916
An ANSI-VT100 compatible display terminal.
Definition: terminal.h:399
int available()
Gets the number of codes available in the keyboard queue.
Definition: terminal.cpp:939
void setForegroundColor(Color color, bool setAsDefault=true)
Sets the foreground color.
Definition: terminal.cpp:387
This file contains fabgl::CanvasClass definition and the related Canvas instance. ...
int getRows()
Returns the number of lines.
Definition: terminal.h:577
int availableForWrite()
Determines number of codes that the display input queue can still accept.
Definition: terminal.cpp:1054
VirtualKey
Represents each possible real or derived (SHIFT + real) key.
Definition: fabutils.h:366
void enableCursor(bool value)
Enables or disables cursor.
Definition: terminal.cpp:494
Definition: canvas.cpp:47
void begin()
Initializes the terminal.
Definition: terminal.cpp:84
Specifies various glyph painting options.
Definition: vgacontroller.h:284
void end()
Finalizes the terminal.
Definition: terminal.cpp:221
int getColumns()
Returns the number of columns.
Definition: terminal.h:570
void setBackgroundColor(Color color, bool setAsDefault=true)
Sets the background color.
Definition: terminal.cpp:371
This file contains FabGL library configuration settings, like number of supported colors...
int peek()
Reads a code from the keyboard without advancing to the next one.
Definition: terminal.cpp:957
int read()
Reads codes from keyboard.
Definition: terminal.cpp:945
void loadFont(FontInfo const *font)
Sets the font to use.
Definition: terminal.cpp:310
void setLogStream(Stream &stream)
Sets the stream where to output debugging logs.
Definition: terminal.h:497
void connectLocally()
Permits using of terminal locally.
Definition: terminal.cpp:150
int write(const uint8_t *buffer, int size)
Sends specified number of codes to the display.
Definition: terminal.cpp:1072
Specifies general paint options.
Definition: vgacontroller.h:483