40#include "driver/gpio.h"
51#define VGATextController_WIDTH 640
52#define VGATextController_HEIGHT 480
53#define VGATextController_MODELINE VGA_640x480_60Hz
102 void begin(gpio_num_t redGPIO, gpio_num_t greenGPIO, gpio_num_t blueGPIO, gpio_num_t HSyncGPIO, gpio_num_t VSyncGPIO);
123 void begin(gpio_num_t red1GPIO, gpio_num_t red0GPIO, gpio_num_t green1GPIO, gpio_num_t green0GPIO, gpio_num_t blue1GPIO, gpio_num_t blue0GPIO, gpio_num_t HSyncGPIO, gpio_num_t VSyncGPIO);
142 void setResolution(
char const * modeline =
nullptr,
int viewPortWidth = -1,
int viewPortHeight = -1,
bool doubleBuffered =
false);
149 void setTextMap(uint32_t
const * map,
int rows);
159 int getColumns() {
return s_columns; }
160 int getRows() {
return s_rows; }
163 void enableCursor(
bool value) { m_cursorEnabled = value; }
164 void setCursorPos(
int row,
int col) { m_cursorRow = row; m_cursorCol = col; m_cursorCounter = 0; }
165 void setCursorSpeed(
int value) { m_cursorSpeed = value; }
166 void setCursorForeground(
Color value);
167 void setCursorBackground(
Color value);
185 void setFont(FontInfo
const * value);
187 FontInfo
const * getFont() {
return m_font; }
192 void init(gpio_num_t VSyncGPIO);
193 void setupGPIO(gpio_num_t gpio,
int bit, gpio_mode_t mode);
196 void fillDMABuffers();
197 uint8_t packHVSync(
bool HSync,
bool VSync);
198 uint8_t preparePixelWithSync(RGB222 rgb,
bool HSync,
bool VSync);
200 uint8_t IRAM_ATTR preparePixel(RGB222 rgb) {
return m_HVSync | (rgb.B << VGA_BLUE_BIT) | (rgb.G << VGA_GREEN_BIT) | (rgb.R << VGA_RED_BIT); }
202 static void ISRHandler(
void * arg);
205 static volatile int s_scanLine;
206 static uint32_t s_blankPatternDWord;
207 static uint32_t * s_fgbgPattern;
208 static int s_textRow;
209 static bool s_upperRow;
210 static lldesc_t
volatile * s_frameResetDesc;
211 static int16_t s_charWidthInBytes;
212 static int16_t s_charHeight;
213 static int16_t s_columns;
214 static int16_t s_rows;
216 VGATimings m_timings;
218 GPIOStream m_GPIOStream;
219 int m_bitsPerChannel;
220 lldesc_t
volatile * m_DMABuffers;
221 int m_DMABuffersCount;
227 volatile uint8_t * m_blankLine;
228 volatile uint8_t * m_syncLine;
230 intr_handle_t m_isr_handle;
233 volatile uint8_t m_HVSync;
235 uint8_t * m_charData;
236 uint32_t
const * m_map;
239 bool m_cursorEnabled;
244 uint8_t m_cursorForeground;
245 uint8_t m_cursorBackground;
246 FontInfo
const * m_font;
Represents the base abstract class for textual display controllers.
void setResolution(char const *modeline=nullptr, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)
Sets fixed resolution.
int colorsCount()
Determines number of colors this display can provide.
void setTextMap(uint32_t const *map, int rows)
Sets text map to display.
void setFont(FontInfo const *value)
Sets font.
void adjustMapSize(int *columns, int *rows)
Adjusts columns and rows to the controller limits.
void begin()
This is the 64 colors (8 GPIOs) initializer using default pinout.
Represents the VGA text-only controller.
This file contains FabGL library configuration settings, like number of supported colors,...
This file contains some utility classes and functions.
Color
This enum defines named colors.
This file contains fabgl::GPIOStream definition.
This file contains fabgl::VGAController definition.