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>
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)) |
![]() | |
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) |
NanoFont & | getFont () |
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 | |
![]() | |
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 | |
NanoFont * | m_font = nullptr |
currently set font | |
I & | m_intf |
communication interface with the display | |
NanoDisplayOps8 is template class for 8-bit operations.
void NanoDisplayOps8< I >::clear | ( | ) |
Clears canvas
Definition at line 155 of file ssd1306_8bit.inl.
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.
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 |
Definition at line 167 of file ssd1306_8bit.inl.
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.
xpos | start horizontal position in pixels |
ypos | start vertical position in pixels |
w | bitmap width in pixels |
h | bitmap height in pixels |
bitmap | pointer to Flash data, containing 16-bit color bitmap. |
Definition at line 218 of file ssd1306_8bit.inl.
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.
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.
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.
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.
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.
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) |
buffer | pointer to data, located in SRAM: each byte represents 8 vertical pixels. |
Definition at line 224 of file ssd1306_8bit.inl.
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.
xpos | horizontal position in pixels |
ypos | vertical position in pixels |
w | width of bitmap in pixels |
h | height of bitmap in pixels |
buffer | pointer to data, located in RAM. |
Definition at line 281 of file ssd1306_8bit.inl.
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
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) |
buffer | pointer to data, located in SRAM: each byte represents 8 vertical pixels. |
Definition at line 256 of file ssd1306_8bit.inl.
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.
x | horizontal position in pixels |
y | vertical position in pixels |
w | width of bitmap in pixels |
h | height of bitmap in pixels |
buffer | pointer to data, located in SRAM. |
Definition at line 262 of file ssd1306_8bit.inl.
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.
x | horizontal position in pixels |
y | vertical position in pixels |
w | width of bitmap in pixels |
h | height of bitmap in pixels |
buffer | pointer to data, located in SRAM. |
Definition at line 268 of file ssd1306_8bit.inl.
void NanoDisplayOps8< I >::drawHLine | ( | lcdint_t | x1, |
lcdint_t | y1, | ||
lcdint_t | x2 | ||
) |
Draws horizontal or vertical line
x1 | - position X |
y1 | - position Y |
x2 | - position X |
Definition at line 103 of file ssd1306_8bit.inl.
void NanoDisplayOps8< I >::drawVLine | ( | lcdint_t | x1, |
lcdint_t | y1, | ||
lcdint_t | y2 | ||
) |
Draws horizontal or vertical line
x1 | - position X |
y1 | - position Y |
y2 | - position Y |
Definition at line 114 of file ssd1306_8bit.inl.
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
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.
void NanoDisplayOps8< I >::fill | ( | uint16_t | color | ) |
Fill screen content with specified color
color | color to fill display with |
Definition at line 144 of file ssd1306_8bit.inl.
void NanoDisplayOps8< I >::fillRect | ( | lcdint_t | x1, |
lcdint_t | y1, | ||
lcdint_t | x2, | ||
lcdint_t | y2 | ||
) |
Fills rectangle area
x1 | - position X |
y1 | - position Y |
x2 | - position X |
y2 | - position Y |
Definition at line 125 of file ssd1306_8bit.inl.
uint8_t NanoDisplayOps8< I >::printChar | ( | uint8_t | c | ) |
Draws single character to canvas
c | - character code to print |
Definition at line 286 of file ssd1306_8bit.inl.
void NanoDisplayOps8< I >::printFixed | ( | lcdint_t | xpos, |
lcdint_t | y, | ||
const char * | ch, | ||
EFontStyle | style = STYLE_NORMAL |
||
) |
Print text at specified position to canvas
xpos | position in pixels |
y | position in pixels |
ch | pointer to NULL-terminated string. |
style | specific font style to use |
Definition at line 335 of file ssd1306_8bit.inl.
void NanoDisplayOps8< I >::putPixel | ( | lcdint_t | x, |
lcdint_t | y | ||
) |
Draws pixel on specified position
x | - position X |
y | - position Y |
Definition at line 96 of file ssd1306_8bit.inl.
size_t NanoDisplayOps8< I >::write | ( | uint8_t | c | ) |
Writes single character to canvas
c | - character code to print |
Definition at line 317 of file ssd1306_8bit.inl.
|
static |