SSD1306 OLED display driver
1.8.2
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
|
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) |
Generic API functions, common for all displays and all display modes.
Generic API functions, common for all displays and all display modes.
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.
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.
void ssd1306_drawProgressBar | ( | int8_t | progress | ) |
Draws progress bar in the middle of the screen
progress | progress value in range 0 - 100. |
Definition at line 245 of file ssd1306_menu.c.
void ssd1306_drawProgressBar8 | ( | int8_t | progress | ) |
Draws progress bar in the middle of the screen
progress | progress value in range 0 - 100. |
Definition at line 272 of file ssd1306_menu.c.
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.
void ssd1306_enableUtf8Mode | ( | void | ) |
Enables utf8 support for all text-functions.
Definition at line 120 of file ssd1306_generic.c.
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().
ch | char to read from set font |
info | pointer to SCharInfo structure to fill with char data |
Definition at line 93 of file ssd1306_generic.c.
Returns dimensions in pixels for text provided.
text | text to calculate size of |
height | variable to store text height. Can be NULL |
Definition at line 372 of file ssd1306_generic.c.
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.
menu | - Pointer to SAppMenu structure |
Definition at line 221 of file ssd1306_menu.c.
uint8_t ssd1306_menuSelection | ( | SAppMenu * | menu | ) |
Returns currently selected menu item. First item has zero-index.
menu | - Pointer to SAppMenu structure |
Definition at line 216 of file ssd1306_menu.c.
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.
menu | - Pointer to SAppMenu structure |
Definition at line 233 of file ssd1306_menu.c.
Sets cursor position for text mode print functions.
Sets cursor position for text mode print functions.
x | xpos in pixels |
y | ypos in pixels |
Definition at line 68 of file ssd1306_generic.c.
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.
progmemFont | - font to setup located in Flash area |
Definition at line 220 of file ssd1306_generic.c.
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.
progmemFont | - font to setup located in Flash area |
Definition at line 1094 of file ssd1306_1bit.c.
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.
progmemFont | - font to setup located in Flash area |
Definition at line 305 of file ssd1306_generic.c.
void ssd1306_setPos | ( | uint8_t | x, |
uint8_t | y | ||
) |
Set position in terms of display.
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
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.
progmemUnicode | font containing unicode table (refer to ssd1306xled_font6x8_German as example). |
Definition at line 82 of file ssd1306_generic.c.
void ssd1306_showMenu | ( | SAppMenu * | menu | ) |
Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.
menu | - Pointer to SAppMenu structure |
Definition at line 126 of file ssd1306_menu.c.
void ssd1306_showMenu16 | ( | SAppMenu * | menu | ) |
Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.
menu | - Pointer to SAppMenu structure |
Definition at line 148 of file ssd1306_menu.c.
void ssd1306_showMenu8 | ( | SAppMenu * | menu | ) |
Shows menu items on the display. If menu items cannot fit the display, the function provides scrolling.
menu | - Pointer to SAppMenu structure |
Definition at line 137 of file ssd1306_menu.c.
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.
menu | - Pointer to SAppMenu structure |
Definition at line 159 of file ssd1306_menu.c.
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.
menu | - Pointer to SAppMenu structure |
Definition at line 197 of file ssd1306_menu.c.
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.
menu | - Pointer to SAppMenu structure |
Definition at line 178 of file ssd1306_menu.c.