LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
InterfaceST7789< I > Class Template Reference

Class implements interface functions to ST7789 displays. More...

#include <lcd_st7789.h>

Inheritance diagram for InterfaceST7789< I >:
Collaboration diagram for InterfaceST7789< I >:

Public Member Functions

template<typename... Args>
 InterfaceST7789 (NanoDisplayBase< InterfaceST7789< I >> &base, int8_t dc, Args &&... data)
 Creates instance of interface to LCD display. More...
 
void startBlock (lcduint_t x, lcduint_t y, lcduint_t w)
 Sets block in RAM of lcd display controller to write data to. More...
 
void nextBlock ()
 Switches to the start of next RAM page for the block, specified by startBlock(). More...
 
void endBlock ()
 Closes data send operation to lcd display.
 
void setDataMode (uint8_t mode)
 Enables either data or command mode on SPI bus. More...
 
void commandStart ()
 Starts communication with LCD display in command mode. More...
 
void setRotation (uint8_t rotation)
 Sets screen orientation (rotation) More...
 
void setOffset (lcdint_t ox, lcdint_t oy)
 Sets display offset in GDRAM memory. More...
 
void normalMode ()
 Switches display to normal mode (sends INVOFF command). More...
 
void invertMode ()
 Switches display to inverted mode (sends INVON command). More...
 

Detailed Description

template<typename I>
class InterfaceST7789< I >

Class implements interface functions to ST7789 displays.

Definition at line 43 of file lcd_st7789.h.

Constructor & Destructor Documentation

◆ InterfaceST7789()

template<typename I>
template<typename... Args>
InterfaceST7789< I >::InterfaceST7789 ( NanoDisplayBase< InterfaceST7789< I >> &  base,
int8_t  dc,
Args &&...  data 
)
inline

Creates instance of interface to LCD display.

Parameters
baseReference to base class, which represents Display
dcData/command control pin number, for i2c communication should be -1
datavariable argument list, accepted by platform interface (PlatformI2c, PlatformSpi)

Definition at line 54 of file lcd_st7789.h.

Member Function Documentation

◆ commandStart()

template<class I >
void InterfaceST7789< I >::commandStart ( )

Starts communication with LCD display in command mode.

To stop communication use m_intf.end().

Definition at line 88 of file lcd_st7789.inl.

◆ invertMode()

template<class I >
void InterfaceST7789< I >::invertMode ( )

Switches display to inverted mode (sends INVON command).

Most ST7789 panels require INVON for correct colors (this is the default). Use this to re-enable inversion if normalMode() was called.

See also
normalMode()

Definition at line 180 of file lcd_st7789.inl.

◆ nextBlock()

template<class I >
void InterfaceST7789< I >::nextBlock ( )

Switches to the start of next RAM page for the block, specified by startBlock().

For ST7789 it does nothing, while for sh1106 the function moves cursor to next page.

Definition at line 70 of file lcd_st7789.inl.

◆ normalMode()

template<class I >
void InterfaceST7789< I >::normalMode ( )

Switches display to normal mode (sends INVOFF command).

Warning
Most ST7789 panels initialize with INVON for correct colors. Use this only if your specific panel shows inverted colors with the default.
See also
invertMode()

Definition at line 172 of file lcd_st7789.inl.

◆ setDataMode()

template<class I >
void InterfaceST7789< I >::setDataMode ( uint8_t  mode)

Enables either data or command mode on SPI bus.

Parameters
mode1 to enable data mode, or 0 to enable command mode

Definition at line 80 of file lcd_st7789.inl.

◆ setOffset()

template<class I >
void InterfaceST7789< I >::setOffset ( lcdint_t  ox,
lcdint_t  oy 
)

Sets display offset in GDRAM memory.

Some lcd displays do not use COM0, ROW0 lines. It depends on display manufacturer. So, in this case you need to use setOffset() method to tell the library about this hardware specific. This method sets GDRAM display offset in pixels

Parameters
oxx-axis offset in pixels
oyy-axis offset in pixels

Definition at line 158 of file lcd_st7789.inl.

◆ setRotation()

template<class I >
void InterfaceST7789< I >::setRotation ( uint8_t  rotation)

Sets screen orientation (rotation)

Sets screen orientation (rotation):

  • 0 — normal (portrait)
  • 1 — 90° CW (landscape)
  • 2 — 180° CW (portrait inverted)
  • 3 — 270° CW (landscape inverted)
Parameters
rotationscreen rotation (0–3)

Definition at line 97 of file lcd_st7789.inl.

◆ startBlock()

template<class I >
void InterfaceST7789< I >::startBlock ( lcduint_t  x,
lcduint_t  y,
lcduint_t  w 
)

Sets block in RAM of lcd display controller to write data to.

Sets block in RAM of lcd display controller to write data to. For ST7789 it uses horizontal addressing mode, while for sh1106 the function uses page addressing mode. Width can be specified as 0, thus the library will set the right boundary to region of RAM block to the right column of the display.

Parameters
x- column (left region)
y- row (top region)
w- width of the block in pixels to control
Warning
- this function initiates session (i2c or spi) and does not close it. To close session, please, call endBlock().

Definition at line 35 of file lcd_st7789.inl.


The documentation for this class was generated from the following files: