SSD1306 OLED display driver
1.3.1
This library is developed to control SSD1306 i2c/spi OLED display
|
#include <nano_gfx.h>
Public Member Functions | |
NanoCanvas (uint8_t w, uint8_t h, uint8_t *bytes) | |
void | drawPixel (uint8_t x, uint8_t y) __attribute__((deprecated)) |
void | putPixel (uint8_t x, uint8_t y) |
void | drawRect (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) |
void | drawHLine (uint8_t x1, uint8_t y1, uint8_t x2) |
void | drawVLine (uint8_t x1, uint8_t y1, uint8_t y2) |
void | fillRect (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t templ) |
void | clear () |
void | char_f6x8 (uint8_t x, uint8_t y, const char ch[], EFontStyle style=STYLE_NORMAL) __attribute__((deprecated)) |
void | charF6x8 (uint8_t x, uint8_t y, const char ch[], EFontStyle style=STYLE_NORMAL) |
void | drawSpritePgm (uint8_t x, uint8_t y, const uint8_t sprite[]) |
void | drawSprite (uint8_t x, uint8_t y, const uint8_t sprite[]) |
void | drawSprite (SPRITE *sprite) |
uint8_t | width () const |
uint8_t | height () const |
uint8_t * | buffer () const |
void | invert () |
void | flipH () |
void | blt (uint8_t x, uint8_t y) |
NanoCanvas represents objects for drawing in memory buffer
Definition at line 33 of file nano_gfx.h.
|
inline |
Creates new canvas object. Width can be of any value. Height should be divided by 8. Memory buffer must be not less than w * h / 8.
w | - width |
h | - height |
bytes | - pointer to memory buffer to use |
Definition at line 46 of file nano_gfx.h.
void NanoCanvas::blt | ( | uint8_t | x, |
uint8_t | y | ||
) |
Draws canvas on the LCD display
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
Definition at line 206 of file nano_gfx.cpp.
|
inline |
Returns canvas buffer
Definition at line 162 of file nano_gfx.h.
|
inline |
Prints text to canvas buffer
x | - start position X |
y | - start position Y |
ch | - text to print (null-terminated) |
style | - font style (EFontStyle), normal by default |
Definition at line 118 of file nano_gfx.h.
void NanoCanvas::charF6x8 | ( | uint8_t | x, |
uint8_t | y, | ||
const char | ch[], | ||
EFontStyle | style = STYLE_NORMAL |
||
) |
Prints text to canvas buffer
x | - start position X |
y | - start position Y |
ch | - text to print (null-terminated) |
style | - font style (EFontStyle), normal by default |
Definition at line 114 of file nano_gfx.cpp.
void NanoCanvas::clear | ( | ) |
Clears canvas
Definition at line 105 of file nano_gfx.cpp.
void NanoCanvas::drawHLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2 | ||
) |
Draws horizontal line
x1 | - left boundary |
y1 | - position Y |
x2 | - right boundary |
Definition at line 41 of file nano_gfx.cpp.
|
inline |
Draws pixel on specified position
x | - position X |
y | - position Y |
Definition at line 62 of file nano_gfx.h.
void NanoCanvas::drawRect | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2 | ||
) |
Draws rectangle
x1 | - left boundary |
y1 | - top boundary |
x2 | - right boundary |
y2 | - bottom boundary |
Definition at line 61 of file nano_gfx.cpp.
void NanoCanvas::drawSprite | ( | uint8_t | x, |
uint8_t | y, | ||
const uint8_t | sprite[] | ||
) |
Sprite is small image 8x8, sprite doesn't change background Reads sprite from SRAM memory
Definition at line 177 of file nano_gfx.cpp.
void NanoCanvas::drawSprite | ( | SPRITE * | sprite | ) |
Draws sprite in the buffer
sprite | - pointer to SPRITE structure containing sprite information |
Definition at line 192 of file nano_gfx.cpp.
void NanoCanvas::drawSpritePgm | ( | uint8_t | x, |
uint8_t | y, | ||
const uint8_t | sprite[] | ||
) |
Sprite is small image 8x8, sprite doesn't change background Reads sprite from Flash memory
Definition at line 161 of file nano_gfx.cpp.
void NanoCanvas::drawVLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | y2 | ||
) |
Draws vertical line
x1 | - position X |
y1 | - top boundary |
y2 | - bottom boundary |
Definition at line 51 of file nano_gfx.cpp.
void NanoCanvas::fillRect | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2, | ||
uint8_t | templ | ||
) |
Draws filled rectangle
x1 | - left boundary |
y1 | - top boundary |
x2 | - right boundary |
y2 | - bottom boundary |
templ | - template to use for filling rectangle |
Definition at line 70 of file nano_gfx.cpp.
void NanoCanvas::flipH | ( | ) |
Flips image horizontally.
Definition at line 217 of file nano_gfx.cpp.
|
inline |
Returns canvas height
Definition at line 157 of file nano_gfx.h.
void NanoCanvas::invert | ( | ) |
Inverts content in the buffer. white becomes black and wise versa.
Definition at line 211 of file nano_gfx.cpp.
void NanoCanvas::putPixel | ( | uint8_t | x, |
uint8_t | y | ||
) |
Draws pixel on specified position
x | - position X |
y | - position Y |
Definition at line 28 of file nano_gfx.cpp.
|
inline |
Returns canvas width
Definition at line 152 of file nano_gfx.h.