SSD1306 OLED display driver  1.7.16
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
ssd1306_generic.h
Go to the documentation of this file.
1 /*
2  MIT License
3 
4  Copyright (c) 2016-2019, Alexey Dynda
5 
6  Permission is hereby granted, free of charge, to any person obtaining a copy
7  of this software and associated documentation files (the "Software"), to deal
8  in the Software without restriction, including without limitation the rights
9  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  copies of the Software, and to permit persons to whom the Software is
11  furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in all
14  copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  SOFTWARE.
23 */
29 #ifndef _SSD1306_GENERIC_H_
30 #define _SSD1306_GENERIC_H_
31 
32 #include "nano_gfx_types.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
39 // GENERIC GRAPH FUNCTIONS
41 
43 #define SSD1306_MORE_CHARS_REQUIRED 0xffff
44 
58 void ssd1306_setPos(uint8_t x, uint8_t y);
59 
67 void ssd1306_setCursor(lcdint_t x, lcdint_t y);
68 
75 void ssd1306_setFixedFont(const uint8_t * progmemFont);
76 
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78 void ssd1306_setFixedFont_oldStyle(const uint8_t * progmemFont);
79 #endif
80 
88 void ssd1306_setFreeFont(const uint8_t * progmemFont);
89 
97 void ssd1306_setSecondaryFont(const uint8_t * progmemUnicode);
98 
110 void ssd1306_setFont6x8(const uint8_t * progmemFont) __attribute__ ((deprecated));
111 
125 void ssd1306_getCharBitmap(uint16_t ch, SCharInfo *info);
126 
131 void ssd1306_enableUtf8Mode(void);
132 
136 void ssd1306_enableAsciiMode(void);
137 
138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
139 
145 void ssd1306_setSquixFont(const uint8_t * progmemFont);
146 
154 uint16_t ssd1306_unicode16FromUtf8(uint8_t ch);
155 #endif
156 
157 
159 // HIGH-LEVEL GRAPH FUNCTIONS
161 
165 typedef struct
166 {
168  const char **items;
170  uint8_t count;
172  uint8_t selection;
174  uint8_t oldSelection;
176  uint8_t scrollPosition;
177 } SAppMenu;
178 
188 void ssd1306_createMenu(SAppMenu *menu, const char **items, uint8_t count);
189 
198 void ssd1306_showMenu(SAppMenu *menu);
199 
208 void ssd1306_showMenu8(SAppMenu *menu);
209 
218 void ssd1306_showMenu16(SAppMenu *menu);
219 
220 #ifndef DOXYGEN_SHOULD_SKIP_THIS
221 static inline void ssd1331_showMenu8(SAppMenu *menu)
222 {
223  ssd1306_showMenu8(menu);
224 }
225 #endif
226 
233 void ssd1306_updateMenu(SAppMenu *menu);
234 
243 void ssd1306_updateMenu8(SAppMenu *menu);
244 
253 void ssd1306_updateMenu16(SAppMenu *menu);
254 
255 #ifndef DOXYGEN_SHOULD_SKIP_THIS
256 static inline void ssd1331_updateMenu8(SAppMenu *menu)
257 {
258  ssd1306_updateMenu8(menu);
259 }
260 #endif
261 
270 uint8_t ssd1306_menuSelection(SAppMenu *menu);
271 
279 void ssd1306_menuDown(SAppMenu *menu);
280 
288 void ssd1306_menuUp(SAppMenu *menu);
289 
294 #ifdef __cplusplus
295 }
296 #endif
297 
298 #endif // _SSD1306_GENERIC_H_
void ssd1306_setSecondaryFont(const uint8_t *progmemUnicode)
void ssd1306_createMenu(SAppMenu *menu, const char **items, uint8_t count)
Definition: ssd1306_menu.c:41
void ssd1306_updateMenu(SAppMenu *menu)
Definition: ssd1306_menu.c:138
void ssd1306_updateMenu16(SAppMenu *menu)
Definition: ssd1306_menu.c:176
void ssd1306_setFixedFont(const uint8_t *progmemFont)
void ssd1306_setFreeFont(const uint8_t *progmemFont)
void ssd1306_setFont6x8(const uint8_t *progmemFont) __attribute__((deprecated))
Definition: ssd1306_1bit.c:987
void ssd1306_enableAsciiMode(void)
uint8_t selection
currently selected item. Internally updated.
uint8_t scrollPosition
position of menu scrolling. Internally updated
uint8_t count
count of menu items in the menu
void ssd1306_setCursor(lcdint_t x, lcdint_t y)
Sets cursor position for text mode print functions.
void ssd1306_menuDown(SAppMenu *menu)
Definition: ssd1306_menu.c:200
void ssd1306_updateMenu8(SAppMenu *menu)
Definition: ssd1306_menu.c:157
void ssd1306_showMenu8(SAppMenu *menu)
Definition: ssd1306_menu.c:116
void ssd1306_getCharBitmap(uint16_t ch, SCharInfo *info)
returns char data for currently set (active) font.
uint8_t ssd1306_menuSelection(SAppMenu *menu)
Definition: ssd1306_menu.c:195
void ssd1306_showMenu(SAppMenu *menu)
Definition: ssd1306_menu.c:105
void ssd1306_menuUp(SAppMenu *menu)
Definition: ssd1306_menu.c:212
void ssd1306_enableUtf8Mode(void)
void ssd1306_setPos(uint8_t x, uint8_t y)
uint8_t oldSelection
selected item, when last redraw operation was performed. Internally updated.
const char ** items
list of menu items of the menu
void ssd1306_showMenu16(SAppMenu *menu)
Definition: ssd1306_menu.c:127