28 extern uint8_t s_ssd1306_invertByte;
33 void ssd1306_setRgbColor16(uint8_t r, uint8_t g, uint8_t b)
40 ssd1306_lcd.set_block(x, y, w);
46 ssd1306_intf.send( *data );
49 data += pitch - (w << 1);
56 ssd1306_drawBufferPitch16(x, y, w, h, w<<1, data);
61 ssd1306_drawBufferPitch16( x, y, w, h, pitch, data );
66 ssd1306_lcd.set_block(x, y, 0);
67 ssd1306_lcd.send_pixels16( color );
73 ssd1306_lcd.set_block(xpos, ypos, w);
74 uint32_t count = (w) * (h);
77 ssd1306_lcd.send_pixels16( (pgm_read_byte( &bitmap[0] ) << 8) | pgm_read_byte( &bitmap[1] ) );
83 void ssd1306_clearBlock16(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
85 ssd1306_lcd.set_block(x, y, w);
86 uint32_t count = w * h;
89 ssd1306_lcd.send_pixels16( 0x0000 );
100 void ssd1306_printChar16(uint8_t c)
102 uint16_t unicode = ssd1306_unicode16FromUtf8(c);
105 ssd1306_getCharBitmap(unicode, &char_info);
106 ssd1306_drawMonoBitmap16(ssd1306_cursorX,
113 size_t ssd1306_write16(uint8_t ch)
120 else if ( (ssd1306_cursorX > ssd1306_lcd.width - m_font->getHeader().width) || (ch ==
'\n') )
123 ssd1306_cursorY += m_font->getHeader().height;
124 if ( ssd1306_cursorY > ssd1306_lcd.height - m_font->getHeader().height )
128 ssd1306_clearBlock16(0, ssd1306_cursorY, ssd1306_lcd.width, m_font->getHeader().height);
134 uint16_t unicode = m_font->unicode16FromUtf8(ch);
137 m_font->getCharBitmap(unicode, &char_info);
138 ssd1306_drawMonoBitmap16( ssd1306_cursorX,
147 size_t ssd1306_print16(
const char ch[])
152 n += ssd1306_write16(*ch);
162 return ssd1306_print16(ch);
176 this->m_intf.startBlock(x, y, 0);
177 this->m_intf.send( this->m_color >> 8 );
178 this->m_intf.send( this->m_color & 0xFF );
179 this->m_intf.endBlock();
185 this->m_intf.startBlock(x1, y1, 0);
188 this->m_intf.send( this->m_color >> 8 );
189 this->m_intf.send( this->m_color & 0xFF );
192 this->m_intf.endBlock();
198 this->m_intf.startBlock(x1, y1, 1);
201 this->m_intf.send( this->m_color >> 8 );
202 this->m_intf.send( this->m_color & 0xFF );
205 this->m_intf.endBlock();
219 this->m_intf.startBlock(x1, y1, x2 - x1 + 1);
220 uint16_t count = (x2 - x1 + 1) * (y2 - y1 + 1);
223 this->m_intf.send( this->m_color >> 8 );
224 this->m_intf.send( this->m_color & 0xFF );
226 this->m_intf.endBlock();
232 this->m_intf.startBlock(0, 0, 0);
233 uint32_t count = (uint32_t)this->m_w * (uint32_t)this->m_h;
236 this->m_intf.send( color >> 8 );
237 this->m_intf.send( color & 0xFF );
239 this->m_intf.endBlock();
258 uint16_t blackColor = s_ssd1306_invertByte ? this->m_color : 0x0000;
259 uint16_t color = s_ssd1306_invertByte ? 0x0000 : this->m_color;
260 this->m_intf.startBlock(xpos, ypos, w);
266 uint8_t data = pgm_read_byte( bitmap );
269 this->m_intf.send( color >> 8 );
270 this->m_intf.send( color & 0xFF );
274 this->m_intf.send( blackColor >> 8 );
275 this->m_intf.send( blackColor & 0xFF );
289 this->m_intf.endBlock();
301 this->m_intf.startBlock(x, y, w);
302 uint32_t count = (w) * (h);
306 this->m_intf.send( color >> 8 );
307 this->m_intf.send( color & 0xFF );
310 this->m_intf.endBlock();
316 this->m_intf.startBlock(x, y, w);
317 uint32_t count = (w) * (h);
320 this->m_intf.send( pgm_read_byte( &bitmap[0] ) );
321 this->m_intf.send( pgm_read_byte( &bitmap[1] ) );
324 this->m_intf.endBlock();
331 uint16_t blackColor = s_ssd1306_invertByte ? this->m_color : 0x0000;
332 uint16_t color = s_ssd1306_invertByte ? 0x0000 : this->m_color;
333 this->m_intf.startBlock(xpos, ypos, w);
339 uint8_t data = *buffer;
342 this->m_intf.send( color >> 8 );
343 this->m_intf.send( color & 0xFF );
347 this->m_intf.send( blackColor >> 8 );
348 this->m_intf.send( blackColor & 0xFF );
362 this->m_intf.endBlock();
368 this->drawBuffer1( x, y, w, h, buf );
380 this->m_intf.startBlock(x, y, w);
381 uint32_t count = (w) * (h);
385 this->m_intf.send( color >> 8 );
386 this->m_intf.send( color & 0xFF );
389 this->m_intf.endBlock();
395 this->m_intf.startBlock(x, y, w);
396 uint32_t count = (w) * (h);
399 this->m_intf.send( buffer[0] );
400 this->m_intf.send( buffer[1] );
403 this->m_intf.endBlock();
409 uint16_t unicode = this->m_font->unicode16FromUtf8(c);
412 this->m_font->getCharBitmap(unicode, &char_info);
413 uint8_t mode = this->m_textMode;
414 for (uint8_t i = 0; i<(this->m_fontStyle == STYLE_BOLD ? 2: 1); i++)
416 this->drawBitmap1(this->m_cursorX + i,
423 this->m_textMode = mode;
426 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width) ) )
428 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width)) ) )
430 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
432 if ( (this->m_textMode & CANVAS_TEXT_WRAP_LOCAL) &&
433 (this->m_cursorY > ((
lcdint_t)this->m_h - (
lcdint_t)this->m_font->getHeader().height)) )
446 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
455 return printChar( c );
465 this->m_cursorX = xpos;
uint8_t printChar(uint8_t c)
uint8_t height
char height in pixels
#define RGB_COLOR16(r, g, b)
void drawVLine(lcdint_t x1, lcdint_t y1, lcdint_t y2)
void drawHLine(lcdint_t x1, lcdint_t y1, lcdint_t x2)
size_t write(uint8_t c) __attribute__((noinline))
#define SSD1306_MORE_CHARS_REQUIRED
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. 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)
uint8_t width
char width in pixels
const uint8_t * glyph
char data, located in progmem.
void fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
void drawBuffer16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
void drawBuffer8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
void drawBuffer1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
void printFixed(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
void putPixel(lcdint_t x, lcdint_t y) __attribute__((noinline))
uint8_t spacing
additional spaces after char in pixels
void drawXBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
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...
void drawBuffer4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
void drawBitmap16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
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. Draws 4-bit gray-color bitmap in color buffer...
#define ssd1306_swap_data(a, b, type)
void fill(uint16_t color)