LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
NanoDisplayOps< O, I > Class Template Referenceabstract

#include <display.h>

Inheritance diagram for NanoDisplayOps< O, I >:
Collaboration diagram for NanoDisplayOps< O, I >:

Public Types

typedef NanoDisplayOps< O, I > T
 

Public Member Functions

void putPixel (const NanoPoint &p)
 
void drawLine (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
 
void drawLine (const NanoRect &rect)
 
void drawRect (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
 
void drawRect (const NanoRect &rect)
 
void fillRect (const NanoRect &rect)
 
void drawCircle (lcdint_t xc, lcdint_t yc, lcdint_t r, uint8_t options=0x0F)
 
void drawCanvas (lcdint_t x, lcdint_t y, NanoCanvasOps< 1 > &canvas) __attribute__((noinline))
 
void drawCanvas (lcdint_t x, lcdint_t y, NanoCanvasOps< 4 > &canvas) __attribute__((noinline))
 
void drawCanvas (lcdint_t x, lcdint_t y, NanoCanvasOps< 8 > &canvas) __attribute__((noinline))
 
void drawCanvas (lcdint_t x, lcdint_t y, NanoCanvasOps< 16 > &canvas) __attribute__((noinline))
 
void printFixedPgm (lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
 
void write (const char *str)
 
void print (int number)
 
void print (float number)
 
void print (char c)
 
void createMenu (SAppMenu *menu, const char **items, uint8_t count, const NanoRect &rect={})
 
void showMenu (SAppMenu *menu)
 
void showMenuSmooth (SAppMenu *menu)
 
void updateMenu (SAppMenu *menu)
 
void updateMenuSmooth (SAppMenu *menu)
 
uint8_t menuSelection (const SAppMenu *menu)
 
void menuDown (SAppMenu *menu)
 
void menuUp (SAppMenu *menu)
 
void drawProgressBar (int8_t progress)
 
void drawWindow (lcdint_t x, lcdint_t y, lcduint_t width, lcduint_t height, const char *caption, bool blank)
 

Protected Member Functions

virtual void begin ()=0
 
virtual void end ()=0
 

Detailed Description

template<typename O, typename I>
class NanoDisplayOps< O, I >

NanoCanvasOps provides operations for drawing in memory buffer. Depending on BPP argument, this class can work with 1,8,16-bit canvas areas.

Definition at line 978 of file display.h.

Member Typedef Documentation

◆ T

template<typename O, typename I>
typedef NanoDisplayOps<O, I> NanoDisplayOps< O, I >::T

Base type for display operations class

Definition at line 986 of file display.h.

Member Function Documentation

◆ begin()

template<typename O, typename I>
virtual void NanoDisplayOps< O, I >::begin ( )
protectedpure virtual

Initializes interface and display

Implemented in DisplaySSD1306_128x64_Custom< I >, DisplaySSD1306_128x64_CustomI2C< I >, DisplaySSD1306_128x64_I2C, DisplaySSD1306_128x64_CustomSPI< I >, DisplaySSD1306_128x64_SPI, DisplaySSD1306_128x32_Custom< I >, DisplaySSD1306_128x32_CustomI2C< I >, DisplaySSD1306_128x32_I2C, DisplaySSD1306_128x32_CustomSPI< I >, DisplaySSD1306_128x32_SPI, DisplaySSD1306_64x48_Custom< I >, DisplaySSD1306_64x48_CustomI2C< I >, DisplaySH1107_64x128_CustomI2C< I >, DisplaySSD1306_64x48_I2C, DisplaySH1107_64x128_I2C, DisplaySSD1306_64x48_CustomSPI< I >, DisplaySH1107_64x128_CustomSPI< I >, DisplaySSD1306_64x48_SPI, DisplayST7735_128x160x16_CustomSPI< I >, DisplaySH1107_64x128_SPI, DisplayST7735_128x160x16_SPI, DisplaySSD1306_64x32_Custom< I >, DisplaySSD1331_96x64x16_CustomSPI< I >, DisplaySH1107_128x64_CustomI2C< I >, DisplaySSD1331_96x64x16_SPI, DisplaySH1106_128x64_CustomI2C< I >, DisplaySSD1306_64x32_CustomI2C< I >, DisplaySSD1351_96x96x16_CustomSPI< I >, DisplayST7735_80x160x16_CustomSPI< I >, DisplayST7789_240x240x16_CustomSPI< I >, DisplayILI9341_128x160x16_CustomSPI< I >, DisplaySH1107_128x64_I2C, DisplayIL9163_128x160x16_CustomSPI< I >, DisplaySH1106_128x64_I2C, DisplaySSD1306_64x32_I2C, DisplaySSD1351_96x96x16_SPI, DisplayST7735_80x160x16_SPI, DisplayST7789_240x240x16_SPI, DisplayILI9341_128x160x16_SPI, DisplaySH1107_128x64_CustomSPI< I >, DisplayIL9163_128x160x16_SPI, DisplaySSD1325_128x64_CustomI2C< I >, DisplaySSD1327_128x128_CustomI2C< I >, DisplaySH1106_128x64_CustomSPI< I >, DisplaySSD1306_64x32_CustomSPI< I >, DisplaySH1107_128x64_SPI, DisplaySSD1325_128x64_I2C, DisplaySSD1327_128x128_I2C, DisplaySSD1331_96x64x8_CustomSPI< I >, DisplaySSD1351_128x128x16_CustomSPI< I >, DisplayST7735_128x128x16_CustomSPI< I >, DisplayAny16, DisplaySH1106_128x64_SPI, DisplaySSD1306_64x32_SPI, DisplayST7789_135x240x16_CustomSPI< I >, DisplayILI9341_240x320x16_CustomSPI< I >, DisplayIL9163_128x128x16_CustomSPI< I >, DisplaySSD1331_96x64x8_SPI, DisplayPCD8544_84x48_CustomSPI< I >, DisplaySSD1325_128x64_CustomSPI< I >, DisplaySSD1327_128x128_CustomSPI< I >, DisplayAny8, DisplaySSD1351_128x128x16_SPI, DisplayST7735_128x128x16_SPI, DisplayST7789_135x240x16_SPI, DisplayILI9341_240x320x16_SPI, DisplayIL9163_128x128x16_SPI, DisplayAny4, DisplayPCD8544_84x48_SPI, DisplaySSD1325_128x64_SPI, DisplaySSD1327_128x128_SPI, and DisplayAny1.

◆ createMenu()

template<class O , class I >
void NanoDisplayOps< O, I >::createMenu ( SAppMenu menu,
const char **  items,
uint8_t  count,
const NanoRect rect = {} 
)

Creates menu object with the provided list of menu items. List of menu items (strings) must exist all until menu object is no longer needed. Selection is set to the first item by default.

Parameters
menupointer to SAppMenu structure
itemsarray of null-termintated strings (located in SRAM)
countcount of menu items in the array
rectscreen area to use for menu

Definition at line 728 of file ssd1306_common.inl.

◆ drawCanvas() [1/4]

template<class O , class I >
void NanoDisplayOps< O, I >::drawCanvas ( lcdint_t  x,
lcdint_t  y,
NanoCanvasOps< 1 > &  canvas 
)

Draws 1-bit canvas on lcd display

Parameters
xx position in pixels
yy position in pixels
canvas1-bit canvas to draw on the screen.

Definition at line 831 of file ssd1306_common.inl.

◆ drawCanvas() [2/4]

template<class O , class I >
void NanoDisplayOps< O, I >::drawCanvas ( lcdint_t  x,
lcdint_t  y,
NanoCanvasOps< 4 > &  canvas 
)

Draws 4-bit canvas on lcd display

Parameters
xx position in pixels
yy position in pixels
canvas4-bit canvas to draw on the screen.

Definition at line 836 of file ssd1306_common.inl.

◆ drawCanvas() [3/4]

template<class O , class I >
void NanoDisplayOps< O, I >::drawCanvas ( lcdint_t  x,
lcdint_t  y,
NanoCanvasOps< 8 > &  canvas 
)

Draws 8-bit canvas on lcd display

Parameters
xx position in pixels
yy position in pixels
canvas8-bit canvas to draw on the screen.

Definition at line 841 of file ssd1306_common.inl.

◆ drawCanvas() [4/4]

template<class O , class I >
void NanoDisplayOps< O, I >::drawCanvas ( lcdint_t  x,
lcdint_t  y,
NanoCanvasOps< 16 > &  canvas 
)

Draws 16-bit canvas on lcd display

Parameters
xx position in pixels
yy position in pixels
canvas16-bit canvas to draw on the screen.

Definition at line 846 of file ssd1306_common.inl.

◆ drawCircle()

template<class O , class I >
void NanoDisplayOps< O, I >::drawCircle ( lcdint_t  xc,
lcdint_t  yc,
lcdint_t  r,
uint8_t  options = 0x0F 
)

Draws circle

Parameters
xchorizontal position of circle center in pixels
ycvertical position of circle center in pixels
rradius of circle in pixels
optionsdraw specific sections: each bit corresponds to 90 degree section

Definition at line 594 of file ssd1306_common.inl.

◆ drawLine() [1/2]

template<class O , class I >
void NanoDisplayOps< O, I >::drawLine ( lcdint_t  x1,
lcdint_t  y1,
lcdint_t  x2,
lcdint_t  y2 
)

Draws line

Parameters
x1- position X
y1- position Y
x2- position X
y2- position Y
Note
color can be set via setColor()

Definition at line 538 of file ssd1306_common.inl.

◆ drawLine() [2/2]

template<class O , class I >
void NanoDisplayOps< O, I >::drawLine ( const NanoRect rect)

Draws line

Parameters
rect- structure, describing rectangle area
Note
color can be set via setColor()

Definition at line 584 of file ssd1306_common.inl.

◆ drawProgressBar()

template<class O , class I >
void NanoDisplayOps< O, I >::drawProgressBar ( int8_t  progress)

Displays progress bar in the middle of the display.

Parameters
progressprogress in range 0 - 100.

Definition at line 851 of file ssd1306_common.inl.

◆ drawRect() [1/2]

template<class O , class I >
void NanoDisplayOps< O, I >::drawRect ( lcdint_t  x1,
lcdint_t  y1,
lcdint_t  x2,
lcdint_t  y2 
)

Draws rectangle

Parameters
x1- position X
y1- position Y
x2- position X
y2- position Y
Note
color can be set via setColor()

Definition at line 525 of file ssd1306_common.inl.

◆ drawRect() [2/2]

template<class O , class I >
void NanoDisplayOps< O, I >::drawRect ( const NanoRect rect)

Draws rectangle

Parameters
rect- structure, describing rectangle area
Note
color can be set via setColor()

Definition at line 533 of file ssd1306_common.inl.

◆ drawWindow()

template<class O , class I >
void NanoDisplayOps< O, I >::drawWindow ( lcdint_t  x,
lcdint_t  y,
lcduint_t  width,
lcduint_t  height,
const char *  caption,
bool  blank 
)

Displays window at specified position and of specified size

Parameters
xx position in pixels from top-lef corner
yy position in pixels from top-lef corner
widthwidth of window to draw. Can be 0.
heightheight of windows to draw. Can be 0.
captiontext to display as caption
blanktrue if content inside window should be blanked

Definition at line 882 of file ssd1306_common.inl.

◆ end()

template<typename O, typename I>
virtual void NanoDisplayOps< O, I >::end ( )
protectedpure virtual

closes interface to lcd display

Implemented in DisplaySSD1306_128x64_Custom< I >, DisplaySSD1306_128x64_CustomI2C< I >, DisplaySSD1306_128x64_I2C, DisplaySSD1306_128x64_CustomSPI< I >, DisplaySSD1306_128x64_SPI, DisplaySSD1306_128x32_Custom< I >, DisplaySSD1306_128x32_CustomI2C< I >, DisplaySSD1306_128x32_I2C, DisplaySSD1306_128x32_CustomSPI< I >, DisplaySSD1306_128x32_SPI, DisplaySSD1306_64x48_Custom< I >, DisplaySSD1306_64x48_CustomI2C< I >, DisplaySH1107_64x128_CustomI2C< I >, DisplaySSD1306_64x48_I2C, DisplaySH1107_64x128_I2C, DisplaySSD1306_64x48_CustomSPI< I >, DisplaySH1107_64x128_CustomSPI< I >, DisplaySSD1306_64x48_SPI, DisplayST7735_128x160x16_CustomSPI< I >, DisplaySH1107_64x128_SPI, DisplayST7735_128x160x16_SPI, DisplaySSD1306_64x32_Custom< I >, DisplaySSD1331_96x64x16_CustomSPI< I >, DisplaySH1107_128x64_CustomI2C< I >, DisplaySH1106_128x64_CustomI2C< I >, DisplaySSD1306_64x32_CustomI2C< I >, DisplaySSD1331_96x64x16_SPI, DisplaySSD1351_96x96x16_CustomSPI< I >, DisplayST7735_80x160x16_CustomSPI< I >, DisplayST7789_240x240x16_CustomSPI< I >, DisplayILI9341_128x160x16_CustomSPI< I >, DisplaySH1107_128x64_I2C, DisplayIL9163_128x160x16_CustomSPI< I >, DisplaySH1106_128x64_I2C, DisplaySSD1306_64x32_I2C, DisplaySSD1351_96x96x16_SPI, DisplayST7735_80x160x16_SPI, DisplayST7789_240x240x16_SPI, DisplayILI9341_128x160x16_SPI, DisplaySH1107_128x64_CustomSPI< I >, DisplaySSD1325_128x64_CustomI2C< I >, DisplaySSD1327_128x128_CustomI2C< I >, DisplayIL9163_128x160x16_SPI, DisplaySH1106_128x64_CustomSPI< I >, DisplaySSD1306_64x32_CustomSPI< I >, DisplaySH1107_128x64_SPI, DisplaySSD1331_96x64x8_CustomSPI< I >, DisplaySSD1325_128x64_I2C, DisplaySSD1327_128x128_I2C, DisplaySSD1351_128x128x16_CustomSPI< I >, DisplayST7735_128x128x16_CustomSPI< I >, DisplayAny16, DisplaySH1106_128x64_SPI, DisplayST7789_135x240x16_CustomSPI< I >, DisplaySSD1306_64x32_SPI, DisplayILI9341_240x320x16_CustomSPI< I >, DisplayIL9163_128x128x16_CustomSPI< I >, DisplayPCD8544_84x48_CustomSPI< I >, DisplaySSD1331_96x64x8_SPI, DisplaySSD1325_128x64_CustomSPI< I >, DisplaySSD1327_128x128_CustomSPI< I >, DisplayAny8, DisplaySSD1351_128x128x16_SPI, DisplayST7735_128x128x16_SPI, DisplayST7789_135x240x16_SPI, DisplayILI9341_240x320x16_SPI, DisplayIL9163_128x128x16_SPI, DisplayAny4, DisplayPCD8544_84x48_SPI, DisplaySSD1325_128x64_SPI, DisplaySSD1327_128x128_SPI, and DisplayAny1.

◆ fillRect()

template<class O , class I >
void NanoDisplayOps< O, I >::fillRect ( const NanoRect rect)

Fills rectangle area

Parameters
rect- structure, describing rectangle area
Note
color can be set via setColor()

Definition at line 589 of file ssd1306_common.inl.

◆ menuDown()

template<class O , class I >
void NanoDisplayOps< O, I >::menuDown ( SAppMenu menu)

Moves selection pointer down by 1 item. If there are no items below, it will set selection pointer to the first item. Use updateMenu() to refresh menu state on the display.

Parameters
menupointer to SAppMenu structure

Definition at line 807 of file ssd1306_common.inl.

◆ menuSelection()

template<class O , class I >
uint8_t NanoDisplayOps< O, I >::menuSelection ( const SAppMenu menu)

Returns currently selected menu item. First item has zero-index.

Parameters
menupointer to SAppMenu structure

Definition at line 802 of file ssd1306_common.inl.

◆ menuUp()

template<class O , class I >
void NanoDisplayOps< O, I >::menuUp ( SAppMenu menu)

Moves selection pointer up by 1 item. If selected item is the first one, then selection pointer will set to the last item in menu list. Use updateMenu() to refresh menu state on the display.

Parameters
menupointer to SAppMenu structure

Definition at line 819 of file ssd1306_common.inl.

◆ print() [1/3]

template<class O , class I >
void NanoDisplayOps< O, I >::print ( int  number)

Prints number at current cursor position To specify cursor position using setTextCursor() method.

Parameters
numberinteger number to print

Definition at line 648 of file ssd1306_common.inl.

◆ print() [2/3]

template<class O , class I >
void NanoDisplayOps< O, I >::print ( float  number)

Prints number at current cursor position To specify cursor position using setTextCursor() method.

Parameters
numberfloat number to print

Definition at line 655 of file ssd1306_common.inl.

◆ print() [3/3]

template<class O , class I >
void NanoDisplayOps< O, I >::print ( char  c)

Prints single character at current cursor position To specify cursor position using setTextCursor() method.

Parameters
ccharacter to print

Definition at line 662 of file ssd1306_common.inl.

◆ printFixedPgm()

template<class O , class I >
void NanoDisplayOps< O, I >::printFixedPgm ( lcdint_t  xpos,
lcdint_t  y,
const char *  ch,
EFontStyle  style = STYLE_NORMAL 
)

Print text at specified position to canvas

Parameters
xposposition in pixels
yposition in pixels
chpointer to NULL-terminated string, located in flash
stylespecific font style to use
Note
Supports only STYLE_NORMAL and STYLE_BOLD

Definition at line 624 of file ssd1306_common.inl.

◆ putPixel()

template<class O , class I >
void NanoDisplayOps< O, I >::putPixel ( const NanoPoint p)

Draws pixel on specified position

Parameters
p- NanoPoint
Note
color can be set via setColor()

Definition at line 520 of file ssd1306_common.inl.

◆ showMenu()

template<class O , class I >
void NanoDisplayOps< O, I >::showMenu ( SAppMenu menu)

Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.

Parameters
menupointer to SAppMenu structure

Definition at line 741 of file ssd1306_common.inl.

◆ showMenuSmooth()

template<class O , class I >
void NanoDisplayOps< O, I >::showMenuSmooth ( SAppMenu menu)

Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling. Unlike showMenu() this implementation uses more graph functions and requires more flash, but result looks better.

Parameters
menupointer to SAppMenu structure

Definition at line 753 of file ssd1306_common.inl.

◆ updateMenu()

template<class O , class I >
void NanoDisplayOps< O, I >::updateMenu ( SAppMenu menu)

Updates menu items on the display. That is if selection is changed, the function will update only those areas, affected by the change.

Parameters
menuPointer to SAppMenu structure

Definition at line 765 of file ssd1306_common.inl.

◆ updateMenuSmooth()

template<class O , class I >
void NanoDisplayOps< O, I >::updateMenuSmooth ( SAppMenu menu)

Updates menu items on the display. That is if selection is changed, the function will update only those areas, affected by the change. Unlike showMenu() this implementation uses more graph functions and requires more flash, but result looks better.

Parameters
menuPointer to SAppMenu structure

Definition at line 784 of file ssd1306_common.inl.

◆ write()

template<class O , class I >
void NanoDisplayOps< O, I >::write ( const char *  str)

Prints text at current cursor position. To specify cursor position using setTextCursor() method.

Parameters
strtext to print (null-terminated string)

Definition at line 639 of file ssd1306_common.inl.


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