SSD1306 OLED display driver 1.8.2 This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays

Functions
DIRECT DRAW: 16-bit API functions only for color displays

LCD direct draw functions only for color display. More...

## Functions
void | ssd1306_setRgbColor16 (uint8_t r, uint8_t g, uint8_t b)
| Sets default color. More...
void | ssd1306_drawBufferFast16 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data)
void | ssd1306_drawBufferEx16 (lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, lcduint_t pitch, const uint8_t *data)
void | ssd1306_drawMonoBuffer16 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
void | ssd1306_fillScreen16 (uint16_t fill_Data)
void | ssd1306_clearScreen16 (void)
void | ssd1306_putPixel16 (lcdint_t x, lcdint_t y)
void | ssd1306_putColorPixel16 (lcdint_t x, lcdint_t y, uint16_t color)
void | ssd1306_drawVLine16 (lcdint_t x1, lcdint_t y1, lcdint_t y2)
void | ssd1306_drawHLine16 (lcdint_t x1, lcdint_t y1, lcdint_t x2)
void | ssd1306_drawLine16 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
void | ssd1306_drawRect16 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
void | ssd1306_fillRect16 (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
void | ssd1306_drawMonoBitmap16 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
void | ssd1306_drawBitmap16 (lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
void | ssd1306_clearBlock16 (uint8_t x, uint8_t y, uint8_t w, uint8_t h)
void | ssd1306_setCursor16 (lcduint_t x, lcduint_t y)
void | ssd1306_printChar16 (uint8_t c)
size_t | ssd1306_write16 (uint8_t ch)
| Prints single character to display at current cursor position. More...
size_t | ssd1306_print16 (const char ch[])
| Prints null-terminated string to display at current cursor position. More...
uint8_t | ssd1306_printFixed16 (lcdint_t x, lcdint_t y, const char *ch, EFontStyle style)

## Detailed Description

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.

## Function Documentation

## ◆ ssd1306_clearBlock16()

void ssd1306_clearBlock16 | ( | uint8_t | x,
|  | uint8_t | y,
|  | uint8_t | w,
|  | uint8_t | h
| ) |  |

Clears block, filling it with black pixels, directly in OLED display GDRAM.

Parameters

  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 270 of file ssd1306_16bit.c.

## ◆ ssd1306_clearScreen16()

void ssd1306_clearScreen16 | ( | void |  | ) |

Fills screen with zero-byte

Definition at line 116 of file ssd1306_16bit.c.

## ◆ ssd1306_drawBitmap16()

void ssd1306_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

  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 258 of file ssd1306_16bit.c.

## ◆ ssd1306_drawBufferEx16()

void ssd1306_drawBufferEx16 | ( | lcdint_t | x,
|  | lcdint_t | y,
|  | lcduint_t | w,
|  | lcduint_t | h,
|  | lcduint_t | pitch,
|  | const uint8_t * | data
| ) |  |

Draws 16-bit bitmap, located in SRAM, on the display, taking into account pitch parameter. Each byte represents separate pixel: refer to RGB_COLOR16 to understand RGB scheme, being used. pitch parameter specifies, length of single line in bytes.

Parameters

  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 66 of file ssd1306_16bit.c.

## ◆ ssd1306_drawBufferFast16()

void ssd1306_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.

Parameters

  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 61 of file ssd1306_16bit.c.

## ◆ ssd1306_drawHLine16()

void ssd1306_drawHLine16 | ( | lcdint_t | x1,
|  | lcdint_t | y1,
|  | lcdint_t | x2
| ) |  |

Draw horizontal line directly in OLED display GDRAM.

Parameters

  x1 | - left position in pixels
  y1 | - vertical vertical position in pixels
  x2 | - right position in pixels

Note
  set color with ssd1306_setColor() function.

Definition at line 146 of file ssd1306_16bit.c.

## ◆ ssd1306_drawLine16()

void ssd1306_drawLine16 | ( | lcdint_t | x1,
|  | lcdint_t | y1,
|  | lcdint_t | x2,
|  | lcdint_t | y2
| ) |  |

Draw line directly in OLED display GDRAM. This is software implementation. Some OLED controllers have hardware implementation. Refer to datasheet.

Parameters

  x1 | - start horizontal position in pixels
  y1 | - start vertical position in pixels
  x2 | - end horizontal position in pixels
  y2 | - end vertical position in pixels

Note
  set color with ssd1306_setColor() function.

Definition at line 157 of file ssd1306_16bit.c.

## ◆ ssd1306_drawMonoBitmap16()

void ssd1306_drawMonoBitmap16 | ( | 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)

Parameters

  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.

Note
  set color with ssd1306_setColor() function.

Definition at line 227 of file ssd1306_16bit.c.

## ◆ ssd1306_drawMonoBuffer16()

void ssd1306_drawMonoBuffer16 | ( | 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.

Parameters

  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 74 of file ssd1306_16bit.c.

## ◆ ssd1306_drawRect16()

void ssd1306_drawRect16 | ( | lcdint_t | x1,
|  | lcdint_t | y1,
|  | lcdint_t | x2,
|  | lcdint_t | y2
| ) |  |

Draw rectangle directly in OLED display GDRAM. This is software implementation. Some OLED controllers have hardware implementation. Refer to datasheet.

Parameters

  x1 | - start horizontal position in pixels
  y1 | - start vertical position in pixels
  x2 | - end horizontal position in pixels
  y2 | - end vertical position in pixels

Note
  set color with ssd1306_setColor() function.

Definition at line 200 of file ssd1306_16bit.c.

## ◆ ssd1306_drawVLine16()

void ssd1306_drawVLine16 | ( | lcdint_t | x1,
|  | lcdint_t | y1,
|  | lcdint_t | y2
| ) |  |

Draw vertical line directly in OLED display GDRAM.

Parameters

  x1 | - horizontal position in pixels
  y1 | - top vertical position in pixels
  y2 | - bottom vertical position in pixels

Note
  set color with ssd1306_setColor() function.

Definition at line 135 of file ssd1306_16bit.c.

## ◆ ssd1306_fillRect16()

void ssd1306_fillRect16 | ( | lcdint_t | x1,
|  | lcdint_t | y1,
|  | lcdint_t | x2,
|  | lcdint_t | y2
| ) |  |

Fill rectangle directly in OLED display GDRAM. This is software implementation. Some OLED controllers have hardware implementation. Refer to datasheet.

Parameters

  x1 | - start horizontal position in pixels
  y1 | - start vertical position in pixels
  x2 | - end horizontal position in pixels
  y2 | - end vertical position in pixels

Note
  set color with ssd1306_setColor() function.

Definition at line 208 of file ssd1306_16bit.c.

## ◆ ssd1306_fillScreen16()

void ssd1306_fillScreen16 | ( | uint16_t | fill_Data | ) |

Fills screen with pattern byte

Parameters

  fill_Data | pattern color to fill screen with

Definition at line 105 of file ssd1306_16bit.c.

## ◆ ssd1306_print16()

size_t ssd1306_print16 | ( | 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_setCursor16().

Parameters

  ch | - string to print to the display. 'LF' and 'CR' are skipped

Returns
  returns number of printed characters.

Definition at line 348 of file ssd1306_16bit.c.

## ◆ ssd1306_printChar16()

void ssd1306_printChar16 | ( | uint8_t | c | ) |

Draws single character to canvas. Cursor position is defined by ssd1306_setCursor16(). Do not changes cursor position

Parameters

  c | - character code to print

Note
  set color with ssd1306_setColor() function.

Definition at line 287 of file ssd1306_16bit.c.

## ◆ ssd1306_printFixed16()

uint8_t ssd1306_printFixed16 | ( | lcdint_t | x,
|  | lcdint_t | y,
|  | const char * | ch,
|  | EFontStyle | style
| ) |  |

Prints text to screen using fixed font.

Parameters

  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).

Returns
  number of chars in string

See also
  ssd1306_setFixedFont

Note
  set color with ssd1306_setColor() function.

Definition at line 359 of file ssd1306_16bit.c.

## ◆ ssd1306_putColorPixel16()

void ssd1306_putColorPixel16 | ( | lcdint_t | x,
|  | lcdint_t | y,
|  | uint16_t | color
| ) |  |

Puts single color point directly in OLED display GDRAM.

Parameters

  x | - horizontal position in pixels
  y | - vertical position in pixels
  color | color in 16-bit format: 5-6-5

Definition at line 128 of file ssd1306_16bit.c.

## ◆ ssd1306_putPixel16()

void ssd1306_putPixel16 | ( | lcdint_t | x,
|  | lcdint_t | y
| ) |  |

Puts single color point directly in OLED display GDRAM.

Parameters

  x | - horizontal position in pixels
  y | - vertical position in pixels

Note
  set color with ssd1306_setColor() function.

Definition at line 121 of file ssd1306_16bit.c.

## ◆ ssd1306_setCursor16()

void ssd1306_setCursor16 | ( | lcduint_t | x,
|  | lcduint_t | y
| ) |  |

Set cursor position for text functions

Parameters

  x | horizontal position in pixels.
  y | vertical position in pixels.

Definition at line 281 of file ssd1306_16bit.c.

## ◆ ssd1306_setRgbColor16()

void ssd1306_setRgbColor16 | ( | uint8_t | r,
|  | uint8_t | g,
|  | uint8_t | b
| ) |  |

Sets default color.

Sets default color for monochrome operations. This function supports only 16-bit RGB mode. To work with RGB colors in 8-bit mode, please refer to ssd1306_setRgbColor8() function and RGB_COLOR8 macros.

Parameters

  r | - red in 0-255 range.
  g | - green in 0-255 range.
  b | - blue in 0-255 range.

Definition at line 40 of file ssd1306_16bit.c.

## ◆ ssd1306_write16()

size_t ssd1306_write16 | ( | 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_setCursor16().

Parameters

  ch | - character to print to the display. 'LF' and 'CR' are skipped

Returns
  returns number of printed characters.

Definition at line 300 of file ssd1306_16bit.c.