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
NanoDisplayOps8< I > Class Template Reference

#include <display.h>

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

Public Member Functions

void putPixel (lcdint_t x, lcdint_t y) __attribute__((noinline))
 
void drawVLine (lcdint_t x1, lcdint_t y1, lcdint_t y2)
 
void drawHLine (lcdint_t x1, lcdint_t y1, lcdint_t x2)
 
void fillRect (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
 
void drawXBitmap (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
 
void drawBitmap1 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
 Draws monochrome bitmap in color buffer using color, specified via setColor() method Draws monochrome bitmap in color buffer using color, specified via setColor() method. More...
 
void drawBitmap4 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
 Draws 4-bit gray-color bitmap in color buffer. Draws 4-bit gray-color bitmap in color buffer. More...
 
void drawBitmap8 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
 Draws 8-bit color bitmap in color buffer. Draws 8-bit color bitmap in color buffer. More...
 
void drawBitmap16 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
 
void drawBuffer1 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
 
void drawBuffer1Fast (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
 
void drawBuffer4 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
 
void drawBuffer8 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
 
void drawBuffer16 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
 
void clear ()
 
void fill (uint16_t color)
 
uint8_t printChar (uint8_t c)
 
size_t write (uint8_t c) __attribute__((noinline))
 
void printFixed (lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
 
- Public Member Functions inherited from NanoDisplayBase< I >
 NanoDisplayBase (I &intf)
 
const NanoPoint offsetEnd () const
 
const NanoRect rect () const
 
lcduint_t width ()
 
lcduint_t height ()
 
void swapDimensions ()
 
void setColor (uint16_t color)
 
uint16_t getColor ()
 
void setBackground (uint16_t color)
 
void invertColors ()
 
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)
 

Static Public Attributes

static const uint8_t BITS_PER_PIXEL = 8
 

Additional Inherited Members

- Protected Attributes inherited from NanoDisplayBase< I >
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 = STYLE_NORMAL
 currently active font style
 
uint16_t m_color = 0xFFFF
 current foreground color
 
uint16_t m_bgColor = 0x0000
 current background color
 
NanoFontm_font = nullptr
 currently set font
 
I & m_intf
 communication interface with the display
 

Detailed Description

template<class I>
class NanoDisplayOps8< I >

NanoDisplayOps8 is template class for 8-bit operations.

Definition at line 522 of file display.h.

Member Function Documentation

◆ clear()

template<class I >
void NanoDisplayOps8< I >::clear ( )

Clears canvas

Definition at line 155 of file ssd1306_8bit.inl.

◆ drawBitmap1()

template<class I >
void NanoDisplayOps8< I >::drawBitmap1 ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  bitmap 
)

Draws monochrome bitmap in color buffer using color, specified via setColor() method Draws monochrome bitmap in color buffer using color, specified via setColor() method.

Parameters
x- position X in pixels
y- position Y in pixels
w- width in pixels
h- height in pixels
bitmap- monochrome bitmap data, located in flash
Note
There are 2 modes: transparent and non-transparent mode, - and 2 colors available: black and white. In non-transparent mode, when black color is selected, the monochrome image just inverted. In transparent mode, those pixels of source monochrome image, which are black, do not overwrite pixels in the screen buffer.

Definition at line 167 of file ssd1306_8bit.inl.

◆ drawBitmap16()

template<class I >
void NanoDisplayOps8< I >::drawBitmap16 ( lcdint_t  xpos,
lcdint_t  ypos,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  bitmap 
)

Draw 16-bit color bitmap, located in Flash, directly to OLED display GDRAM. Each pixel of the bitmap is expected in 5-6-5 format.

Parameters
xposstart horizontal position in pixels
yposstart vertical position in pixels
wbitmap width in pixels
hbitmap height in pixels
bitmappointer to Flash data, containing 16-bit color bitmap.

Definition at line 218 of file ssd1306_8bit.inl.

◆ drawBitmap4()

template<class I >
void NanoDisplayOps8< I >::drawBitmap4 ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  bitmap 
)

Draws 4-bit gray-color bitmap in color buffer. Draws 4-bit gray-color bitmap in color buffer.

Parameters
x- position X in pixels
y- position Y in pixels
w- width in pixels
h- height in pixels
bitmap- 4-bit gray-color bitmap data, located in flash

Definition at line 199 of file ssd1306_8bit.inl.

◆ drawBitmap8()

template<class I >
void NanoDisplayOps8< I >::drawBitmap8 ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  bitmap 
)

Draws 8-bit color bitmap in color buffer. Draws 8-bit color bitmap in color buffer.

Parameters
x- position X in pixels
y- position Y in pixels
w- width in pixels
h- height in pixels
bitmap- 8-bit color bitmap data, located in flash

Definition at line 205 of file ssd1306_8bit.inl.

◆ drawBuffer1()

template<class I >
void NanoDisplayOps8< I >::drawBuffer1 ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  buffer 
)

Draws bitmap, located in RAM, on the display Each byte represents 8 vertical pixels.

// Draw small rectangle 3x8 at position 10,8
uint8_t buffer[3] = { 0xFF, 0x81, 0xFF };
display.drawBuffer1(10, 1, 3, 8, buffer);
Parameters
xhorizontal position in pixels
yvertical position in pixels
wwidth of bitmap in pixels
hheight of bitmap in pixels (must be divided by 8)
bufferpointer to data, located in SRAM: each byte represents 8 vertical pixels.

Definition at line 224 of file ssd1306_8bit.inl.

◆ drawBuffer16()

template<class I >
void NanoDisplayOps8< I >::drawBuffer16 ( lcdint_t  xpos,
lcdint_t  ypos,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  buffer 
)

Draws 16-bit bitmap, located in RAM, on the display Each pixel occupies 2 bytes (5-6-5 format): refer to RGB_COLOR16 to understand RGB scheme, being used.

Parameters
xposhorizontal position in pixels
yposvertical position in pixels
wwidth of bitmap in pixels
hheight of bitmap in pixels
bufferpointer to data, located in RAM.

Definition at line 281 of file ssd1306_8bit.inl.

◆ drawBuffer1Fast()

template<class I >
void NanoDisplayOps8< I >::drawBuffer1Fast ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  buffer 
)

Implements the same behavior as drawBuffer1, but much faster. This method has some limitations

Parameters
xhorizontal position in pixels
yvertical position in pixels
wwidth of bitmap in pixels
hheight of bitmap in pixels (must be divided by 8)
bufferpointer to data, located in SRAM: each byte represents 8 vertical pixels.

Definition at line 256 of file ssd1306_8bit.inl.

◆ drawBuffer4()

template<class I >
void NanoDisplayOps8< I >::drawBuffer4 ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  buffer 
)

Draws 4-bit bitmap, located in RAM, on the display Each byte represents two pixels in 4-4 format: refer to GRAY_COLOR4 to understand scheme, being used.

Parameters
xhorizontal position in pixels
yvertical position in pixels
wwidth of bitmap in pixels
hheight of bitmap in pixels
bufferpointer to data, located in SRAM.

Definition at line 262 of file ssd1306_8bit.inl.

◆ drawBuffer8()

template<class I >
void NanoDisplayOps8< I >::drawBuffer8 ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  buffer 
)

Draws 8-bit bitmap, located in RAM, on the display Each byte represents one pixel in 2-2-3 format: refer to RGB_COLOR8 to understand RGB scheme, being used.

Parameters
xhorizontal position in pixels
yvertical position in pixels
wwidth of bitmap in pixels
hheight of bitmap in pixels
bufferpointer to data, located in SRAM.

Definition at line 268 of file ssd1306_8bit.inl.

◆ drawHLine()

template<class I >
void NanoDisplayOps8< I >::drawHLine ( lcdint_t  x1,
lcdint_t  y1,
lcdint_t  x2 
)

Draws horizontal or vertical line

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

Definition at line 103 of file ssd1306_8bit.inl.

◆ drawVLine()

template<class I >
void NanoDisplayOps8< I >::drawVLine ( lcdint_t  x1,
lcdint_t  y1,
lcdint_t  y2 
)

Draws horizontal or vertical line

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

Definition at line 114 of file ssd1306_8bit.inl.

◆ drawXBitmap()

template<class I >
void NanoDisplayOps8< I >::drawXBitmap ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  bitmap 
)

Draws bitmap, located in Flash, on the display The bitmap should be in XBMP format

Parameters
x- horizontal position in pixels
y- vertical position in blocks (pixels/8)
w- width of bitmap in pixels
h- height of bitmap in pixels (must be divided by 8)
bitmap- pointer to data, located in Flash: each byte represents 8 vertical pixels.

Definition at line 161 of file ssd1306_8bit.inl.

◆ fill()

template<class I >
void NanoDisplayOps8< I >::fill ( uint16_t  color)

Fill screen content with specified color

Parameters
colorcolor to fill display with

Definition at line 144 of file ssd1306_8bit.inl.

◆ fillRect()

template<class I >
void NanoDisplayOps8< I >::fillRect ( lcdint_t  x1,
lcdint_t  y1,
lcdint_t  x2,
lcdint_t  y2 
)

Fills rectangle area

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

Definition at line 125 of file ssd1306_8bit.inl.

◆ printChar()

template<class I >
uint8_t NanoDisplayOps8< I >::printChar ( uint8_t  c)

Draws single character to canvas

Parameters
c- character code to print
Returns
0 if char is not printed

Definition at line 286 of file ssd1306_8bit.inl.

◆ printFixed()

template<class I >
void NanoDisplayOps8< I >::printFixed ( 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.
stylespecific font style to use
Note
Supports only STYLE_NORMAL and STYLE_BOLD

Definition at line 335 of file ssd1306_8bit.inl.

◆ putPixel()

template<class I >
void NanoDisplayOps8< I >::putPixel ( lcdint_t  x,
lcdint_t  y 
)

Draws pixel on specified position

Parameters
x- position X
y- position Y
Note
color can be set via setColor()

Definition at line 96 of file ssd1306_8bit.inl.

◆ write()

template<class I >
size_t NanoDisplayOps8< I >::write ( uint8_t  c)

Writes single character to canvas

Parameters
c- character code to print

Definition at line 317 of file ssd1306_8bit.inl.

Member Data Documentation

◆ BITS_PER_PIXEL

template<class I>
const uint8_t NanoDisplayOps8< I >::BITS_PER_PIXEL = 8
static

number of bits per single pixel in buffer

Definition at line 526 of file display.h.


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