LCDGFX LCD display driver  1.0.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Public Member Functions | Protected Attributes | List of all members
NanoDisplayBase< I > Class Template Reference

#include <display_base.h>

Inheritance diagram for NanoDisplayBase< I >:
NanoDisplayOps1< I > NanoDisplayOps16< I > NanoDisplayOps4< I > NanoDisplayOps8< I > NanoDisplayOps< NanoDisplayOps1< I >, I > NanoDisplayOps< NanoDisplayOps16< I >, I > NanoDisplayOps< NanoDisplayOps4< I >, I > NanoDisplayOps< NanoDisplayOps8< I >, I > DisplayPCD8544< I > DisplaySH1106< I > DisplaySSD1306< I > DisplayIL9163x16< I > DisplayILI9341x16< I > DisplaySSD1331x16< I > DisplaySSD1351x16< I > DisplayST7735x16< I > DisplaySSD1325< I > DisplaySSD1327< I > DisplaySSD1331x8< I >

Public Member Functions

 NanoDisplayBase (I &intf)
 
const NanoPoint offsetEnd () const
 
const NanoRect rect () const
 
lcduint_t width ()
 
lcduint_t height ()
 
void swapDimensions ()
 
void setColor (uint16_t color)
 
void negativeMode ()
 
void positiveMode ()
 
I & getInterface ()
 
void setFont (NanoFont &font)
 
void setFontSpacing (uint8_t spacing)
 
NanoFontgetFont ()
 
void setFixedFont (const uint8_t *progmemFont)
 
void setFixedFont (const uint8_t *progmemFont, const uint8_t *secondaryFont)
 
void setFreeFont (const uint8_t *progmemFont, const uint8_t *secondaryFont=nullptr)
 
void setTextCursor (lcdint_t x, lcdint_t y)
 

Protected Attributes

lcduint_t m_w = 0
 width of NanoCanvas area in pixels
 
lcduint_t m_h = 0
 height of NanoCanvas area in pixels
 
lcduint_t m_p = 0
 number of bits, used by width value: 3 equals to 8 pixels width
 
lcdint_t m_cursorX = 0
 current X cursor position for text output
 
lcdint_t m_cursorY = 0
 current Y cursor position for text output
 
uint8_t m_textMode = 0
 Flags for current NanoCanvas mode.
 
EFontStyle m_fontStyle
 currently active font style
 
uint16_t m_color = 0xFFFF
 current color for monochrome operations
 
NanoFontm_font = nullptr
 currently set font
 
I & m_intf
 communication interface with the display
 

Detailed Description

template<class I>
class NanoDisplayBase< I >

Class implements basic display operations for the library: It stores reference to communication interafce, display size, etc.

Definition at line 56 of file display_base.h.

Constructor & Destructor Documentation

◆ NanoDisplayBase()

template<class I>
NanoDisplayBase< I >::NanoDisplayBase ( I &  intf)
inline

Creates new empty base display object. If you this constructor is used, you must call begin() method before working with canvas.

Definition at line 64 of file display_base.h.

Member Function Documentation

◆ getFont()

template<class I>
NanoFont& NanoDisplayBase< I >::getFont ( )
inline

Returns reference to NanoFont object, currently used by Display

Definition at line 162 of file display_base.h.

◆ getInterface()

template<class I>
I& NanoDisplayBase< I >::getInterface ( )
inline

Returns reference to interface communicator. This interface can be used to use display hardware related features.

Definition at line 136 of file display_base.h.

◆ height()

template<class I>
lcduint_t NanoDisplayBase< I >::height ( )
inline

Returns height of the display in pixels.

Definition at line 101 of file display_base.h.

◆ negativeMode()

template<class I>
void NanoDisplayBase< I >::negativeMode ( )
inline

All drawing functions start to work in negative mode. Old picture on the display remains unchanged.

Definition at line 123 of file display_base.h.

◆ offsetEnd()

template<class I>
const NanoPoint NanoDisplayBase< I >::offsetEnd ( ) const
inline

Returns right-bottom point of the canvas in offset terms. If offset is (0,0), then offsetEnd() will return (width-1,height-1).

Definition at line 79 of file display_base.h.

◆ positiveMode()

template<class I>
void NanoDisplayBase< I >::positiveMode ( )
inline

All drawing functions start to work in positive (default) mode. Old picture on the display remains unchanged.

Definition at line 129 of file display_base.h.

◆ rect()

template<class I>
const NanoRect NanoDisplayBase< I >::rect ( ) const
inline

Returns rectangle area, covered by canvas in offset terms. If offset is (0,0), then rect() will return ((0,0),(width-1,height-1))

Definition at line 88 of file display_base.h.

◆ setColor()

template<class I>
void NanoDisplayBase< I >::setColor ( uint16_t  color)
inline

Sets color for monochrome operations

Parameters
color- color to set (refer to RGB_COLOR8 definition)

Definition at line 117 of file display_base.h.

◆ setFixedFont() [1/2]

template<class I>
void NanoDisplayBase< I >::setFixedFont ( const uint8_t *  progmemFont)
inline

Sets new font to use with print functions. If multiple oled displays are used in single application, this method can cause conflicts.

Warning
use this method only if single display is used in project
Parameters
progmemFontpointer to font data in flash (refer to NanoFont::loadFixedFont)

Definition at line 173 of file display_base.h.

◆ setFixedFont() [2/2]

template<class I>
void NanoDisplayBase< I >::setFixedFont ( const uint8_t *  progmemFont,
const uint8_t *  secondaryFont 
)
inline

Sets new font to use with print functions. If multiple oled displays are used in single application, this method can cause conflicts.

Warning
use this method only if single display is used in project
Parameters
progmemFontpointer to font data in flash (refer to NanoFont::loadFixedFont)
secondaryFontpointer to font data in flash (refer to NanoFont::loadSecondaryFont)

Definition at line 197 of file display_base.h.

◆ setFont()

template<class I>
void NanoDisplayBase< I >::setFont ( NanoFont font)
inline

Sets new font to use with print functions. If multiple oled displays are used in single application, this method allows to use different fonts for different displays.

Parameters
fontreference to font object (NanoFont)

Definition at line 146 of file display_base.h.

◆ setFontSpacing()

template<class I>
void NanoDisplayBase< I >::setFontSpacing ( uint8_t  spacing)
inline

Sets spacing for currently active font. The same can be done via getFont().setSpacing(), but this method is more safe since it checks if font is set.

Parameters
spacingspacing in pixels

Definition at line 154 of file display_base.h.

◆ setFreeFont()

template<class I>
void NanoDisplayBase< I >::setFreeFont ( const uint8_t *  progmemFont,
const uint8_t *  secondaryFont = nullptr 
)
inline

Sets new font to use with print functions. If multiple oled displays are used in single application, this method can cause conflicts.

Warning
use this method only if single display is used in project
Parameters
progmemFontpointer to font data in flash (refer to NanoFont::loadFreeFont)
secondaryFontpointer to font data in flash (refer to NanoFont::loadSecondaryFont)

Definition at line 217 of file display_base.h.

◆ setTextCursor()

template<class I>
void NanoDisplayBase< I >::setTextCursor ( lcdint_t  x,
lcdint_t  y 
)
inline

Function sets text cursor position for write() functions

Parameters
xhorizontal position in pixels
yvertical position in pixels

Definition at line 233 of file display_base.h.

◆ swapDimensions()

template<class I>
void NanoDisplayBase< I >::swapDimensions ( )
inline

Swaps width and height dimensions

Definition at line 106 of file display_base.h.

◆ width()

template<class I>
lcduint_t NanoDisplayBase< I >::width ( )
inline

Returns width of the display in pixels.

Definition at line 96 of file display_base.h.


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