void print_info()
{
Terminal.
write(
"\e[37m* * FabGL - Loopback VT/ANSI Terminal\r\n");
Terminal.
write(
"\e[34m* * 2019-2022 by Fabrizio Di Vittorio - www.fabgl.com\e[32m\r\n\n");
Terminal.printf(
"\e[32mTerminal Size :\e[33m %d x %d\r\n", Terminal.
getColumns(), Terminal.
getRows());
Terminal.printf("\e[32mFree DMA Memory :\e[33m %d\r\n", heap_caps_get_free_size(MALLOC_CAP_DMA));
Terminal.printf("\e[32mFree 32 bit Memory :\e[33m %d\r\n\n", heap_caps_get_free_size(MALLOC_CAP_32BIT));
Terminal.
write(
"\e[32mFree typing test - press ESC to introduce escape VT/ANSI codes\r\n\n");
}
void setup()
{
Serial.begin(115200);
PS2Controller.
begin(PS2Preset::KeyboardPort0);
DisplayController.
begin();
Terminal.
begin(&DisplayController);
print_info();
}
void loop()
{
char c = Terminal.
read();
switch (c) {
case 0x7F:
Terminal.
write(
"\b\e[K");
break;
case 0x0D:
break;
default:
break;
}
}
}
int getViewPortHeight()
Determines vertical size of the viewport.
int getViewPortWidth()
Determines horizontal size of the viewport.
bool isKeyboardAvailable()
Checks if keyboard has been detected and correctly initialized.
static Keyboard * keyboard()
Returns the instance of Keyboard object automatically created by PS2Controller.
static void begin(gpio_num_t port0_clkGPIO, gpio_num_t port0_datGPIO, gpio_num_t port1_clkGPIO=GPIO_UNUSED, gpio_num_t port1_datGPIO=GPIO_UNUSED)
Initializes PS2 device controller.
The PS2 device controller class.
void connectLocally()
Permits using of terminal locally.
int getRows()
Returns the number of lines.
void clear(bool moveCursor=true)
Clears the screen.
int available()
Gets the number of codes available in the keyboard queue.
int getColumns()
Returns the number of columns.
size_t write(const uint8_t *buffer, size_t size)
Sends specified number of codes to the display.
int read()
Reads codes from keyboard.
void enableCursor(bool value)
Enables or disables cursor.
void setBackgroundColor(Color color, bool setAsDefault=true)
Sets the background color.
bool begin(BaseDisplayController *displayController, int maxColumns=-1, int maxRows=-1, Keyboard *keyboard=nullptr)
Initializes the terminal.
void setForegroundColor(Color color, bool setAsDefault=true)
Sets the foreground color.
An ANSI-VT100 compatible display terminal.
void begin(gpio_num_t redGPIO, gpio_num_t greenGPIO, gpio_num_t blueGPIO, gpio_num_t HSyncGPIO, gpio_num_t VSyncGPIO)
This is the 8 colors (5 GPIOs) initializer.
void setResolution(char const *modeline=nullptr, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)
Sets fixed resolution.
Represents the VGA text-only controller.
This file is the all in one include file. Application can just include this file to use FabGL library...