TFT_eSPI separates the concept of the text cursor (used byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Marcussacapuces91/doc-TFT_eSPI/llms.txt
Use this file to discover all available pages before exploring further.
print() / println() and respected by drawChar()) from the drawing origin (a coordinate offset applied to all drawing commands). The display can be rotated to any of four orientations without reinitializing the hardware. Low-level pixel-streaming helpers (pushColor(), pushColors(), pushBlock(), pushPixels()) allow efficient bulk writes when the address window has been set manually. SPI transactions can be batched with startWrite() / endWrite() for a significant throughput improvement when performing many consecutive drawing operations.
setCursor() — Position the Text Cursor
print(), println(), and drawChar() when no explicit position is supplied.
X coordinate for the cursor (top-left of the next character).
Y coordinate for the cursor.
Font number to activate (1–8). Only available in the three-argument overload.
getCursorX() / getCursorY() — Read Cursor Position
print() or println(), so these getters are useful for continuing text after a drawString() call or for measuring how far text has advanced.
Returns: int16_t — current cursor X or Y position in pixels.
setRotation() — Set Display Orientation
(0, 0) is always the top-left corner of the new orientation, and width() / height() update accordingly.
Rotation value (0–3):
0— Portrait, 0° (default)1— Landscape, 90° clockwise2— Portrait, 180°3— Landscape, 270° clockwise
getRotation() — Read Current Orientation
uint8_t — value 0–3 matching the last call to setRotation().
setOrigin() — Set Drawing Coordinate Offset
Horizontal offset in pixels. Positive shifts drawing to the right.
Vertical offset in pixels. Positive shifts drawing downward.
getOriginX() / getOriginY() — Read Drawing Origin
int32_t — current X or Y origin offset in pixels.
invertDisplay() — Invert Panel Colours
true to invert colours; false to restore normal colours.pushColor() — Push a Single Colour
len copies of color to the current address window. The address window must be set in advance with setAddrWindow() or setWindow().
RGB565 colour to push.
Number of pixels to write. Only in the two-argument overload.
pushColors() — Push an Array of Colours
true). The second overload accepts raw 8-bit data.
Pointer to pixel colour data.
Number of pixels (16-bit overload) or bytes (8-bit overload) to push.
If
true (default), byte-swaps each 16-bit value before sending. Only applies to the 16-bit overload.pushBlock() — Push a Solid Colour Block
len copies of color to the SPI bus as efficiently as possible. Unlike pushColor(), this bypasses the CS assertion loop on platforms that support block transfers.
RGB565 fill colour.
Number of pixels to write.
pushPixels() — Push Raw Pixel Data
Pointer to raw pixel data.
Number of pixels to send.
startWrite() / endWrite() / writeColor() — SPI Transaction Batching
startWrite() asserts the chip-select line and begins an SPI transaction, holding it open across multiple draw calls. endWrite() releases the chip-select. Batching multiple operations between startWrite() / endWrite() eliminates the CS toggle overhead between calls and can significantly increase throughput.
writeColor() writes len pixels of color inside an already-open transaction without managing CS — it must be called between startWrite() and endWrite().
RGB565 colour for
writeColor().Number of pixels for
writeColor().getSPIinstance() — Access the SPI Class Handle
SPIClass instance managed by TFT_eSPI. Useful when another SPI device shares the bus and you need to coordinate bus access or change settings.
getSPIinstance() is not available when TFT_PARALLEL_8_BIT or RP2040_PIO_INTERFACE is defined, as those interfaces do not use the Arduino SPI class.SPIClass& — reference to the SPI instance.