LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
lcd_ssd1351.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 InterfaceSSD1351: public I
44 {
45 public:
53  template <typename... Args>
54  InterfaceSSD1351(NanoDisplayBase<InterfaceSSD1351<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 setRotation(uint8_t rotation);
110 
121  void setOffset(lcdint_t ox, lcdint_t oy);
122 
129  void setRgbMode(uint8_t mode);
130 
131 private:
132  const int8_t m_dc = -1;
134  uint8_t m_rotation = 0x00;
135  uint8_t m_rgbMode = 0x04;
136  lcdint_t m_offset_x = 0x00;
137  lcdint_t m_offset_y = 0x00;
138 };
142 template <typename I> class DisplaySSD1351x16: public NanoDisplayOps<NanoDisplayOps16<I>, I>
143 {
144 public:
151  DisplaySSD1351x16(I &intf, int8_t rstPin)
152  : NanoDisplayOps<NanoDisplayOps16<I>, I>(intf)
153  , m_rstPin(rstPin)
154  {
155  }
156 
157 protected:
158  int8_t m_rstPin;
159 
163  void beginDisplay();
164 
168  void endDisplay();
169 };
170 
174 template <typename I> class DisplaySSD1351_128x128x16: public DisplaySSD1351x16<I>
175 {
176 public:
183  DisplaySSD1351_128x128x16(I &intf, int8_t rstPin)
184  : DisplaySSD1351x16<I>(intf, rstPin)
185  {
186  }
187 
188 protected:
192  void beginController();
193 
197  void endController();
198 };
202 class DisplaySSD1351_128x128x16_SPI: public DisplaySSD1351_128x128x16<InterfaceSSD1351<PlatformSpi>>
203 {
204 public:
212  explicit DisplaySSD1351_128x128x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0, -1, -1})
213  : DisplaySSD1351_128x128x16(m_spi, rstPin)
214  , m_spi(*this, config.dc,
216  config.busId, {config.cs}, config.dc, config.frequency ?: 4400000, config.scl, config.sda})
217  {
218  }
219 
223  void begin() override;
224 
228  void end() override;
229 
230 private:
232 };
233 
238 template <typename I> class DisplaySSD1351_128x128x16_CustomSPI: public DisplaySSD1351_128x128x16<InterfaceSSD1351<I>>
239 {
240 public:
249  template <typename... Args>
250  DisplaySSD1351_128x128x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
251  : DisplaySSD1351_128x128x16<InterfaceSSD1351<I>>(m_spi, rstPin)
252  , m_spi(*this, dcPin, data...)
253  {
254  }
255 
259  void begin() override
260  {
261  m_spi.begin();
263  }
264 
268  void end() override
269  {
271  m_spi.end();
272  }
273 
274 private:
275  InterfaceSSD1351<I> m_spi;
276 };
280 template <typename I> class DisplaySSD1351_96x96x16: public DisplaySSD1351x16<I>
281 {
282 public:
289  DisplaySSD1351_96x96x16(I &intf, int8_t rstPin)
290  : DisplaySSD1351x16<I>(intf, rstPin)
291  {
292  }
293 
294 protected:
298  void beginController();
299 
303  void endController();
304 };
308 class DisplaySSD1351_96x96x16_SPI: public DisplaySSD1351_96x96x16<InterfaceSSD1351<PlatformSpi>>
309 {
310 public:
318  explicit DisplaySSD1351_96x96x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0, -1, -1})
319  : DisplaySSD1351_96x96x16(m_spi, rstPin)
320  , m_spi(*this, config.dc,
322  config.busId, {config.cs}, config.dc, config.frequency ?: 4400000, config.scl, config.sda})
323  {
324  }
325 
329  void begin() override;
330 
334  void end() override;
335 
336 private:
338 };
339 
344 template <typename I> class DisplaySSD1351_96x96x16_CustomSPI: public DisplaySSD1351_96x96x16<InterfaceSSD1351<I>>
345 {
346 public:
355  template <typename... Args>
356  DisplaySSD1351_96x96x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
357  : DisplaySSD1351_96x96x16<InterfaceSSD1351<I>>(m_spi, rstPin)
358  , m_spi(*this, dcPin, data...)
359  {
360  }
361 
365  void begin() override
366  {
367  m_spi.begin();
369  }
370 
374  void end() override
375  {
377  m_spi.end();
378  }
379 
380 private:
381  InterfaceSSD1351<I> m_spi;
382 };
383 #include "lcd_ssd1351.inl"
384 
void setRotation(uint8_t rotation)
Sets screen orientation (rotation)
Definition: lcd_ssd1351.inl:89
void setRgbMode(uint8_t mode)
Sets RGB mode used by dispay controller.
uint8_t lcduint_t
Definition: canvas_types.h:79
InterfaceSSD1351(NanoDisplayBase< InterfaceSSD1351< I >> &base, int8_t dc, Args &&... data)
Definition: lcd_ssd1351.h:54
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_ssd1351.inl:35
DisplaySSD1351_96x96x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 96x96x16 lcd display over spi (based on SSD1351 controller): 16-bit mode.
Definition: lcd_ssd1351.h:356
int8_t lcdint_t
Definition: canvas_types.h:77
DisplaySSD1351x16(I &intf, int8_t rstPin)
Definition: lcd_ssd1351.h:151
DisplaySSD1351_128x128x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config={-1, {-1}, -1, 0, -1, -1})
Inits 128x128x16 lcd display over spi (based on SSD1351 controller): 16-bit mode. ...
Definition: lcd_ssd1351.h:212
DisplaySSD1351_128x128x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 128x128x16 lcd display over spi (based on SSD1351 controller): 16-bit mode. ...
Definition: lcd_ssd1351.h:250
DisplaySSD1351_128x128x16(I &intf, int8_t rstPin)
Definition: lcd_ssd1351.h:183
int8_t m_rstPin
indicates hardware reset pin used, -1 if it is not required
Definition: lcd_ssd1351.h:158
DisplaySSD1351_96x96x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config={-1, {-1}, -1, 0, -1, -1})
Inits 96x96x16 lcd display over spi (based on SSD1351 controller): 16-bit mode.
Definition: lcd_ssd1351.h:318
DisplaySSD1351_96x96x16(I &intf, int8_t rstPin)
Definition: lcd_ssd1351.h:289
void setDataMode(uint8_t mode)
Definition: lcd_ssd1351.inl:72
void setOffset(lcdint_t ox, lcdint_t oy)
Sets display offset in GDRAM memory.