45#include "freertos/FreeRTOS.h"
47#include "driver/spi_master.h"
57#define TFT_MADCTL 0x36
123 void begin(SPIClass * spi, gpio_num_t DC, gpio_num_t RESX = GPIO_UNUSED, gpio_num_t CS = GPIO_UNUSED);
144 void begin(SPIClass * spi,
int DC,
int RESX = -1,
int CS = -1);
166 void begin(
int SCK,
int MOSI,
int DC,
int RESX,
int CS,
int host);
197 void setResolution(
char const * modeline,
int viewPortWidth = -1,
int viewPortHeight = -1,
bool doubleBuffered =
false);
242 void readScreen(
Rect const & rect,
RGB888 * destBuf);
247 void reset() { hardReset(); softReset(); }
274 virtual void softReset() = 0;
276 virtual void setupOrientation();
279 int getBitmapSavePixelSize() {
return 2; }
287 void sendScreenBuffer(Rect updateRect);
288 void writeCommand(uint8_t cmd);
289 void writeByte(uint8_t
data);
290 void writeWord(uint16_t
data);
291 void writeData(
void *
data,
size_t size);
296 void SPIBeginWrite();
298 void SPIWriteByte(uint8_t
data);
299 void SPIWriteWord(uint16_t
data);
300 void SPIWriteBuffer(
void *
data,
size_t size);
302 void allocViewPort();
305 static void updateTaskFunc(
void * pvParameters);
308 void setPixelAt(PixelDesc
const & pixelDesc, Rect & updateRect);
311 void clear(Rect & updateRect);
314 void drawEllipse(Size
const & size, Rect & updateRect);
316 void VScroll(
int scroll, Rect & updateRect);
318 void HScroll(
int scroll, Rect & updateRect);
321 void drawGlyph(Glyph
const & glyph, GlyphOptions glyphOptions, RGB888 penColor, RGB888 brushColor, Rect & updateRect);
327 void invertRect(Rect
const & rect, Rect & updateRect);
330 void copyRect(Rect
const & source, Rect & updateRect);
333 void swapFGBG(Rect
const & rect, Rect & updateRect);
336 void absDrawLine(
int X1,
int Y1,
int X2,
int Y2, RGB888 color);
339 void rawFillRow(
int y,
int x1,
int x2, RGB888 color);
341 void rawFillRow(
int y,
int x1,
int x2, uint16_t pattern);
343 void swapRows(
int yA,
int yB,
int x1,
int x2);
345 void rawInvertRow(
int y,
int x1,
int x2);
348 void rawDrawBitmap_Native(
int destX,
int destY, Bitmap
const * bitmap,
int X1,
int Y1,
int XCount,
int YCount);
351 void rawDrawBitmap_Mask(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount);
354 void rawDrawBitmap_RGBA2222(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount);
357 void rawDrawBitmap_RGBA8888(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount);
364 spi_host_device_t m_SPIHost;
371 spi_device_handle_t m_SPIDevHandle;
373 uint16_t * * m_viewPort;
375 int16_t m_screenWidth;
376 int16_t m_screenHeight;
381 int16_t m_rot0ViewPortWidth;
382 int16_t m_rot0ViewPortHeight;
385 int16_t m_controllerWidth;
386 int16_t m_controllerHeight;
389 int16_t m_rotOffsetX;
390 int16_t m_rotOffsetY;
392 TaskHandle_t m_updateTaskHandle;
394 volatile int m_updateTaskFuncSuspended;
395 volatile bool m_updateTaskRunning;
398 bool m_reverseHorizontal;
void setOrientation(TFTOrientation value, bool force=false)
Set display orientation and rotation.
void setScreenCol(int value)
Set initial left column of the viewport.
void suspendBackgroundPrimitiveExecution()
Suspends drawings.
void setReverseHorizontal(bool value)
Inverts horizontal axis.
void setResolution(char const *modeline, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)
Sets TFT resolution and viewport size.
void resumeBackgroundPrimitiveExecution()
Resumes drawings after suspendBackgroundPrimitiveExecution().
NativePixelFormat nativePixelFormat()
Represents the native pixel format used by this display.
int screenRow()
Gets initial top row of the viewport.
virtual int colorsCount()
Determines number of colors this display can provide.
int screenCol()
Gets initial left column of the viewport.
void begin()
Initializes TFT display controller.
void reset()
Performs display hardware and software.
void setScreenRow(int value)
Set initial top row of the viewport.
Base abstract class for TFT drivers with SPI connection.
This file contains fabgl::BitmappedDisplayController definition.
This file contains FabGL library configuration settings, like number of supported colors,...
This file contains some utility classes and functions.
NativePixelFormat
This enum defines the display controller native pixel format.
TFTOrientation
This enum defines TFT orientation.
Represents a 24 bit RGB color.