Before any drawing can occur theDocumentation 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.
TFT_eSPI object must be constructed and initialized. The constructor accepts optional width and height overrides (defaulting to the values set in User_Setup.h), and initialization is performed by calling either begin() or init() — both are equivalent, with begin() retained for backwards compatibility. After initialization you can set the display orientation, invert the panel colours, and read back the full compile-time configuration via getSetup().
TFT_eSPI() — Constructor
TFT_eSPI instance. The width and height default to the values defined in User_Setup.h as TFT_WIDTH and TFT_HEIGHT. You only need to supply values when overriding the configured panel dimensions.
Display width in pixels. Defaults to the
TFT_WIDTH macro defined in User_Setup.h.Display height in pixels. Defaults to the
TFT_HEIGHT macro defined in User_Setup.h.begin() — Initialize Display
init() and is provided for backwards compatibility with older code. Either function may be used; they perform identical work.
Tab colour option for ST7735 displays only. Encodes the colour of the protective tab on the display’s flexible cable. Defaults to
TAB_COLOUR (0). Ignored for all other display drivers.init() — Initialize Display
setup() before any drawing operations.
Tab colour option for ST7735 displays only. Defaults to
TAB_COLOUR (0).setRotation() — Set Display Orientation
(0, 0) is always the top-left of the rotated view. Values 4–7 are used internally for BMP drawing and mirror the 0–3 orientations.
Rotation value:
0— Portrait, no rotation1— Landscape, 90° clockwise2— Portrait, 180° (upside-down)3— Landscape, 270° clockwise (90° counter-clockwise)
getRotation() — Read Current Orientation
setRotation().
Returns: uint8_t — current rotation (0–3).
invertDisplay() — Invert Panel Colours
true to invert display colours; false to restore normal colour output.verifySetupID() — Check Setup ID
id against the setup_id compiled into the library via User_Setup.h. Use this in diagnostic sketches to confirm that the correct hardware configuration is active.
The expected setup ID value to verify against the compiled configuration.
bool — true if id matches the compiled setup ID.
getSetup() — Retrieve Compile-Time Configuration
setup_t struct with the full set of compile-time configuration values: driver code, pin assignments, SPI frequencies, interface type, and more. This has zero impact on code size unless actually called and is intended for diagnostic sketches.
Reference to a
setup_t struct that will be populated with the current configuration. The caller must declare and own the struct instance.The
setup_t struct includes fields for the library version string, SPI pin numbers, parallel bus pins, touch controller pins, SPI frequencies, display offsets for all four rotations, and the interface type. See the Overview page for the full struct definition.