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

Classes | Functions
DIRECT DRAW: Generic API functions, common for all displays and all display modes.

Generic API functions, common for all displays and all display modes. More...

## Classes
struct | SAppMenu

## Functions
void | ssd1306_setPos (uint8_t x, uint8_t y)
void | ssd1306_setCursor (lcdint_t x, lcdint_t y)
| Sets cursor position for text mode print functions. More...
void | ssd1306_setFixedFont (const uint8_t *progmemFont)
void | ssd1306_setFreeFont (const uint8_t *progmemFont)
void | ssd1306_setSecondaryFont (const uint8_t *progmemUnicode)
void | ssd1306_setFont6x8 (const uint8_t *progmemFont) __attribute__((deprecated))
void | ssd1306_getCharBitmap (uint16_t ch, SCharInfo *info)
| returns char data for currently set (active) font. More...
void | ssd1306_enableUtf8Mode (void)
void | ssd1306_enableAsciiMode (void)
lcduint_t | ssd1306_getTextSize (const char *text, lcduint_t *height)
void | ssd1306_createMenu (SAppMenu *menu, const char **items, uint8_t count)
void | ssd1306_showMenu (SAppMenu *menu)
void | ssd1306_showMenu8 (SAppMenu *menu)
void | ssd1306_showMenu16 (SAppMenu *menu)
void | ssd1306_updateMenu (SAppMenu *menu)
void | ssd1306_updateMenu8 (SAppMenu *menu)
void | ssd1306_updateMenu16 (SAppMenu *menu)
uint8_t | ssd1306_menuSelection (SAppMenu *menu)
void | ssd1306_menuDown (SAppMenu *menu)
void | ssd1306_menuUp (SAppMenu *menu)
void | ssd1306_drawProgressBar (int8_t progress)
void | ssd1306_drawProgressBar8 (int8_t progress)

## Detailed Description

Generic API functions, common for all displays and all display modes.

Generic API functions, common for all displays and all display modes.

## Function Documentation

## ◆ ssd1306_createMenu()

void ssd1306_createMenu | ( | SAppMenu * | menu,
|  | const char ** | items,
|  | uint8_t | count
| ) |  |

Creates menu object with the provided list of menu items. List of menu items (strings) must exist all until menu object is no longer needed. Selection is set to the first item by default.

Parameters

  menu | - Pointer to SAppMenu structure
  items | - array of null-termintated strings (located in SRAM)
  count | - count of menu items in the array

Definition at line 49 of file ssd1306_menu.c.

## ◆ ssd1306_drawProgressBar()

void ssd1306_drawProgressBar | ( | int8_t | progress | ) |

Draws progress bar in the middle of the screen

Parameters

  progress | progress value in range 0 - 100.

Definition at line 245 of file ssd1306_menu.c.

## ◆ ssd1306_drawProgressBar8()

void ssd1306_drawProgressBar8 | ( | int8_t | progress | ) |

Draws progress bar in the middle of the screen

Parameters

  progress | progress value in range 0 - 100.

Definition at line 272 of file ssd1306_menu.c.

## ◆ ssd1306_enableAsciiMode()

void ssd1306_enableAsciiMode | ( | void |  | ) |

Enables ascii mode for all text-functions. No any decoding will be performed

Definition at line 127 of file ssd1306_generic.c.

## ◆ ssd1306_enableUtf8Mode()

void ssd1306_enableUtf8Mode | ( | void |  | ) |

Enables utf8 support for all text-functions.

Note
  Unicode-16 only supported in text decoding functions.

Definition at line 120 of file ssd1306_generic.c.

## ◆ ssd1306_getCharBitmap()

void ssd1306_getCharBitmap | ( | uint16_t | ch,
|  | SCharInfo * | info
| ) |  |

returns char data for currently set (active) font.

Function returns char data for currently set font: pointer to progmem data for specified char, and width, height of the char. You can use these data to draw char manually using ssd1306_drawBitmap(), ssd1306_drawMonoBitmap8() or NanoCanvasOps::drawBitmap1().

Parameters

  ch | char to read from set font
  info | pointer to SCharInfo structure to fill with char data

See also
  ssd1306_setFixedFont

Definition at line 93 of file ssd1306_generic.c.

## ◆ ssd1306_getTextSize()

lcduint_t ssd1306_getTextSize | ( | const char * | text,
|  | lcduint_t * | height
| ) |  |

Returns dimensions in pixels for text provided.

Parameters

  text | text to calculate size of
  height | variable to store text height. Can be NULL

Returns
  witdth of passed text in pixels

Definition at line 372 of file ssd1306_generic.c.

## ◆ ssd1306_menuDown()

void ssd1306_menuDown | ( | SAppMenu * | menu | ) |

Moves selection pointer down by 1 item. If there are no items below, it will set selection pointer to the first item. Use ssd1306_updateMenu() to refresh menu state on the display.

Parameters

  menu | - Pointer to SAppMenu structure

Definition at line 221 of file ssd1306_menu.c.

## ◆ ssd1306_menuSelection()

uint8_t ssd1306_menuSelection | ( | SAppMenu * | menu | ) |

Returns currently selected menu item. First item has zero-index.

Parameters

  menu | - Pointer to SAppMenu structure

Warning
  works only in 8-bit RGB normal mode.

Definition at line 216 of file ssd1306_menu.c.

## ◆ ssd1306_menuUp()

void ssd1306_menuUp | ( | SAppMenu * | menu | ) |

Moves selection pointer up by 1 item. If selected item is the first one, then selection pointer will set to the last item in menu list. Use ssd1306_updateMenu() to refresh menu state on the display.

Parameters

  menu | - Pointer to SAppMenu structure

Definition at line 233 of file ssd1306_menu.c.

## ◆ ssd1306_setCursor()

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

Sets cursor position for text mode print functions.

Sets cursor position for text mode print functions.

Parameters

  x | xpos in pixels
  y | ypos in pixels

Definition at line 68 of file ssd1306_generic.c.

## ◆ ssd1306_setFixedFont()

void ssd1306_setFixedFont | ( | const uint8_t * | progmemFont | ) |

Function allows to set another fixed font for the library. By default, the font supports only first 128 - 32 ascii chars. Please refer to github wiki on how to generate new fonts.

Parameters

  progmemFont | - font to setup located in Flash area

Definition at line 220 of file ssd1306_generic.c.

## ◆ ssd1306_setFont6x8()

void ssd1306_setFont6x8 | ( | const uint8_t * | progmemFont | ) |

Function allows to set another font for the library. By default, the font supports only first 128 - 32 ascii chars. First 32 chars of ascii table are non-printable, and removed from the font table to reduce flash memory consumption. Default font doesn't support russian characters. Using this function you can implement your own fonts. First font char must be started with <space> image.

Parameters

  progmemFont | - font to setup located in Flash area

Deprecated:
  Use ssd1306_setFixedFont() instead.

Definition at line 1094 of file ssd1306_1bit.c.

## ◆ ssd1306_setFreeFont()

void ssd1306_setFreeFont | ( | const uint8_t * | progmemFont | ) |

Function allows to set another free font for the library. By default, the font supports only first 128 - 32 ascii chars. Please refer to github wiki on how to generate new fonts.

Parameters

  progmemFont | - font to setup located in Flash area

Note
  This function supports new fonts of ssd1306 library 1.7.8 and above

Definition at line 305 of file ssd1306_generic.c.

## ◆ ssd1306_setPos()

void ssd1306_setPos | ( | uint8_t | x,
|  | uint8_t | y
| ) |  |

Set position in terms of display.

Parameters

  x | - horizontal position in pixels
  y | - vertical position in blocks (pixels/8)

## ◆ ssd1306_setSecondaryFont()

void ssd1306_setSecondaryFont | ( | const uint8_t * | progmemUnicode | ) |

Function allows sets secondary font for specific language. Use it if you want to use additional font to combine capabilities of ascii fonts and language specific font.

Parameters

  progmemUnicode | font containing unicode table (refer to ssd1306xled_font6x8_German as example).

Definition at line 82 of file ssd1306_generic.c.

## ◆ ssd1306_showMenu()

void ssd1306_showMenu | ( | SAppMenu * | menu | ) |

Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.

Parameters

  menu | - Pointer to SAppMenu structure

Warning
  works only in SSD1306 compatible mode.

Definition at line 126 of file ssd1306_menu.c.

## ◆ ssd1306_showMenu16()

void ssd1306_showMenu16 | ( | SAppMenu * | menu | ) |

Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.

Parameters

  menu | - Pointer to SAppMenu structure

Warning
  works only in 16-bit RGB normal mode.

Definition at line 148 of file ssd1306_menu.c.

## ◆ ssd1306_showMenu8()

void ssd1306_showMenu8 | ( | SAppMenu * | menu | ) |

Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.

Parameters

  menu | - Pointer to SAppMenu structure

Warning
  works only in 8-bit RGB normal mode.

Definition at line 137 of file ssd1306_menu.c.

## ◆ ssd1306_updateMenu()

void ssd1306_updateMenu | ( | SAppMenu * | menu | ) |

Updates menu items on the display. That is if selection is changed, the function will update only those areas, affected by the change.

Parameters

  menu | - Pointer to SAppMenu structure

Definition at line 159 of file ssd1306_menu.c.

## ◆ ssd1306_updateMenu16()

void ssd1306_updateMenu16 | ( | SAppMenu * | menu | ) |

Updates menu items on the display. That is if selection is changed, the function will update only those areas, affected by the change.

Parameters

  menu | - Pointer to SAppMenu structure

Warning
  works only in SSD1306 compatible mode.

Definition at line 197 of file ssd1306_menu.c.

## ◆ ssd1306_updateMenu8()

void ssd1306_updateMenu8 | ( | SAppMenu * | menu | ) |

Updates menu items on the display. That is if selection is changed, the function will update only those areas, affected by the change.

Parameters

  menu | - Pointer to SAppMenu structure

Warning
  works only in SSD1306 compatible mode.

Definition at line 178 of file ssd1306_menu.c.