LCDGFX LCD display driver  1.0.2
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
ssd1306_1bit.inl
1 /*
2  MIT License
3 
4  Copyright (c) 2016-2020, 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 */
24 
28 
29 #include "lcd_hal/io.h"
30 
32 //
33 // 1-BIT GRAPHICS
34 //
36 
37 template <class I>
38 void NanoDisplayOps1<I>::printFixed(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style)
39 {
40  uint8_t i, j=0;
41  uint8_t text_index = 0;
42  uint8_t page_offset = 0;
43  uint8_t x = xpos;
44  y >>= 3;
45  this->m_intf.startBlock(xpos, y, this->m_w - xpos);
46  for(;;)
47  {
48  uint8_t ldata;
49  if ( (x > this->m_w - this->m_font->getHeader().width) || (ch[j] == '\0') )
50  {
51  x = xpos;
52  y++;
53  if (y >= (lcdint_t)( this->m_h >> 3))
54  {
55  break;
56  }
57  page_offset++;
58  if (page_offset == this->m_font->getPages())
59  {
60  text_index = j;
61  page_offset = 0;
62  if (ch[j] == '\0')
63  {
64  break;
65  }
66  }
67  else
68  {
69  j = text_index;
70  }
71  this->m_intf.endBlock();
72  this->m_intf.startBlock(xpos, y, this->m_w - xpos);
73  }
74  uint16_t unicode;
75  do
76  {
77  unicode = this->m_font->unicode16FromUtf8(ch[j]);
78  j++;
79  } while ( unicode == SSD1306_MORE_CHARS_REQUIRED );
80  SCharInfo char_info;
81  this->m_font->getCharBitmap(unicode, &char_info);
82  ldata = 0;
83  x += char_info.width + char_info.spacing;
84  if (char_info.height > page_offset * 8)
85  {
86  char_info.glyph += page_offset * char_info.width;
87  for( i = char_info.width; i>0; i--)
88  {
89  uint8_t data;
90  if ( style == STYLE_NORMAL )
91  {
92  data = pgm_read_byte(&char_info.glyph[0]);
93  }
94  else if ( style == STYLE_BOLD )
95  {
96  uint8_t temp = pgm_read_byte(&char_info.glyph[0]);
97  data = temp | ldata;
98  ldata = temp;
99  }
100  else
101  {
102  uint8_t temp = pgm_read_byte(&char_info.glyph[1]);
103  data = (temp & 0xF0) | ldata;
104  ldata = (temp & 0x0F);
105  }
106  this->m_intf.send(data^s_ssd1306_invertByte);
107  char_info.glyph++;
108  }
109  }
110  else
111  {
112  char_info.spacing += char_info.width;
113  }
114  for (i = 0; i < char_info.spacing; i++)
115  this->m_intf.send(s_ssd1306_invertByte);
116  }
117  this->m_intf.endBlock();
118 }
119 
120 template <class I>
122 {
123  uint16_t unicode = this->m_font->unicode16FromUtf8(c);
124  if (unicode == SSD1306_MORE_CHARS_REQUIRED) return 0;
125  SCharInfo char_info;
126  this->m_font->getCharBitmap(unicode, &char_info);
127  uint8_t mode = this->m_textMode;
128  for (uint8_t i = 0; i<(this->m_fontStyle == STYLE_BOLD ? 2: 1); i++)
129  {
130  this->drawBitmap1(this->m_cursorX + i,
131  this->m_cursorY,
132  char_info.width,
133  char_info.height,
134  char_info.glyph );
135  this->m_textMode |= CANVAS_MODE_TRANSPARENT;
136  }
137  this->m_textMode = mode;
138  this->m_cursorX += (lcdint_t)(char_info.width + char_info.spacing);
139  if ( ( (this->m_textMode & CANVAS_TEXT_WRAP_LOCAL) &&
140  (this->m_cursorX > ((lcdint_t)this->m_w - (lcdint_t)this->m_font->getHeader().width) ) )
141  || ( (this->m_textMode & CANVAS_TEXT_WRAP) &&
142  (this->m_cursorX > ((lcdint_t)this->m_w - (lcdint_t)this->m_font->getHeader().width)) ) )
143  {
144  this->m_cursorY += (lcdint_t)this->m_font->getHeader().height;
145  this->m_cursorX = 0;
146  if ( (this->m_textMode & CANVAS_TEXT_WRAP_LOCAL) &&
147  (this->m_cursorY > ((lcdint_t)this->m_h - (lcdint_t)this->m_font->getHeader().height)) )
148  {
149  this->m_cursorY = 0;
150  }
151  }
152  return 1;
153 }
154 
155 template <class I>
156 size_t NanoDisplayOps1<I>::write(uint8_t c)
157 {
158  if (c == '\n')
159  {
160  this->m_cursorY += (lcdint_t)this->m_font->getHeader().height;
161  this->m_cursorX = 0;
162  }
163  else if (c == '\r')
164  {
165  // skip non-printed char
166  }
167  else
168  {
169  return printChar( c );
170  }
171  return 1;
172 }
173 
174 #ifndef DOXYGEN_SHOULD_SKIP_THIS
175 template <class I>
176 void NanoDisplayOps1<I>::printFixed_oldStyle(uint8_t xpos, uint8_t y, const char *ch, EFontStyle style)
177 {
178  uint8_t i, j=0;
179  uint8_t text_index = 0;
180  uint8_t page_offset = 0;
181  uint8_t x = xpos;
182  y >>= 3;
183  this->m_intf.startBlock(xpos, y, this->m_w - xpos);
184  for(;;)
185  {
186  uint8_t c;
187  uint8_t ldata;
188  uint16_t offset;
189  if( (x > this->m_w - this->m_font->getHeader().width) || (ch[j] == '\0') )
190  {
191  x = xpos;
192  y++;
193  if (y >= (this->m_h >> 3))
194  {
195  break;
196  }
197  page_offset++;
198  if (page_offset == this->m_font->getPages())
199  {
200  text_index = j;
201  page_offset = 0;
202  if (ch[j] == '\0')
203  {
204  break;
205  }
206  }
207  else
208  {
209  j = text_index;
210  }
211  this->m_intf.endBlock();
212  this->m_intf.startBlock(xpos, y, this->m_w - xpos);
213  }
214  c = ch[j];
215  if ( c >= this->m_font->getHeader().ascii_offset )
216  {
217  c -= this->m_font->getHeader().ascii_offset;
218  }
219  ldata = 0;
220  offset = (c * this->m_font->getPages() + page_offset) * this->m_font->getHeader().width;
221  for( i=this->m_font->getHeader().width; i>0; i--)
222  {
223  uint8_t data;
224  if ( style == STYLE_NORMAL )
225  {
226  data = pgm_read_byte(&this->m_font->getPrimaryTable()[offset]);
227  }
228  else if ( style == STYLE_BOLD )
229  {
230  uint8_t temp = pgm_read_byte(&this->m_font->getPrimaryTable()[offset]);
231  data = temp | ldata;
232  ldata = temp;
233  }
234  else
235  {
236  uint8_t temp = pgm_read_byte(&this->m_font->getPrimaryTable()[offset + 1]);
237  data = (temp & 0xF0) | ldata;
238  ldata = (temp & 0x0F);
239  }
240  this->m_intf.send(data^s_ssd1306_invertByte);
241  offset++;
242  }
243  x += this->m_font->getHeader().width;
244  j++;
245  }
246  this->m_intf.endBlock();
247 }
248 #endif
249 
250 template <class I>
251 void NanoDisplayOps1<I>::printFixedN(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style, uint8_t factor)
252 {
253  uint8_t i, j=0;
254  uint8_t text_index = 0;
255  uint8_t page_offset = 0;
256  uint8_t x = xpos;
257  y >>= 3;
258  this->m_intf.startBlock(xpos, y, this->m_w - xpos);
259  for(;;)
260  {
261  uint8_t ldata;
262  if( (x > this->m_w - (this->m_font->getHeader().width << factor)) || (ch[j] == '\0') )
263  {
264  x = xpos;
265  y++;
266  if (y >= (this->m_h >> 3))
267  {
268  break;
269  }
270  page_offset++;
271  if (page_offset == (this->m_font->getPages() << factor))
272  {
273  text_index = j;
274  page_offset = 0;
275  if (ch[j] == '\0')
276  {
277  break;
278  }
279  }
280  else
281  {
282  j = text_index;
283  }
284  this->m_intf.endBlock();
285  this->m_intf.startBlock(xpos, y, this->m_w - xpos);
286  }
287  uint16_t unicode;
288  do
289  {
290  unicode = this->m_font->unicode16FromUtf8(ch[j]);
291  j++;
292  } while ( unicode == SSD1306_MORE_CHARS_REQUIRED );
293  SCharInfo char_info;
294  this->m_font->getCharBitmap(unicode, &char_info);
295  ldata = 0;
296  x += ((char_info.width + char_info.spacing) << factor);
297  if (char_info.height > (page_offset >> factor) * 8)
298  {
299  char_info.glyph += (page_offset >> factor) * char_info.width;
300  for( i=char_info.width; i>0; i--)
301  {
302  uint8_t data;
303  if ( style == STYLE_NORMAL )
304  {
305  data = pgm_read_byte(char_info.glyph);
306  }
307  else if ( style == STYLE_BOLD )
308  {
309  uint8_t temp = pgm_read_byte(char_info.glyph);
310  data = temp | ldata;
311  ldata = temp;
312  }
313  else
314  {
315  uint8_t temp = pgm_read_byte(char_info.glyph+1);
316  data = (temp & 0xF0) | ldata;
317  ldata = (temp & 0x0F);
318  }
319  if ( factor > 0 )
320  {
321  uint8_t accum = 0;
322  uint8_t mask = ~((0xFF) << (1<<factor));
323  // N=0 -> right shift is always 0
324  // N=1 -> right shift goes through 0, 4
325  // N=2 -> right shift goes through 0, 2, 4, 6
326  // N=3 -> right shift goes through 0, 1, 2, 3, 4, 5, 6, 7
327  data >>= ((page_offset & ((1<<factor) - 1))<<(3-factor));
328  for (uint8_t idx = 0; idx < 1<<(3-factor); idx++)
329  {
330  accum |= (((data>>idx) & 0x01) ? (mask<<(idx<<factor)) : 0);
331  }
332  data = accum;
333  }
334  for (uint8_t z=(1<<factor); z>0; z--)
335  {
336  this->m_intf.send(data^s_ssd1306_invertByte);
337  }
338  char_info.glyph++;
339  }
340  }
341  else
342  {
343  char_info.spacing += char_info.width;
344  }
345  for (i = 0; i < (char_info.spacing << factor); i++)
346  this->m_intf.send(s_ssd1306_invertByte);
347  }
348  this->m_intf.stop();
349 }
350 
351 template <class I>
353 {
354  this->m_intf.startBlock(x, y >> 3, 1);
355  this->m_intf.send((1 << (y & 0x07))^s_ssd1306_invertByte);
356  this->m_intf.endBlock();
357 }
358 
359 template <class I>
361 {
362  this->m_intf.startBlock(x1, y1 >> 3, x2 - x1 + 1);
363  for (uint8_t x = x1; x <= x2; x++)
364  {
365  this->m_intf.send((1 << (y1 & 0x07))^s_ssd1306_invertByte);
366  }
367  this->m_intf.endBlock();
368 }
369 
370 template <class I>
372 {
373  uint8_t topPage = y1 >> 3;
374  uint8_t bottomPage = y2 >> 3;
375  uint8_t height = y2-y1;
376  uint8_t y;
377  this->m_intf.startBlock(x1, topPage, 1);
378  if (topPage == bottomPage)
379  {
380  this->m_intf.send( ((0xFF >> (0x07 - height)) << (y1 & 0x07))^s_ssd1306_invertByte );
381  this->m_intf.endBlock();
382  return;
383  }
384  this->m_intf.send( (0xFF << (y1 & 0x07))^s_ssd1306_invertByte );
385  for ( y = (topPage + 1); y <= (bottomPage - 1); y++)
386  {
387  this->m_intf.nextBlock();
388  this->m_intf.send( 0xFF^s_ssd1306_invertByte );
389  }
390  this->m_intf.nextBlock();
391  this->m_intf.send( (0xFF >> (0x07 - (y2 & 0x07)))^s_ssd1306_invertByte );
392  this->m_intf.endBlock();
393 }
394 
395 template <class I>
397 {
398  uint8_t templ = this->m_color^s_ssd1306_invertByte;
399  if (x1 > x2) return;
400  if (y1 > y2) return;
401  if ((lcduint_t)x2 >= this->m_w) x2 = (lcdint_t)this->m_w -1;
402  if ((lcduint_t)y2 >= this->m_h) y2 = (lcdint_t)this->m_h -1;
403  uint8_t bank1 = (y1 >> 3);
404  uint8_t bank2 = (y2 >> 3);
405  this->m_intf.startBlock(x1, bank1, x2 - x1 + 1);
406  for (uint8_t bank = bank1; bank<=bank2; bank++)
407  {
408  uint8_t mask = 0xFF;
409  if (bank1 == bank2)
410  {
411  mask = (mask >> ((y1 & 7) + 7 - (y2 & 7))) << (y1 & 7);
412  }
413  else if (bank1 == bank)
414  {
415  mask = (mask << (y1 & 7));
416  }
417  else if (bank2 == bank)
418  {
419  mask = (mask >> (7 - (y2 & 7)));
420  }
421  for (uint8_t x=x1; x<=x2; x++)
422  {
423 // m_bytes[BADDR(bank) + x] &= ~mask;
424 // m_bytes[BADDR(bank) + x] |= (templ & mask);
425  this->m_intf.send(templ & mask);
426  }
427  this->m_intf.nextBlock();
428  }
429  this->m_intf.endBlock();
430 }
431 
432 template <class I>
434 {
435  this->fill(0);
436 /* this->m_intf.startBlock(0, 0, 0);
437  for(uint8_t m=(this->m_h >> 3); m>0; m--)
438  {
439  for(uint8_t n=this->m_w; n>0; n--)
440  {
441  this->m_intf.send( s_ssd1306_invertByte );
442  }
443  this->m_intf.nextBlock();
444  }
445  this->m_intf.endBlock(); */
446 }
447 
448 template <class I>
449 void NanoDisplayOps1<I>::drawXBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
450 {
451  uint8_t i, j;
452  lcduint_t pitch = (w + 7) >> 3;
453  this->m_intf.startBlock(x, y, w);
454  for(j=(h >> 3); j>0; j--)
455  {
456  uint8_t bit = 0;
457  for(i=w;i>0;i--)
458  {
459  uint8_t data = 0;
460  for (uint8_t k = 0; k<8; k++)
461  {
462  data |= ( ((pgm_read_byte(&bitmap[k*pitch]) >> bit) & 0x01) << k );
463  }
464  this->m_intf.send( s_ssd1306_invertByte^data );
465  bit++;
466  if (bit >= 8)
467  {
468  bitmap++;
469  bit=0;
470  }
471  }
472  if (bit)
473  {
474  bitmap++;
475  }
476  bitmap += pitch * 7;
477  this->m_intf.nextBlock();
478  }
479  this->m_intf.endBlock();
480 }
481 
482 template <class I>
483 void NanoDisplayOps1<I>::drawBitmap1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
484 {
485  lcduint_t origin_width = w;
486  uint8_t offset = y & 0x07;
487  uint8_t complexFlag = 0;
488  uint8_t mainFlag = 1;
489  uint8_t max_pages;
490  uint8_t pages;
491  lcduint_t i, j;
492  if (y + (lcdint_t)h <= 0) return;
493  if (y >= (lcdint_t)this->m_h) return;
494  if (x + (lcdint_t)w <= 0) return;
495  if (x >= (lcdint_t)this->m_w) return;
496  if (y < 0)
497  {
498  bitmap += ((lcduint_t)((-y) + 7) >> 3) * w;
499  h += y;
500  y = 0;
501  complexFlag = 1;
502  }
503  if (x < 0)
504  {
505  bitmap += -x;
506  w += x;
507  x = 0;
508  }
509  max_pages = (lcduint_t)(h + 15 - offset) >> 3;
510  if ((lcduint_t)((lcduint_t)y + h) > (lcduint_t)this->m_h)
511  {
512  h = (lcduint_t)(this->m_h - (lcduint_t)y);
513  }
514  if ((lcduint_t)((lcduint_t)x + w) > (lcduint_t)this->m_w)
515  {
516  w = (lcduint_t)(this->m_w - (lcduint_t)x);
517  }
518  pages = ((y + h - 1) >> 3) - (y >> 3) + 1;
519 
520  uint8_t color = this->m_color ? 0xFF: 0x00;
521  this->m_intf.startBlock(x, y >> 3, w);
522  for(j=0; j < pages; j++)
523  {
524  if ( j == (lcduint_t)(max_pages - 1) ) mainFlag = !offset;
525  for( i=w; i > 0; i--)
526  {
527  uint8_t data = 0;
528  if ( mainFlag ) data |= ((pgm_read_byte(bitmap) << offset) & color);
529  if ( complexFlag ) data |= ((pgm_read_byte(bitmap - origin_width) >> (8 - offset)) & color);
530  bitmap++;
531  this->m_intf.send(s_ssd1306_invertByte^data);
532  }
533  bitmap += origin_width - w;
534  complexFlag = offset;
535  this->m_intf.nextBlock();
536  }
537  this->m_intf.endBlock();
538 }
539 
540 template <class I>
542 {
543  lcduint_t origin_width = w;
544  uint8_t offset = y & 0x07;
545  uint8_t complexFlag = 0;
546  uint8_t mainFlag = 1;
547  uint8_t max_pages;
548  uint8_t pages;
549  lcduint_t i, j;
550  if (y + (lcdint_t)h <= 0) return;
551  if (y >= (lcdint_t)this->m_h) return;
552  if (x + (lcdint_t)w <= 0) return;
553  if (x >= (lcdint_t)this->m_w) return;
554  if (y < 0)
555  {
556  buf += ((lcduint_t)((-y) + 7) >> 3) * w;
557  h += y;
558  y = 0;
559  complexFlag = 1;
560  }
561  if (x < 0)
562  {
563  buf += -x;
564  w += x;
565  x = 0;
566  }
567  max_pages = (lcduint_t)(h + 15 - offset) >> 3;
568  if ((lcduint_t)((lcduint_t)y + h) > (lcduint_t)this->m_h)
569  {
570  h = (lcduint_t)(this->m_h - (lcduint_t)y);
571  }
572  if ((lcduint_t)((lcduint_t)x + w) > (lcduint_t)this->m_w)
573  {
574  w = (lcduint_t)(this->m_w - (lcduint_t)x);
575  }
576  pages = ((y + h - 1) >> 3) - (y >> 3) + 1;
577 
578  uint8_t color = this->m_color ? 0xFF: 0x00;
579  this->m_intf.startBlock(x, y >> 3, w);
580  for(j=0; j < pages; j++)
581  {
582  if ( j == (lcduint_t)(max_pages - 1) ) mainFlag = !offset;
583  for( i=w; i > 0; i--)
584  {
585  uint8_t data = 0;
586  if ( mainFlag ) data |= ((pgm_read_byte(buf) << offset) & color);
587  if ( complexFlag ) data |= ((pgm_read_byte(buf - origin_width) >> (8 - offset)) & color);
588  buf++;
589  this->m_intf.send(s_ssd1306_invertByte^data);
590  }
591  buf += origin_width - w;
592  complexFlag = offset;
593  this->m_intf.nextBlock();
594  }
595  this->m_intf.endBlock();
596 }
597 
598 template <class I>
599 void NanoDisplayOps1<I>::drawBitmap4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
600 {
601  // NOT IMPLEMENTED
602 }
603 
604 template <class I>
605 void NanoDisplayOps1<I>::drawBitmap8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
606 {
607  // NOT IMPLEMENTED
608 }
609 
610 template <class I>
612 {
613  // NOT IMPLEMENTED
614 }
615 
616 template <class I>
617 void NanoDisplayOps1<I>::drawBuffer1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
618 {
619  lcduint_t origin_width = w;
620  uint8_t offset = y & 0x07;
621  uint8_t complexFlag = 0;
622  uint8_t mainFlag = 1;
623  uint8_t max_pages;
624  uint8_t pages;
625  lcduint_t i, j;
626  if (y + (lcdint_t)h <= 0) return;
627  if (y >= (lcdint_t)this->m_h) return;
628  if (x + (lcdint_t)w <= 0) return;
629  if (x >= (lcdint_t)this->m_w) return;
630  if (y < 0)
631  {
632  buffer += ((lcduint_t)((-y) + 7) >> 3) * w;
633  h += y;
634  y = 0;
635  complexFlag = 1;
636  }
637  if (x < 0)
638  {
639  buffer += -x;
640  w += x;
641  x = 0;
642  }
643  max_pages = (lcduint_t)(h + 15 - offset) >> 3;
644  if ((lcduint_t)((lcduint_t)y + h) > (lcduint_t)this->m_h)
645  {
646  h = (lcduint_t)(this->m_h - (lcduint_t)y);
647  }
648  if ((lcduint_t)((lcduint_t)x + w) > (lcduint_t)this->m_w)
649  {
650  w = (lcduint_t)(this->m_w - (lcduint_t)x);
651  }
652  pages = ((y + h - 1) >> 3) - (y >> 3) + 1;
653 
654  this->m_intf.startBlock(x, y >> 3, w);
655  for(j=0; j < pages; j++)
656  {
657  if ( j == (lcduint_t)(max_pages - 1) ) mainFlag = !offset;
658  for( i=w; i > 0; i--)
659  {
660  uint8_t data = 0;
661  if ( mainFlag ) data |= ((*buffer << offset) & this->m_color);
662  if ( complexFlag ) data |= ((*(buffer - origin_width) >> (8 - offset)) & this->m_color);
663  buffer++;
664  this->m_intf.send(s_ssd1306_invertByte^data);
665  }
666  buffer += origin_width - w;
667  complexFlag = offset;
668  this->m_intf.nextBlock();
669  }
670  this->m_intf.endBlock();
671 }
672 
673 template <class I>
675 {
676  uint8_t j;
677  this->m_intf.startBlock(x, y >> 3, w);
678  for(j=(h >> 3); j>0; j--)
679  {
680  this->m_intf.sendBuffer( buf, w );
681  buf+=w;
682  this->m_intf.nextBlock();
683  }
684  this->m_intf.endBlock();
685 }
686 
687 template <class I>
688 void NanoDisplayOps1<I>::drawBuffer4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
689 {
690  // NOT IMPLEMENTED
691 }
692 
693 template <class I>
694 void NanoDisplayOps1<I>::drawBuffer8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
695 {
696  // NOT IMPLEMENTED
697 }
698 
699 template <class I>
701 {
702  // NOT IMPLEMENTED
703 }
704 
705 template <class I>
706 void NanoDisplayOps1<I>::fill(uint16_t color)
707 {
708  color ^= s_ssd1306_invertByte;
709  this->m_intf.startBlock(0, 0, 0);
710  for(lcduint_t m=(this->m_h >> 3); m>0; m--)
711  {
712  for(lcduint_t n=this->m_w; n>0; n--)
713  {
714  this->m_intf.send(color);
715  }
716  this->m_intf.nextBlock();
717  }
718  this->m_intf.endBlock();
719 }
720 
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 fill(uint16_t color)
void drawBitmap16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
uint8_t height
char height in pixels
Definition: canvas_types.h:145
uint8_t lcduint_t
Definition: canvas_types.h:81
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))
lcduint_t width()
Definition: display_base.h:96
int8_t lcdint_t
Definition: canvas_types.h:79
void fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
#define SSD1306_MORE_CHARS_REQUIRED
Definition: canvas_types.h:43
void gfx_drawMonoBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf)
void drawBuffer1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
uint8_t printChar(uint8_t c)
void drawBuffer1Fast(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
void drawXBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
void putPixel(lcdint_t x, lcdint_t y) __attribute__((noinline))
uint8_t width
char width in pixels
Definition: canvas_types.h:144
void printFixedN(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style, uint8_t factor) __attribute__((noinline))
void drawBuffer8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
const uint8_t * glyph
char data, located in progmem.
Definition: canvas_types.h:147
size_t write(uint8_t c) __attribute__((noinline))
void printFixed(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
void drawBitmap4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
Draws 4-bit gray-color bitmap in color buffer. Draws 4-bit gray-color bitmap in color buffer...
uint8_t spacing
additional spaces after char in pixels
Definition: canvas_types.h:146
void drawVLine(lcdint_t x1, lcdint_t y1, lcdint_t y2)
EFontStyle
Definition: canvas_types.h:90
void drawHLine(lcdint_t x1, lcdint_t y1, lcdint_t x2)
void drawBuffer16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))