45 #include "freertos/FreeRTOS.h" 47 #include "driver/spi_master.h" 54 #define TFT_CASET 0x2A 55 #define TFT_RASET 0x2B 56 #define TFT_RAMWR 0x2C 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);
248 void readScreen(
Rect const & rect,
RGB888 * destBuf);
253 void reset() { hardReset(); softReset(); }
280 virtual void softReset() = 0;
282 virtual void setupOrientation();
285 int getBitmapSavePixelSize() {
return 2; }
293 void sendScreenBuffer(Rect updateRect);
294 void writeCommand(uint8_t cmd);
295 void writeByte(uint8_t
data);
296 void writeWord(uint16_t
data);
297 void writeData(
void *
data,
size_t size);
302 void SPIBeginWrite();
304 void SPIWriteByte(uint8_t
data);
305 void SPIWriteWord(uint16_t
data);
306 void SPIWriteBuffer(
void *
data,
size_t size);
308 void allocViewPort();
311 static void updateTaskFunc(
void * pvParameters);
314 void setPixelAt(PixelDesc
const & pixelDesc, Rect & updateRect);
317 void clear(Rect & updateRect);
320 void drawEllipse(Size
const & size, Rect & updateRect);
322 void VScroll(
int scroll, Rect & updateRect);
324 void HScroll(
int scroll, Rect & updateRect);
327 void drawGlyph(Glyph
const & glyph, GlyphOptions glyphOptions, RGB888 penColor, RGB888 brushColor, Rect & updateRect);
333 void invertRect(Rect
const & rect, Rect & updateRect);
336 void copyRect(Rect
const & source, Rect & updateRect);
339 void swapFGBG(Rect
const & rect, Rect & updateRect);
342 void absDrawLine(
int X1,
int Y1,
int X2,
int Y2, RGB888 color);
345 void rawFillRow(
int y,
int x1,
int x2, RGB888 color);
347 void rawFillRow(
int y,
int x1,
int x2, uint16_t pattern);
349 void swapRows(
int yA,
int yB,
int x1,
int x2);
351 void rawInvertRow(
int y,
int x1,
int x2);
354 void rawDrawBitmap_Native(
int destX,
int destY, Bitmap
const * bitmap,
int X1,
int Y1,
int XCount,
int YCount);
357 void rawDrawBitmap_Mask(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount);
360 void rawDrawBitmap_RGBA2222(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount);
363 void rawDrawBitmap_RGBA8888(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount);
370 spi_host_device_t m_SPIHost;
377 spi_device_handle_t m_SPIDevHandle;
379 uint16_t * * m_viewPort;
381 int16_t m_screenWidth;
382 int16_t m_screenHeight;
386 int16_t m_viewPortWidth;
387 int16_t m_viewPortHeight;
390 int16_t m_rot0ViewPortWidth;
391 int16_t m_rot0ViewPortHeight;
394 int16_t m_controllerWidth;
395 int16_t m_controllerHeight;
398 int16_t m_rotOffsetX;
399 int16_t m_rotOffsetY;
401 TaskHandle_t m_updateTaskHandle;
403 volatile int m_updateTaskFuncSuspended;
404 volatile bool m_updateTaskRunning;
407 bool m_reverseHorizontal;
Represents a 24 bit RGB color.
void reset()
Performs display hardware and software.
int screenCol()
Gets initial left column of the viewport.
NativePixelFormat nativePixelFormat()
Represents the native pixel format used by this display.
int screenRow()
Gets initial top row of the viewport.
void resumeBackgroundPrimitiveExecution()
Resumes drawings after suspendBackgroundPrimitiveExecution().
Base abstract class for TFT drivers with SPI connection.
void setScreenRow(int value)
Set initial top row of the viewport.
void suspendBackgroundPrimitiveExecution()
Suspends drawings.
This file contains fabgl::BitmappedDisplayController definition.
void setOrientation(TFTOrientation value, bool force=false)
Set display orientation and rotation.
This file contains some utility classes and functions.
TFTOrientation
This enum defines TFT orientation.
NativePixelFormat
This enum defines the display controller native pixel format.
void setResolution(char const *modeline, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)
Sets TFT resolution and viewport size.
virtual int colorsCount()
Determines number of colors this display can provide.
This file contains FabGL library configuration settings, like number of supported colors...
void setReverseHorizontal(bool value)
Inverts horizontal axis.
void setScreenCol(int value)
Set initial left column of the viewport.
void begin()
Initializes TFT display controller.
int getViewPortWidth()
Determines horizontal size of the viewport.
int getViewPortHeight()
Determines vertical size of the viewport.