28 void ssd1306_setRgbColor(uint8_t r, uint8_t g, uint8_t b)
33 void ssd1306_setRgbColor8(uint8_t r, uint8_t g, uint8_t b)
40 ssd1306_lcd.set_block(x, y, w);
46 ssd1306_lcd.send_pixels8( *data );
56 ssd1306_drawBufferPitch8( x, y, w, h, w, data );
61 ssd1306_drawBufferPitch8( x, y, w, h, pitch, data );
66 ssd1306_lcd.set_block(x, y, 0);
67 ssd1306_lcd.send_pixels8( color );
98 this->m_intf.startBlock(x, y, 0);
99 this->m_intf.send(this->m_color);
100 this->m_intf.endBlock();
105 this->m_intf.startBlock(x1, y1, 0);
108 this->m_intf.send(this->m_color);
111 this->m_intf.endBlock();
116 this->m_intf.startBlock(x1, y1, 1);
119 this->m_intf.send(this->m_color);
122 this->m_intf.endBlock();
135 this->m_intf.startBlock(x1, y1, x2 - x1 + 1);
136 uint32_t count = (x2 - x1 + 1) * (y2 - y1 + 1);
139 this->m_intf.send(this->m_color);
141 this->m_intf.endBlock();
146 this->m_intf.startBlock(0, 0, 0);
147 uint32_t count = (uint32_t)this->m_w * (uint32_t)this->m_h;
150 this->m_intf.send(color);
152 this->m_intf.endBlock();
170 uint8_t blackColor = this->m_bgColor;
171 uint8_t color = this->m_color;
172 this->m_intf.startBlock(xpos, ypos, w);
178 uint8_t data = pgm_read_byte(bitmap);
180 this->m_intf.send(color);
182 this->m_intf.send(blackColor);
195 this->m_intf.endBlock();
207 this->m_intf.startBlock(x, y, w);
208 uint32_t count = (w) * (h);
211 this->m_intf.send(pgm_read_byte(bitmap));
214 this->m_intf.endBlock();
227 uint8_t blackColor = this->m_bgColor;
228 uint8_t color = this->m_color;
229 this->m_intf.startBlock(xpos, ypos, w);
235 uint8_t data = *buffer;
237 this->m_intf.send(color);
239 this->m_intf.send(blackColor);
252 this->m_intf.endBlock();
258 this->drawBuffer1(x, y, w, h, buf);
270 this->m_intf.startBlock(x, y, w);
271 uint32_t count = (w) * (h);
274 this->m_intf.send(*buffer);
277 this->m_intf.endBlock();
288 uint16_t unicode = this->m_font->unicode16FromUtf8(c);
292 this->m_font->getCharBitmap(unicode, &char_info);
293 uint8_t mode = this->m_textMode;
294 for ( uint8_t i = 0; i < (this->m_fontStyle == STYLE_BOLD ? 2 : 1); i++ )
296 this->drawBitmap1(this->m_cursorX + i, this->m_cursorY, char_info.
width, char_info.
height, char_info.
glyph);
299 this->m_textMode = mode;
302 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width))) ||
304 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width))) )
306 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
308 if ( (this->m_textMode & CANVAS_TEXT_WRAP_LOCAL) &&
309 (this->m_cursorY > ((
lcdint_t)this->m_h - (
lcdint_t)this->m_font->getHeader().height)) )
321 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
324 else if ( c ==
'\r' )
339 this->m_cursorX = xpos;
void drawBuffer4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
Draws 4-bit bitmap, located in RAM, on the display Each byte represents two pixels in 4-4 format: ref...
uint8_t height
char height in pixels
uint8_t lcduint_t
internal int type, used by the library.
void 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.
Structure describes single char information.
If the flag is specified, text cursor is moved to new line when end of canvas is reached.
This flag make bitmaps transparent (Black color)
int8_t lcdint_t
internal int type, used by the library.
SSD1306 HAL IO communication functions.
#define SSD1306_MORE_CHARS_REQUIRED
Flag means that more chars are required to decode utf-8.
void fill(uint16_t color)
Fill screen content with specified color.
void drawBitmap8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
Draws 8-bit color bitmap in color buffer.
void drawBuffer1Fast(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
Implements the same behavior as drawBuffer1, but much faster.
uint8_t printChar(uint8_t c)
Draws single character to canvas.
void printFixed(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
Print text at specified position to canvas.
void drawHLine(lcdint_t x1, lcdint_t y1, lcdint_t x2)
Draws horizontal or vertical line.
void fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
Fills rectangle area.
size_t write(uint8_t c) __attribute__((noinline))
Writes single character to canvas.
void putPixel(lcdint_t x, lcdint_t y) __attribute__((noinline))
Draws pixel on specified position.
void drawVLine(lcdint_t x1, lcdint_t y1, lcdint_t y2)
Draws horizontal or vertical line.
void drawBitmap4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
Draws 4-bit gray-color bitmap in color buffer.
If the flag is specified, text cursor is moved to new line when end of screen is reached.
uint8_t width
char width in pixels
const uint8_t * glyph
char data, located in progmem.
void drawXBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
Draws bitmap, located in Flash, on the display The bitmap should be in XBMP format.
#define RGB_COLOR8(r, g, b)
Macro to generate 8-bit color.
void clear()
Clears canvas.
void drawBitmap1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
Draws monochrome bitmap in color buffer using color, specified via setColor() method Draws monochrome...
uint8_t spacing
additional spaces after char in pixels
EFontStyle
Supported font styles.
void drawBuffer8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
Draws 8-bit bitmap, located in RAM, on the display Each byte represents one pixel in 2-2-3 format: re...
void drawBuffer1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
Draws bitmap, located in RAM, on the display Each byte represents 8 vertical pixels.
#define ssd1306_swap_data(a, b, type)
swaps content of a and b variables of type type
void drawBuffer16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
Draws 16-bit bitmap, located in RAM, on the display Each pixel occupies 2 bytes (5-6-5 format): refer...