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

#include <display.h>

Inheritance diagram for NanoDisplayOps1< I >:
Collaboration diagram for NanoDisplayOps1< 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 gfx_drawMonoBitmap (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf)
 
void 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. 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) __attribute__((noinline))
 
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))
 
void printFixedN (lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style, uint8_t factor) __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 = 1
 

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 NanoDisplayOps1< I >

NanoDisplayOps1 is template class for 1-bit operations.

Definition at line 47 of file display.h.

Member Function Documentation

◆ clear()

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

Clears canvas

Definition at line 426 of file ssd1306_1bit.inl.

◆ drawBitmap1()

template<class I >
void NanoDisplayOps1< 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 476 of file ssd1306_1bit.inl.

◆ drawBitmap16()

template<class I >
void NanoDisplayOps1< 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 621 of file ssd1306_1bit.inl.

◆ drawBitmap4()

template<class I >
void NanoDisplayOps1< 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 609 of file ssd1306_1bit.inl.

◆ drawBitmap8()

template<class I >
void NanoDisplayOps1< 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 615 of file ssd1306_1bit.inl.

◆ drawBuffer1()

template<class I >
void NanoDisplayOps1< 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 627 of file ssd1306_1bit.inl.

◆ drawBuffer16()

template<class I >
void NanoDisplayOps1< 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 717 of file ssd1306_1bit.inl.

◆ drawBuffer1Fast()

template<class I >
void NanoDisplayOps1< 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 691 of file ssd1306_1bit.inl.

◆ drawBuffer4()

template<class I >
void NanoDisplayOps1< 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 705 of file ssd1306_1bit.inl.

◆ drawBuffer8()

template<class I >
void NanoDisplayOps1< 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 711 of file ssd1306_1bit.inl.

◆ drawHLine()

template<class I >
void NanoDisplayOps1< 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 352 of file ssd1306_1bit.inl.

◆ drawVLine()

template<class I >
void NanoDisplayOps1< 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 362 of file ssd1306_1bit.inl.

◆ drawXBitmap()

template<class I >
void NanoDisplayOps1< 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 442 of file ssd1306_1bit.inl.

◆ fill()

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

Fill screen content with specified color

Parameters
colorcolor to fill display with

Definition at line 722 of file ssd1306_1bit.inl.

◆ fillRect()

template<class I >
void NanoDisplayOps1< 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 386 of file ssd1306_1bit.inl.

◆ gfx_drawMonoBitmap()

template<class I >
void NanoDisplayOps1< I >::gfx_drawMonoBitmap ( lcdint_t  x,
lcdint_t  y,
lcduint_t  w,
lcduint_t  h,
const uint8_t *  buf 
)

Draws bitmap, located in Flash, on the display

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

Definition at line 544 of file ssd1306_1bit.inl.

◆ printChar()

template<class I >
uint8_t NanoDisplayOps1< 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 119 of file ssd1306_1bit.inl.

◆ printFixed()

template<class I >
void NanoDisplayOps1< 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 37 of file ssd1306_1bit.inl.

◆ printFixedN()

template<class I >
void NanoDisplayOps1< I >::printFixedN ( lcdint_t  xpos,
lcdint_t  y,
const char *  ch,
EFontStyle  style,
uint8_t  factor 
)

Prints text to screen using size fixed font, scaled by factor value.
Factor value 0 gives regular font size (6x8 for example)
Factor value 1 gives double font size (12x16 if 6x8 font is used)
Factor value 2 gives fourth font size (24x32 if 6x8 font is used)
Factor value 3 gives eighth font size (48x64 if 6x8 font is used)

Parameters
xpos- horizontal position in pixels
y- vertical position in pixels
ch- NULL-terminated string to print
style- font style (EFontStyle), normal by default.
factor- 0, 1, 2, 3.
Returns
number of chars in string
Warning
Be careful with you flash space! Do not mix too many different functions in single sketch. printFixedN() uses much flash: ~474 bytes, ssd1306_printFixed() needs 388 bytes. Placing both of these functions to your sketch will consume almost 1KiB.

Definition at line 245 of file ssd1306_1bit.inl.

◆ putPixel()

template<class I >
void NanoDisplayOps1< 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 345 of file ssd1306_1bit.inl.

◆ write()

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

Writes single character to canvas

Parameters
c- character code to print

Definition at line 150 of file ssd1306_1bit.inl.

Member Data Documentation

◆ BITS_PER_PIXEL

template<class I>
const uint8_t NanoDisplayOps1< I >::BITS_PER_PIXEL = 1
static

number of bits per single pixel in buffer

Definition at line 51 of file display.h.


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