I took three files from GitHub - Bodmer/TFT_eSPI: Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips and checked them against the example provided by Buy Displays:
-
GC9A01_Defines.h
, -
GC9A01_Init.h
to be called first; and -
GC9A01_Rotation.h
to set the coordinates according to the orientation
To set a point at (x1, y1) with colour
x2 = x1;
y2 = y1;
_writeCommand8(TFT_CASET);
_writeData16(x1);
_writeData16(x2);
_writeCommand8(TFT_PASET);
_writeData16(y1);
_writeData16(y2);
_writeCommand8(TFT_RAMWR);
_writeData16(colour);
That’s it!