TFT_eSPI CLASS - Ambercroft/TFT_eSPI GitHub Wiki

TFT_eSPI CLASS

Display Settings

int32_t h=height(void); ?? int32 or int16

Return the pixel height of the display.
Ref: setRotation(); getRotation();

int32_t w=width(void); ?? int32 or int16

Return the pixel width of the display.
Ref: setRotation(); getRotation();

Functions

setRotation(uint8_t N);

Rotate the screen orientation

  • N >> 0 - 3 Clockwise rotation 90 degree steps
  • N >> 4 - 7 BMP drawing ?? separate for BMP Note: This will always do the entire screen even if viewport is set. REF: setViewport();

getRotation(void);

Returns rotation value N

  • N >> 0 - 3 Clockwise rotation 90 degree steps
  • N >> 4 - 7 BMP drawing ?? separate for BMP
  • Return uint_8 orientation.
    Ref: setRotation()

invertDisplay(bool i);

Inverts the display colours.

  • i >> 0 normal, 1 invert ( can use TRUE / FALSE )

setAddrWindow(int32_t X0,int32_t Y0, int32_t W, int32_t H);

Define an area to receive a a stream of pixels

  • X0,Y0 >> origin
  • W, H >> Width, Height in pixels

setWindow(int32_t X0,int32_t Y0, int32_t X1, int32_t Y1);

Define an area to receive a a stream of pixels

  • X0,Y0 >> origin
  • X1,Y1 >> end point

Viewport

Viewports have a number of potential uses:

  1. create a "virtual" TFT screen smaller than the actual TFT screen
  2. render GUI items (menus etc) in a viewport, erase GUI item by redrawing whole screen,
  3. this will be fast because only the viewport will be refreshed (e.g. clearing menu)
  4. limit screen refresh to a particular area, e.g. changing numbers, icons or graph plotting
  5. showing a small portion of a larger image or sprite, this allows panning and scrolling
    Ref: Viewport_Demo.ino Viewport_commands.ino

setViewport(uint_16 X0, uint_16 Y0, uint_16 X1, uint_16 Y1, bool DATUM);

Constrains the drawings to described window. ( ?? limitations ))

  • X0,Y0 >> origin
  • X1,Y1 >> end point
  • DATUM >> Optional. FALSE = datum stays at TFT top left.
  • DATUM >> Default. TRUE = datum is set to Viewport origin.

resetViewport(void);

Viewport is reset to the whole screen.

getViewportX(void);

Always returns Viewport X coordinate relative to screen left edge.

  • Return uint32_t X

getViewportY(void);

Always returns Viewport Y coordinate relative to screen top edge.

  • Return uint32_t Y

getViewportWidth(void);

Always returns width of viewport.

  • Return uint32_t W

getViewportHeight(void);

Always returns height of viewport.

  • Return uint32_t H

getViewportDatum(void);

Datum of the viewport (false = TFT corner, true = viewport corner)

  • Return bool P

frameViewport(uint_16 COLOUR, int16_t WD); ?? type for the WD

Set a frame around the viewport. Set a fame inside the viewport of width WD. Outside if WD is negative.

  • COLOUR >> Standard colours.
  • WD >> Width of frame in pixels.

SORT ME

Put function here if uncertain the position to be placed on page.

pushBlock() KEYWORD2 =NO MATCH=

pushPixels() KEYWORD2 =NO MATCH=

tft_Read_8() KEYWORD2

begin_SDA_Read() KEYWORD2

end_SDA_Read() KEYWORD2

decodeUTF8 KEYWORD2

write KEYWORD2

setCallback KEYWORD2

spiwrite KEYWORD2

writecommand KEYWORD2

writedata KEYWORD2

commandList KEYWORD2

readcommand8 KEYWORD2

readcommand16 KEYWORD2

readcommand32 KEYWORD2

initDMA KEYWORD2

deInitDMA KEYWORD2

pushImageDMA KEYWORD2

pushPixelsDMA KEYWORD2

dmaBusy KEYWORD2

dmaWait KEYWORD2

startWrite KEYWORD2

endWrite KEYWORD2

setAttribute KEYWORD2

getAttribute KEYWORD2

getSetup KEYWORD2

getSPIinstance KEYWORD2