LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
lcd_ssd1306.h
Go to the documentation of this file.
1 /*
2  MIT License
3 
4  Copyright 2019-2022 (C) 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 /* !!! THIS FILE IS AUTO GENERATED !!! */
29 #pragma once
30 
31 #include "lcd_hal/io.h"
32 #include "v2/lcd/lcd_common.h"
33 #include "v2/lcd/base/display.h"
34 
43 template <typename I> class InterfaceSSD1306: public I
44 {
45 public:
53  template <typename... Args>
54  InterfaceSSD1306(NanoDisplayBase<InterfaceSSD1306<I>> &base, int8_t dc, Args &&... data)
55  : I(data...)
56  , m_dc(dc)
57  , m_base(base)
58  {
59  }
60 
77 
84  void nextBlock();
85 
89  void endBlock();
90 
95  void setDataMode(uint8_t mode);
96 
101  void commandStart();
102 
109  void setStartLine(uint8_t line);
110 
116  uint8_t getStartLine();
117 
122  void normalMode();
123 
129  void invertMode();
130 
137  void setContrast(uint8_t contrast);
138 
144  void displayOff();
145 
150  void displayOn();
151 
161  void flipHorizontal(uint8_t mode);
162 
172  void flipVertical(uint8_t mode);
173 
174 private:
175  int8_t m_dc = -1;
177  uint8_t m_startLine = 0;
178 };
182 template <typename I> class DisplaySSD1306: public NanoDisplayOps<NanoDisplayOps1<I>, I>
183 {
184 public:
191  DisplaySSD1306(I &intf, int8_t rstPin)
192  : NanoDisplayOps<NanoDisplayOps1<I>, I>(intf)
193  , m_rstPin(rstPin)
194  {
195  }
196 
197 protected:
198  int8_t m_rstPin;
199 
203  void beginDisplay();
204 
208  void endDisplay();
209 };
210 
214 template <typename I> class DisplaySSD1306_64x32: public DisplaySSD1306<I>
215 {
216 public:
223  DisplaySSD1306_64x32(I &intf, int8_t rstPin)
224  : DisplaySSD1306<I>(intf, rstPin)
225  {
226  }
227 
228 protected:
232  void beginController();
233 
237  void endController();
238 };
239 #ifdef CONFIG_LCDGFX_PLATFORM_SPI
240 
243 class DisplaySSD1306_64x32_SPI: public DisplaySSD1306_64x32<InterfaceSSD1306<PlatformSpi>>
244 {
245 public:
253  explicit DisplaySSD1306_64x32_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0U, -1, -1})
254  : DisplaySSD1306_64x32(m_spi, rstPin)
255  , m_spi(*this, config.dc,
257  config.busId, {config.cs}, config.dc, config.frequency ?: static_cast<uint32_t>(10000000), config.scl, config.sda})
258  {
259  }
260 
264  void begin() override;
265 
269  void end() override;
270 
271 private:
273 };
274 #endif
275 
280 template <typename I> class DisplaySSD1306_64x32_CustomSPI: public DisplaySSD1306_64x32<InterfaceSSD1306<I>>
281 {
282 public:
291  template <typename... Args>
292  DisplaySSD1306_64x32_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
293  : DisplaySSD1306_64x32<InterfaceSSD1306<I>>(m_spi, rstPin)
294  , m_spi(*this, dcPin, data...)
295  {
296  }
297 
301  void begin() override
302  {
303  m_spi.begin();
304  DisplaySSD1306_64x32<InterfaceSSD1306<I>>::beginController();
305  }
306 
310  void end() override
311  {
313  m_spi.end();
314  }
315 
316 private:
317  InterfaceSSD1306<I> m_spi;
318 };
319 #ifdef CONFIG_LCDGFX_PLATFORM_I2C
320 
323 class DisplaySSD1306_64x32_I2C: public DisplaySSD1306_64x32<InterfaceSSD1306<PlatformI2c>>
324 {
325 public:
333  explicit DisplaySSD1306_64x32_I2C(int8_t rstPin, const SPlatformI2cConfig &config = {-1, 0x3C, -1, -1, 0U})
334  : DisplaySSD1306_64x32(m_i2c, rstPin)
335  , m_i2c(*this, -1,
336  SPlatformI2cConfig{config.busId, static_cast<uint8_t>(config.addr ?: 0x3C), config.scl, config.sda,
337  config.frequency ?: 400000U})
338  {
339  }
340 
344  void begin() override;
345 
349  void end() override;
350 
351 private:
353 };
354 #endif
355 
360 template <typename I> class DisplaySSD1306_64x32_CustomI2C: public DisplaySSD1306_64x32<InterfaceSSD1306<I>>
361 {
362 public:
370  template <typename... Args>
371  DisplaySSD1306_64x32_CustomI2C(int8_t rstPin, Args &&... data)
372  : DisplaySSD1306_64x32<InterfaceSSD1306<I>>(m_i2c, rstPin)
373  , m_i2c(*this, -1, data...)
374  {
375  }
376 
380  void begin() override
381  {
382  m_i2c.begin();
383  DisplaySSD1306_64x32<InterfaceSSD1306<I>>::beginController();
384  }
385 
389  void end() override
390  {
392  m_i2c.end();
393  }
394 
395 private:
396  InterfaceSSD1306<I> m_i2c;
397 };
403 template <typename I> class DisplaySSD1306_64x32_Custom: public DisplaySSD1306_64x32<InterfaceSSD1306<I>>
404 {
405 public:
418  template <typename... Args>
419  DisplaySSD1306_64x32_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
420  : DisplaySSD1306_64x32<InterfaceSSD1306<I>>(m_custom, rstPin)
421  , m_custom(*this, dcPin, frequency = frequency ? frequency : 3000000, data...)
422  {
423  }
424 
428  void begin() override
429  {
430  m_custom.begin();
431  DisplaySSD1306_64x32<InterfaceSSD1306<I>>::beginController();
432  }
433 
437  void end() override
438  {
440  m_custom.end();
441  }
442 
443 private:
444  InterfaceSSD1306<I> m_custom;
445 };
449 template <typename I> class DisplaySSD1306_64x48: public DisplaySSD1306<I>
450 {
451 public:
458  DisplaySSD1306_64x48(I &intf, int8_t rstPin)
459  : DisplaySSD1306<I>(intf, rstPin)
460  {
461  }
462 
463 protected:
467  void beginController();
468 
472  void endController();
473 };
474 #ifdef CONFIG_LCDGFX_PLATFORM_SPI
475 
478 class DisplaySSD1306_64x48_SPI: public DisplaySSD1306_64x48<InterfaceSSD1306<PlatformSpi>>
479 {
480 public:
488  explicit DisplaySSD1306_64x48_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0U, -1, -1})
489  : DisplaySSD1306_64x48(m_spi, rstPin)
490  , m_spi(*this, config.dc,
492  config.busId, {config.cs}, config.dc, config.frequency ?: static_cast<uint32_t>(10000000), config.scl, config.sda})
493  {
494  }
495 
499  void begin() override;
500 
504  void end() override;
505 
506 private:
508 };
509 #endif
510 
515 template <typename I> class DisplaySSD1306_64x48_CustomSPI: public DisplaySSD1306_64x48<InterfaceSSD1306<I>>
516 {
517 public:
526  template <typename... Args>
527  DisplaySSD1306_64x48_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
528  : DisplaySSD1306_64x48<InterfaceSSD1306<I>>(m_spi, rstPin)
529  , m_spi(*this, dcPin, data...)
530  {
531  }
532 
536  void begin() override
537  {
538  m_spi.begin();
539  DisplaySSD1306_64x48<InterfaceSSD1306<I>>::beginController();
540  }
541 
545  void end() override
546  {
548  m_spi.end();
549  }
550 
551 private:
552  InterfaceSSD1306<I> m_spi;
553 };
554 #ifdef CONFIG_LCDGFX_PLATFORM_I2C
555 
558 class DisplaySSD1306_64x48_I2C: public DisplaySSD1306_64x48<InterfaceSSD1306<PlatformI2c>>
559 {
560 public:
568  explicit DisplaySSD1306_64x48_I2C(int8_t rstPin, const SPlatformI2cConfig &config = {-1, 0x3C, -1, -1, 0U})
569  : DisplaySSD1306_64x48(m_i2c, rstPin)
570  , m_i2c(*this, -1,
571  SPlatformI2cConfig{config.busId, static_cast<uint8_t>(config.addr ?: 0x3C), config.scl, config.sda,
572  config.frequency ?: 400000U})
573  {
574  }
575 
579  void begin() override;
580 
584  void end() override;
585 
586 private:
588 };
589 #endif
590 
595 template <typename I> class DisplaySSD1306_64x48_CustomI2C: public DisplaySSD1306_64x48<InterfaceSSD1306<I>>
596 {
597 public:
605  template <typename... Args>
606  DisplaySSD1306_64x48_CustomI2C(int8_t rstPin, Args &&... data)
607  : DisplaySSD1306_64x48<InterfaceSSD1306<I>>(m_i2c, rstPin)
608  , m_i2c(*this, -1, data...)
609  {
610  }
611 
615  void begin() override
616  {
617  m_i2c.begin();
618  DisplaySSD1306_64x48<InterfaceSSD1306<I>>::beginController();
619  }
620 
624  void end() override
625  {
627  m_i2c.end();
628  }
629 
630 private:
631  InterfaceSSD1306<I> m_i2c;
632 };
638 template <typename I> class DisplaySSD1306_64x48_Custom: public DisplaySSD1306_64x48<InterfaceSSD1306<I>>
639 {
640 public:
653  template <typename... Args>
654  DisplaySSD1306_64x48_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
655  : DisplaySSD1306_64x48<InterfaceSSD1306<I>>(m_custom, rstPin)
656  , m_custom(*this, dcPin, frequency = frequency ? frequency : 3000000, data...)
657  {
658  }
659 
663  void begin() override
664  {
665  m_custom.begin();
666  DisplaySSD1306_64x48<InterfaceSSD1306<I>>::beginController();
667  }
668 
672  void end() override
673  {
675  m_custom.end();
676  }
677 
678 private:
679  InterfaceSSD1306<I> m_custom;
680 };
684 template <typename I> class DisplaySSD1306_128x32: public DisplaySSD1306<I>
685 {
686 public:
693  DisplaySSD1306_128x32(I &intf, int8_t rstPin)
694  : DisplaySSD1306<I>(intf, rstPin)
695  {
696  }
697 
698 protected:
702  void beginController();
703 
707  void endController();
708 };
709 #ifdef CONFIG_LCDGFX_PLATFORM_SPI
710 
713 class DisplaySSD1306_128x32_SPI: public DisplaySSD1306_128x32<InterfaceSSD1306<PlatformSpi>>
714 {
715 public:
723  explicit DisplaySSD1306_128x32_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0U, -1, -1})
724  : DisplaySSD1306_128x32(m_spi, rstPin)
725  , m_spi(*this, config.dc,
727  config.busId, {config.cs}, config.dc, config.frequency ?: static_cast<uint32_t>(10000000), config.scl, config.sda})
728  {
729  }
730 
734  void begin() override;
735 
739  void end() override;
740 
741 private:
743 };
744 #endif
745 
750 template <typename I> class DisplaySSD1306_128x32_CustomSPI: public DisplaySSD1306_128x32<InterfaceSSD1306<I>>
751 {
752 public:
761  template <typename... Args>
762  DisplaySSD1306_128x32_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
763  : DisplaySSD1306_128x32<InterfaceSSD1306<I>>(m_spi, rstPin)
764  , m_spi(*this, dcPin, data...)
765  {
766  }
767 
771  void begin() override
772  {
773  m_spi.begin();
774  DisplaySSD1306_128x32<InterfaceSSD1306<I>>::beginController();
775  }
776 
780  void end() override
781  {
783  m_spi.end();
784  }
785 
786 private:
787  InterfaceSSD1306<I> m_spi;
788 };
789 #ifdef CONFIG_LCDGFX_PLATFORM_I2C
790 
793 class DisplaySSD1306_128x32_I2C: public DisplaySSD1306_128x32<InterfaceSSD1306<PlatformI2c>>
794 {
795 public:
803  explicit DisplaySSD1306_128x32_I2C(int8_t rstPin, const SPlatformI2cConfig &config = {-1, 0x3C, -1, -1, 0U})
804  : DisplaySSD1306_128x32(m_i2c, rstPin)
805  , m_i2c(*this, -1,
806  SPlatformI2cConfig{config.busId, static_cast<uint8_t>(config.addr ?: 0x3C), config.scl, config.sda,
807  config.frequency ?: 400000U})
808  {
809  }
810 
814  void begin() override;
815 
819  void end() override;
820 
821 private:
823 };
824 #endif
825 
830 template <typename I> class DisplaySSD1306_128x32_CustomI2C: public DisplaySSD1306_128x32<InterfaceSSD1306<I>>
831 {
832 public:
840  template <typename... Args>
841  DisplaySSD1306_128x32_CustomI2C(int8_t rstPin, Args &&... data)
842  : DisplaySSD1306_128x32<InterfaceSSD1306<I>>(m_i2c, rstPin)
843  , m_i2c(*this, -1, data...)
844  {
845  }
846 
850  void begin() override
851  {
852  m_i2c.begin();
853  DisplaySSD1306_128x32<InterfaceSSD1306<I>>::beginController();
854  }
855 
859  void end() override
860  {
862  m_i2c.end();
863  }
864 
865 private:
866  InterfaceSSD1306<I> m_i2c;
867 };
873 template <typename I> class DisplaySSD1306_128x32_Custom: public DisplaySSD1306_128x32<InterfaceSSD1306<I>>
874 {
875 public:
888  template <typename... Args>
889  DisplaySSD1306_128x32_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
890  : DisplaySSD1306_128x32<InterfaceSSD1306<I>>(m_custom, rstPin)
891  , m_custom(*this, dcPin, frequency = frequency ? frequency : 3000000, data...)
892  {
893  }
894 
898  void begin() override
899  {
900  m_custom.begin();
901  DisplaySSD1306_128x32<InterfaceSSD1306<I>>::beginController();
902  }
903 
907  void end() override
908  {
910  m_custom.end();
911  }
912 
913 private:
914  InterfaceSSD1306<I> m_custom;
915 };
919 template <typename I> class DisplaySSD1306_128x64: public DisplaySSD1306<I>
920 {
921 public:
928  DisplaySSD1306_128x64(I &intf, int8_t rstPin)
929  : DisplaySSD1306<I>(intf, rstPin)
930  {
931  }
932 
933 protected:
937  void beginController();
938 
942  void endController();
943 };
944 #ifdef CONFIG_LCDGFX_PLATFORM_SPI
945 
948 class DisplaySSD1306_128x64_SPI: public DisplaySSD1306_128x64<InterfaceSSD1306<PlatformSpi>>
949 {
950 public:
958  explicit DisplaySSD1306_128x64_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0U, -1, -1})
959  : DisplaySSD1306_128x64(m_spi, rstPin)
960  , m_spi(*this, config.dc,
962  config.busId, {config.cs}, config.dc, config.frequency ?: static_cast<uint32_t>(10000000), config.scl, config.sda})
963  {
964  }
965 
969  void begin() override;
970 
974  void end() override;
975 
976 private:
978 };
979 #endif
980 
985 template <typename I> class DisplaySSD1306_128x64_CustomSPI: public DisplaySSD1306_128x64<InterfaceSSD1306<I>>
986 {
987 public:
996  template <typename... Args>
997  DisplaySSD1306_128x64_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
998  : DisplaySSD1306_128x64<InterfaceSSD1306<I>>(m_spi, rstPin)
999  , m_spi(*this, dcPin, data...)
1000  {
1001  }
1002 
1006  void begin() override
1007  {
1008  m_spi.begin();
1009  DisplaySSD1306_128x64<InterfaceSSD1306<I>>::beginController();
1010  }
1011 
1015  void end() override
1016  {
1018  m_spi.end();
1019  }
1020 
1021 private:
1022  InterfaceSSD1306<I> m_spi;
1023 };
1024 #ifdef CONFIG_LCDGFX_PLATFORM_I2C
1025 
1028 class DisplaySSD1306_128x64_I2C: public DisplaySSD1306_128x64<InterfaceSSD1306<PlatformI2c>>
1029 {
1030 public:
1038  explicit DisplaySSD1306_128x64_I2C(int8_t rstPin, const SPlatformI2cConfig &config = {-1, 0x3C, -1, -1, 0U})
1039  : DisplaySSD1306_128x64(m_i2c, rstPin)
1040  , m_i2c(*this, -1,
1041  SPlatformI2cConfig{config.busId, static_cast<uint8_t>(config.addr ?: 0x3C), config.scl, config.sda,
1042  config.frequency ?: 400000U})
1043  {
1044  }
1045 
1049  void begin() override;
1050 
1054  void end() override;
1055 
1056 private:
1058 };
1059 #endif
1060 
1065 template <typename I> class DisplaySSD1306_128x64_CustomI2C: public DisplaySSD1306_128x64<InterfaceSSD1306<I>>
1066 {
1067 public:
1075  template <typename... Args>
1076  DisplaySSD1306_128x64_CustomI2C(int8_t rstPin, Args &&... data)
1077  : DisplaySSD1306_128x64<InterfaceSSD1306<I>>(m_i2c, rstPin)
1078  , m_i2c(*this, -1, data...)
1079  {
1080  }
1081 
1085  void begin() override
1086  {
1087  m_i2c.begin();
1088  DisplaySSD1306_128x64<InterfaceSSD1306<I>>::beginController();
1089  }
1090 
1094  void end() override
1095  {
1097  m_i2c.end();
1098  }
1099 
1100 private:
1101  InterfaceSSD1306<I> m_i2c;
1102 };
1108 template <typename I> class DisplaySSD1306_128x64_Custom: public DisplaySSD1306_128x64<InterfaceSSD1306<I>>
1109 {
1110 public:
1123  template <typename... Args>
1124  DisplaySSD1306_128x64_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
1125  : DisplaySSD1306_128x64<InterfaceSSD1306<I>>(m_custom, rstPin)
1126  , m_custom(*this, dcPin, frequency = frequency ? frequency : 3000000, data...)
1127  {
1128  }
1129 
1133  void begin() override
1134  {
1135  m_custom.begin();
1136  DisplaySSD1306_128x64<InterfaceSSD1306<I>>::beginController();
1137  }
1138 
1142  void end() override
1143  {
1145  m_custom.end();
1146  }
1147 
1148 private:
1149  InterfaceSSD1306<I> m_custom;
1150 };
1151 #include "lcd_ssd1306.inl"
1152 
DisplaySSD1306_64x32_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 64x32 lcd display over spi (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:292
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:1133
DisplaySSD1306_128x32_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
Inits 128x32 lcd display over custom interface (based on SSD1306 controller): 1-bit mode...
Definition: lcd_ssd1306.h:889
Template class implements SSD1306 64x48 lcd display in 1 bit mode over custom interface implementatio...
Definition: lcd_ssd1306.h:638
void setStartLine(uint8_t line)
Sets start line in GDRAM to begin display content with.
Definition: lcd_ssd1306.inl:83
Structure describes spi platform configuration.
Definition: interface.h:80
uint8_t lcduint_t
internal int type, used by the library.
Definition: canvas_types.h:79
DisplaySSD1306_64x48_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 64x48 lcd display over spi (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:527
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:536
Class implements basic functions for 1-bit mode of SSD1306-based displays.
Definition: lcd_ssd1306.h:182
DisplaySSD1306_128x64(I &intf, int8_t rstPin)
Creates instance of SSD1306 128x64 controller class for 1-bit mode.
Definition: lcd_ssd1306.h:928
global lcd settings
void displayOff()
Turns off the display (enters sleep mode).
DisplaySSD1306_128x64_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 128x64 lcd display over spi (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:997
int8_t busId
bus id number.
Definition: interface.h:49
void flipVertical(uint8_t mode)
Performs vertical flip.
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:663
Structure describes i2c platform configuration.
Definition: interface.h:43
DisplaySSD1306(I &intf, int8_t rstPin)
Creates instance of SSD1306 controller class for 1-bit mode.
Definition: lcd_ssd1306.h:191
Template class implements SSD1306 128x64 lcd display in 1 bit mode over custom I2C implementation (us...
Definition: lcd_ssd1306.h:1065
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:428
DisplaySSD1306_64x48_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
Inits 64x48 lcd display over custom interface (based on SSD1306 controller): 1-bit mode...
Definition: lcd_ssd1306.h:654
DisplaySSD1306_64x48_CustomI2C(int8_t rstPin, Args &&... data)
Inits 64x48 lcd display over i2c (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:606
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:615
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:380
DisplaySSD1306_128x64_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
Inits 128x64 lcd display over custom interface (based on SSD1306 controller): 1-bit mode...
Definition: lcd_ssd1306.h:1124
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:780
SSD1306 HAL IO communication functions.
DisplaySSD1306_64x32_CustomI2C(int8_t rstPin, Args &&... data)
Inits 64x32 lcd display over i2c (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:371
Template class implements SSD1306 128x32 lcd display in 1 bit mode over custom interface implementati...
Definition: lcd_ssd1306.h:873
DisplaySSD1306_128x32_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 128x32 lcd display over spi (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:762
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:437
uint8_t getStartLine()
Returns the current start line offset in GDRAM.
Definition: lcd_ssd1306.inl:91
InterfaceSSD1306(NanoDisplayBase< InterfaceSSD1306< I >> &base, int8_t dc, Args &&... data)
Creates instance of interface to LCD display.
Definition: lcd_ssd1306.h:54
int8_t m_rstPin
indicates hardware reset pin used, -1 if it is not required
Definition: lcd_ssd1306.h:198
void nextBlock()
Switches to the start of next RAM page for the block, specified by startBlock().
Definition: lcd_ssd1306.inl:56
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:624
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:1015
void startBlock(lcduint_t x, lcduint_t y, lcduint_t w)
Sets block in RAM of lcd display controller to write data to.
Definition: lcd_ssd1306.inl:35
void endBlock()
Closes data send operation to lcd display.
Definition: lcd_ssd1306.inl:61
int8_t dc
Data command control pin number.
Definition: interface.h:102
Template class implements SSD1306 64x32 lcd display in 1 bit mode over custom SPI implementation (use...
Definition: lcd_ssd1306.h:280
DisplaySSD1306_64x48(I &intf, int8_t rstPin)
Creates instance of SSD1306 64x48 controller class for 1-bit mode.
Definition: lcd_ssd1306.h:458
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:1142
void flipHorizontal(uint8_t mode)
Performs horizontal flip.
void invertMode()
Switches display to inverted mode.
NanoDisplayOps1 is template class for 1-bit operations.
Definition: display.h:47
Class implements basic functions for 1-bit mode of SSD1306-based displays.
Definition: lcd_ssd1306.h:684
Template class implements SSD1306 64x32 lcd display in 1 bit mode over custom I2C implementation (use...
Definition: lcd_ssd1306.h:360
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:907
Template class implements SSD1306 64x48 lcd display in 1 bit mode over custom I2C implementation (use...
Definition: lcd_ssd1306.h:595
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:1006
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:672
Class implements interface functions to SSD1306 displays.
Definition: lcd_ssd1306.h:43
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:545
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:898
DisplaySSD1306_64x32(I &intf, int8_t rstPin)
Creates instance of SSD1306 64x32 controller class for 1-bit mode.
Definition: lcd_ssd1306.h:223
DisplaySSD1306_128x32_CustomI2C(int8_t rstPin, Args &&... data)
Inits 128x32 lcd display over i2c (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:841
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:859
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:310
Template class implements SSD1306 64x32 lcd display in 1 bit mode over custom interface implementatio...
Definition: lcd_ssd1306.h:403
void commandStart()
Starts communication with LCD display in command mode.
Definition: lcd_ssd1306.inl:74
void setDataMode(uint8_t mode)
Enables either data or command mode on SPI bus.
Definition: lcd_ssd1306.inl:66
DisplaySSD1306_128x64_CustomI2C(int8_t rstPin, Args &&... data)
Inits 128x64 lcd display over i2c (based on SSD1306 controller): 1-bit mode.
Definition: lcd_ssd1306.h:1076
Template class implements SSD1306 128x64 lcd display in 1 bit mode over custom SPI implementation (us...
Definition: lcd_ssd1306.h:985
void setContrast(uint8_t contrast)
Sets display contrast (brightness level).
DisplaySSD1306_128x32(I &intf, int8_t rstPin)
Creates instance of SSD1306 128x32 controller class for 1-bit mode.
Definition: lcd_ssd1306.h:693
Template class implements SSD1306 128x64 lcd display in 1 bit mode over custom interface implementati...
Definition: lcd_ssd1306.h:1108
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:850
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:1094
void displayOn()
Turns on the display, resuming normal output.
Class implements basic functions for 1-bit mode of SSD1306-based displays.
Definition: lcd_ssd1306.h:449
Template class implements SSD1306 64x48 lcd display in 1 bit mode over custom SPI implementation (use...
Definition: lcd_ssd1306.h:515
Class implements basic functions for 1-bit mode of SSD1306-based displays.
Definition: lcd_ssd1306.h:919
NanoCanvasOps provides operations for drawing in memory buffer.
Definition: display.h:978
Class implements basic display operations for the library: It stores reference to communication inter...
Definition: display_base.h:55
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:771
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:1085
Template class implements SSD1306 128x32 lcd display in 1 bit mode over custom SPI implementation (us...
Definition: lcd_ssd1306.h:750
void normalMode()
Switches display back to normal (non-inverted) mode.
Definition: lcd_ssd1306.inl:96
void end() override
Closes connection to display.
Definition: lcd_ssd1306.h:389
Class implements basic functions for 1-bit mode of SSD1306-based displays.
Definition: lcd_ssd1306.h:214
Template class implements SSD1306 128x32 lcd display in 1 bit mode over custom I2C implementation (us...
Definition: lcd_ssd1306.h:830
DisplaySSD1306_64x32_Custom(int8_t rstPin, int8_t dcPin, uint32_t frequency, Args &&... data)
Inits 64x32 lcd display over custom interface (based on SSD1306 controller): 1-bit mode...
Definition: lcd_ssd1306.h:419
void begin() override
Initializes SSD1306 lcd in 1-bit mode.
Definition: lcd_ssd1306.h:301