SSD1306 OLED display driver
1.8.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 | ssd1306_setColor (uint16_t color) |
Sets default color, generated by RGB_COLOR8 or RGB_COLOR16 macros. More... | |
void | ssd1306_setRgbColor (uint8_t r, uint8_t g, uint8_t b) |
Sets default color. More... | |
void | ssd1306_setRgbColor8 (uint8_t r, uint8_t g, uint8_t b) |
Sets default color. More... | |
void | ssd1306_drawMonoBuffer8 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap) |
void | ssd1306_drawBufferFast8 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data) |
void | ssd1306_drawBufferEx8 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, lcduint_t pitch, const uint8_t *data) |
void | ssd1306_fillScreen8 (uint8_t fill_Data) |
void | ssd1306_clearScreen8 (void) |
void | ssd1306_putPixel8 (lcdint_t x, lcdint_t y) |
void | ssd1306_putColorPixel8 (lcdint_t x, lcdint_t y, uint8_t color) |
void | ssd1306_drawVLine8 (lcdint_t x1, lcdint_t y1, lcdint_t y2) |
void | ssd1306_drawHLine8 (lcdint_t x1, lcdint_t y1, lcdint_t x2) |
void | ssd1306_drawLine8 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) |
void | ssd1306_drawRect8 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) |
void | ssd1306_fillRect8 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) |
void | ssd1306_drawMonoBitmap8 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap) |
void | ssd1306_drawBitmap8 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap) |
void | ssd1306_clearBlock8 (uint8_t x, uint8_t y, uint8_t w, uint8_t h) |
void | ssd1306_setCursor8 (lcduint_t x, lcduint_t y) |
void | ssd1306_printChar8 (uint8_t c) |
size_t | ssd1306_write8 (uint8_t ch) |
Prints single character to display at current cursor position. More... | |
size_t | ssd1306_print8 (const char ch[]) |
Prints null-terminated string to display at current cursor position. More... | |
uint8_t | ssd1306_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 ssd1306_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 281 of file ssd1306_8bit.c.
void ssd1306_clearScreen8 | ( | void | ) |
Fills screen with zero-byte
Definition at line 127 of file ssd1306_8bit.c.
void ssd1306_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 269 of file ssd1306_8bit.c.
void ssd1306_drawBufferEx8 | ( | lcdint_t | x, |
lcdint_t | y, | ||
lcduint_t | w, | ||
lcduint_t | h, | ||
lcduint_t | pitch, | ||
const uint8_t * | data | ||
) |
Draws 8-bit bitmap, located in SRAM, on the display, taking into account pitch parameter. Each byte represents separate pixel: refer to RGB_COLOR8 to understand RGB scheme, being used. pitch parameter specifies, length of single line in bytes.
x | - horizontal position in pixels |
y | - vertical position in pixels |
w | - width of bitmap in pixels |
h | - height of bitmap in pixels |
pitch | length of bitmap buffer line in bytes |
data | - pointer to data, located in SRAM. |
Definition at line 111 of file ssd1306_8bit.c.
void ssd1306_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 106 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 157 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 168 of file ssd1306_8bit.c.
void ssd1306_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 238 of file ssd1306_8bit.c.
void ssd1306_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 59 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 211 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 146 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 219 of file ssd1306_8bit.c.
void ssd1306_fillScreen8 | ( | uint8_t | fill_Data | ) |
Fills screen with pattern byte
fill_Data | pattern color to fill screen with |
Definition at line 116 of file ssd1306_8bit.c.
size_t ssd1306_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 ssd1306_setCursor8().
ch | - string to print to the display. 'LF' and 'CR' are skipped |
Definition at line 360 of file ssd1306_8bit.c.
void ssd1306_printChar8 | ( | uint8_t | c | ) |
Draws single character to canvas. Cursor position is defined by ssd1306_setCursor8(). Do not changes cursor position
c | - character code to print |
Definition at line 298 of file ssd1306_8bit.c.
uint8_t ssd1306_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 371 of file ssd1306_8bit.c.
Puts single color point directly in OLED display GDRAM.
x | - horizontal position in pixels |
y | - vertical position in pixels |
color | color in RGB8 format (2-3-2) |
Definition at line 139 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 132 of file ssd1306_8bit.c.
void ssd1306_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 44 of file ssd1306_8bit.c.
Set cursor position for text functions
x | horizontal position in pixels. |
y | vertical position in pixels. |
Definition at line 292 of file ssd1306_8bit.c.
void ssd1306_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 ssd1306_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 49 of file ssd1306_8bit.c.
void ssd1306_setRgbColor8 | ( | 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 ssd1306_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 54 of file ssd1306_8bit.c.
size_t ssd1306_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 ssd1306_setCursor8().
ch | - character to print to the display. 'LF' and 'CR' are skipped |
Definition at line 311 of file ssd1306_8bit.c.