SSD1306 OLED display driver
1.7.2
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
|
LCD direct draw functions only for color display. More...
Functions | |
void | ssd1331_setColor (uint16_t color) |
Sets default color, generated by RGB_COLOR8 or RGB_COLOR16 macros. More... | |
void | ssd1331_setRgbColor (uint8_t r, uint8_t g, uint8_t b) |
Sets default color. More... | |
void | ssd1331_drawLine (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint16_t color) |
void | ssd1331_copyBlock (uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t newLeft, uint8_t newTop) |
void | ssd1331_drawMonoBuffer8 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap) |
void | ssd1331_drawBufferFast8 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data) |
void | ssd1331_drawBufferFast16 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data) |
void | ssd1331_fillScreen8 (uint8_t fill_Data) |
void | ssd1331_clearScreen8 (void) |
void | ssd1331_putPixel8 (lcdint_t x, lcdint_t y) |
void | ssd1331_drawVLine8 (lcdint_t x1, lcdint_t y1, lcdint_t y2) |
void | ssd1331_drawHLine8 (lcdint_t x1, lcdint_t y1, lcdint_t x2) |
void | ssd1331_drawLine8 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) |
void | ssd1331_drawRect8 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) |
void | ssd1331_fillRect8 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) |
void | ssd1331_drawMonoBitmap8 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap) |
void | ssd1331_drawBitmap8 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap) |
void | ssd1331_clearBlock8 (uint8_t x, uint8_t y, uint8_t w, uint8_t h) |
void | ssd1331_setCursor8 (lcduint_t x, lcduint_t y) |
void | ssd1331_printChar8 (uint8_t c) |
size_t | ssd1331_write8 (uint8_t ch) |
Prints single character to display at current cursor position. More... | |
size_t | ssd1331_print8 (const char ch[]) |
Prints null-terminated string to display at current cursor position. More... | |
uint8_t | ssd1331_printFixed8 (lcdint_t x, lcdint_t y, const char *ch, EFontStyle style) |
LCD direct draw functions only for color display.
LCD direct draw functions are applicable for color display types. These functions will NOT work in ssd1306 compatible mode. Use ssd1306_setMode() function to change display mode to NORMAL. You can combine combine NanoEngine capabilities with these functions. Direct draw functions draw directly in GDRAM and do not use any double-buffering.
void ssd1331_clearBlock8 | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | w, | ||
uint8_t | h | ||
) |
Clears block, filling it with black pixels, directly in OLED display GDRAM.
x | start horizontal position in pixels |
y | start vertical position in pixels |
w | block width in pixels |
h | block height in pixels |
Definition at line 291 of file ssd1306_8bit.c.
void ssd1331_clearScreen8 | ( | void | ) |
Fills screen with zero-byte
Definition at line 144 of file ssd1306_8bit.c.
void ssd1331_copyBlock | ( | uint8_t | left, |
uint8_t | top, | ||
uint8_t | right, | ||
uint8_t | bottom, | ||
uint8_t | newLeft, | ||
uint8_t | newTop | ||
) |
Copies block in GDRAM to new position
left | column start of block to copy |
top | row start of block to copy |
right | column end of block to copy |
bottom | row end of block to copy |
newLeft | new column start |
newTop | new row start |
Definition at line 64 of file ssd1306_8bit.c.
void ssd1331_drawBitmap8 | ( | lcdint_t | xpos, |
lcdint_t | ypos, | ||
lcduint_t | w, | ||
lcduint_t | h, | ||
const uint8_t * | bitmap | ||
) |
Draw 8-bit color bitmap, located in Flash, directly to OLED display GDRAM. Each pixel of the bitmap is expected in 3-3-2 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 8-bit color bitmap. |
Definition at line 279 of file ssd1306_8bit.c.
void ssd1331_drawBufferFast16 | ( | lcdint_t | x, |
lcdint_t | y, | ||
lcduint_t | w, | ||
lcduint_t | h, | ||
const uint8_t * | data | ||
) |
Draws 16-bit bitmap, located in SRAM, on the display Each byte represents separate pixel: refer to RGB_COLOR16 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 |
data | - pointer to data, located in SRAM. |
Definition at line 30 of file ssd1306_16bit.c.
void ssd1331_drawBufferFast8 | ( | lcdint_t | x, |
lcdint_t | y, | ||
lcduint_t | w, | ||
lcduint_t | h, | ||
const uint8_t * | data | ||
) |
Draws 8-bit bitmap, located in SRAM, on the display Each byte represents separate pixel: 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 |
data | - pointer to data, located in SRAM. |
Definition at line 109 of file ssd1306_8bit.c.
Draw horizontal line directly in OLED display GDRAM.
x1 | - left position in pixels |
y1 | - vertical vertical position in pixels |
x2 | - right position in pixels |
Definition at line 167 of file ssd1306_8bit.c.
void ssd1331_drawLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2, | ||
uint16_t | color | ||
) |
Draws line
x1 | - x position in pixels of start point |
y1 | - y position in pixels of start point |
x2 | - x position in pixels of end point |
y2 | - y position in pixels of end point |
color | - color of the line, refer to RGB_COLOR8 macros |
Definition at line 49 of file ssd1306_8bit.c.
Draw line directly in OLED display GDRAM. This is software implementation. Some OLED controllers have hardware implementation. Refer to datasheet.
x1 | - start horizontal position in pixels |
y1 | - start vertical position in pixels |
x2 | - end horizontal position in pixels |
y2 | - end vertical position in pixels |
Definition at line 178 of file ssd1306_8bit.c.
void ssd1331_drawMonoBitmap8 | ( | lcdint_t | xpos, |
lcdint_t | ypos, | ||
lcduint_t | w, | ||
lcduint_t | h, | ||
const uint8_t * | bitmap | ||
) |
Draw monochrome bitmap, located in Flash, directly to OLED display GDRAM. The bitmap should be in ssd1306 format (each byte represents 8 vertical pixels)
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 monochrome bitmap. |
Definition at line 248 of file ssd1306_8bit.c.
void ssd1331_drawMonoBuffer8 | ( | lcdint_t | xpos, |
lcdint_t | ypos, | ||
lcduint_t | w, | ||
lcduint_t | h, | ||
const uint8_t * | bitmap | ||
) |
Draws 1-bit bitmap, located in SRAM, on the display Each bit represents separate pixel: refer to ssd1306 datasheet for more information.
xpos | horizontal position in pixels |
ypos | vertical position in pixels |
w | width of bitmap in pixels |
h | height of bitmap in pixels |
bitmap | pointer to data, located in SRAM. |
Definition at line 78 of file ssd1306_8bit.c.
Draw rectangle directly in OLED display GDRAM. This is software implementation. Some OLED controllers have hardware implementation. Refer to datasheet.
x1 | - start horizontal position in pixels |
y1 | - start vertical position in pixels |
x2 | - end horizontal position in pixels |
y2 | - end vertical position in pixels |
Definition at line 221 of file ssd1306_8bit.c.
Draw vertical line directly in OLED display GDRAM.
x1 | - horizontal position in pixels |
y1 | - top vertical position in pixels |
y2 | - bottom vertical position in pixels |
Definition at line 156 of file ssd1306_8bit.c.
Fill rectangle directly in OLED display GDRAM. This is software implementation. Some OLED controllers have hardware implementation. Refer to datasheet.
x1 | - start horizontal position in pixels |
y1 | - start vertical position in pixels |
x2 | - end horizontal position in pixels |
y2 | - end vertical position in pixels |
Definition at line 229 of file ssd1306_8bit.c.
void ssd1331_fillScreen8 | ( | uint8_t | fill_Data | ) |
Fills screen with pattern byte
fill_Data | pattern color to fill screen with |
Definition at line 133 of file ssd1306_8bit.c.
size_t ssd1331_print8 | ( | const char | ch[] | ) |
Prints null-terminated string to display at current cursor position.
Prints null-terminated string to display at current cursor position Cursor position can be set by ssd1331_setCursor8().
ch | - string to print to the display. 'LF' and 'CR' are skipped |
Definition at line 349 of file ssd1306_8bit.c.
void ssd1331_printChar8 | ( | uint8_t | c | ) |
Draws single character to canvas. Cursor position is defined by ssd1331_setCursor8(). Do not changes cursor position
c | - character code to print |
Definition at line 308 of file ssd1306_8bit.c.
uint8_t ssd1331_printFixed8 | ( | lcdint_t | x, |
lcdint_t | y, | ||
const char * | ch, | ||
EFontStyle | style | ||
) |
Prints text to screen using fixed font.
x | horizontal position in pixels |
y | vertical position in pixels |
ch | NULL-terminated string to print |
style | font style (EFontStyle), normal by default (not implemented). |
Definition at line 360 of file ssd1306_8bit.c.
Puts single color point directly in OLED display GDRAM.
x | - horizontal position in pixels |
y | - vertical position in pixels |
Definition at line 149 of file ssd1306_8bit.c.
void ssd1331_setColor | ( | uint16_t | color | ) |
Sets default color, generated by RGB_COLOR8 or RGB_COLOR16 macros.
Sets color generated by RGB_COLOR8 or RGB_COLOR16 macros.
color | - new color to use for monochrome-specific operations on color display. |
Definition at line 39 of file ssd1306_8bit.c.
Set cursor position for text functions
x | horizontal position in pixels. |
y | vertical position in pixels. |
Definition at line 302 of file ssd1306_8bit.c.
void ssd1331_setRgbColor | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
Sets default color.
Sets default color for monochrome operations. For now this function supports only 8-bit RGB mode. To work with RGB colors in 16-bit mode, please refer to ssd1331_setColor() function and RGB_COLOR16 macros.
r | - red in 0-255 range. |
g | - green in 0-255 range. |
b | - blue in 0-255 range. |
Definition at line 44 of file ssd1306_8bit.c.
size_t ssd1331_write8 | ( | uint8_t | ch | ) |
Prints single character to display at current cursor position.
Prints single character to display at current cursor position. Cursor position can be set by ssd1331_setCursor8().
ch | - character to print to the display. 'LF' and 'CR' are skipped |
Definition at line 318 of file ssd1306_8bit.c.