SSD1306 OLED display driver  1.8.2
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
ssd1306_1bit.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_1BIT_H_
30 #define _SSD1306_1BIT_H_
31 
32 #include "nano_gfx_types.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
39 // DIRECT GRAPH FUNCTIONS
41 
58 void ssd1306_fillScreen(uint8_t fill_Data);
59 
63 void ssd1306_clearScreen(void);
64 
69 void ssd1306_negativeMode(void);
70 
75 void ssd1306_positiveMode(void);
76 
91 uint8_t ssd1306_printFixed(uint8_t xpos, uint8_t y, const char *ch, EFontStyle style);
92 
93 #ifndef DOXYGEN_SHOULD_SKIP_THIS
94 uint8_t ssd1306_printFixed_oldStyle(uint8_t xpos, uint8_t y, const char *ch, EFontStyle style);
95 #endif
96 
112 uint8_t ssd1306_printFixed2x(uint8_t xpos, uint8_t y, const char ch[], EFontStyle style) __attribute__ ((deprecated));
113 
133 uint8_t ssd1306_printFixedN(uint8_t xpos, uint8_t y, const char ch[], EFontStyle style, uint8_t factor);
134 
142 size_t ssd1306_write(uint8_t ch);
143 
151 size_t ssd1306_print(const char ch[]);
152 
162 uint8_t ssd1306_charF6x8(uint8_t x, uint8_t y,
163  const char ch[],
164  EFontStyle style
165 #ifdef __cplusplus
166  = STYLE_NORMAL
167 #endif
168  ) __attribute__ ((deprecated));
169 
179 uint8_t ssd1306_charF12x16(uint8_t xpos,
180  uint8_t y,
181  const char ch[],
182  EFontStyle style) __attribute__ ((deprecated));
183 
184 
198 uint8_t ssd1306_charF6x8_eol(uint8_t left,
199  uint8_t y,
200  const char ch[],
201  EFontStyle style,
202  uint8_t right) __attribute__ ((deprecated));
203 
216 void ssd1306_putPixel(uint8_t x, uint8_t y);
217 
232 void ssd1306_putPixels(uint8_t x, uint8_t y, uint8_t pixels);
233 
241 void ssd1306_drawRect(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2);
242 
255 void ssd1306_fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2);
256 
269 void ssd1306_drawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2);
270 
277 void ssd1306_drawHLine(uint8_t x1, uint8_t y1, uint8_t x2);
278 
285 void ssd1306_drawVLine(uint8_t x1, uint8_t y1, uint8_t y2);
286 
303 void ssd1306_drawBuffer(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf);
304 
315 void ssd1306_drawBuffer1_4(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf);
316 
317 
336 void ssd1306_drawBufferFast(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf);
337 
341 #define ssd1306_drawCanvas(x, y, w, h, buf) ssd1306_drawBuffer(x, y, w, h, buf)
342 
353 void ssd1306_drawBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf);
354 
365 void ssd1306_drawXBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf);
366 
381 void ssd1306_drawBitmap1_4(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf);
382 
392 void gfx_drawMonoBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf);
393 
402 void ssd1306_clearBlock(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
403 
411 void ssd1306_drawSpriteEx(uint8_t x, uint8_t y, uint8_t w, const uint8_t *sprite);
412 
418 void ssd1306_drawSprite(SPRITE *sprite);
419 
424 void ssd1306_eraseSprite(SPRITE *sprite);
425 
430 void ssd1306_eraseTrace(SPRITE *sprite);
431 
440 SPRITE ssd1306_createSprite(uint8_t x, uint8_t y, uint8_t w, const uint8_t *data);
441 
448 void ssd1306_replaceSprite(SPRITE *sprite, const uint8_t *data);
449 
454 #ifdef __cplusplus
455 }
456 #endif
457 
458 #endif // _SSD1306_1BIT_H_
void ssd1306_drawBuffer(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:738
void ssd1306_drawBitmap1_4(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:804
uint8_t ssd1306_charF6x8(uint8_t x, uint8_t y, const char ch[], EFontStyle style=STYLE_NORMAL) __attribute__((deprecated))
Definition: ssd1306_1bit.c:469
void ssd1306_putPixels(uint8_t x, uint8_t y, uint8_t pixels)
Definition: ssd1306_1bit.c:612
void ssd1306_positiveMode(void)
SPRITE ssd1306_createSprite(uint8_t x, uint8_t y, uint8_t w, const uint8_t *data)
uint8_t ssd1306_printFixed2x(uint8_t xpos, uint8_t y, const char ch[], EFontStyle style) __attribute__((deprecated))
Definition: ssd1306_1bit.c:236
void ssd1306_drawXBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:837
void ssd1306_drawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2)
Definition: ssd1306_1bit.c:639
uint8_t ssd1306_printFixed(uint8_t xpos, uint8_t y, const char *ch, EFontStyle style)
Definition: ssd1306_1bit.c:79
void ssd1306_drawSprite(SPRITE *sprite)
Definition: ssd1306_1bit.c:989
void ssd1306_drawRect(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2)
Definition: ssd1306_1bit.c:717
void ssd1306_fillScreen(uint8_t fill_Data)
Definition: ssd1306_1bit.c:50
void ssd1306_eraseTrace(SPRITE *sprite)
void ssd1306_drawBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:786
void gfx_drawMonoBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:870
size_t ssd1306_print(const char ch[])
Prints null-terminated string to display at current cursor position.
Definition: ssd1306_1bit.c:458
uint8_t ssd1306_charF12x16(uint8_t xpos, uint8_t y, const char ch[], EFontStyle style) __attribute__((deprecated))
Definition: ssd1306_1bit.c:515
void ssd1306_eraseSprite(SPRITE *sprite)
void ssd1306_drawVLine(uint8_t x1, uint8_t y1, uint8_t y2)
Definition: ssd1306_1bit.c:693
void ssd1306_fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
Definition: ssd1306_1bit.c:942
void ssd1306_drawSpriteEx(uint8_t x, uint8_t y, uint8_t w, const uint8_t *sprite)
Definition: ssd1306_1bit.c:977
uint8_t ssd1306_printFixedN(uint8_t xpos, uint8_t y, const char ch[], EFontStyle style, uint8_t factor)
Definition: ssd1306_1bit.c:317
void ssd1306_drawHLine(uint8_t x1, uint8_t y1, uint8_t x2)
Definition: ssd1306_1bit.c:683
void ssd1306_clearBlock(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
Definition: ssd1306_1bit.c:927
uint8_t ssd1306_charF6x8_eol(uint8_t left, uint8_t y, const char ch[], EFontStyle style, uint8_t right) __attribute__((deprecated))
Definition: ssd1306_1bit.c:590
void ssd1306_clearScreen(void)
Definition: ssd1306_1bit.c:65
void ssd1306_replaceSprite(SPRITE *sprite, const uint8_t *data)
EFontStyle
void ssd1306_drawBufferFast(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:725
void ssd1306_negativeMode(void)
void ssd1306_putPixel(uint8_t x, uint8_t y)
Definition: ssd1306_1bit.c:605
void ssd1306_drawBuffer1_4(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf)
Definition: ssd1306_1bit.c:753
size_t ssd1306_write(uint8_t ch)
Prints single character to display at current cursor position.
Definition: ssd1306_1bit.c:418