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_il9163.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 InterfaceIL9163: public I
44 {
45 public:
53  template <typename... Args>
54  InterfaceIL9163(NanoDisplayBase<InterfaceIL9163<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 
111 private:
112  const int8_t m_dc = -1;
114  uint8_t m_rotation = 0x00;
115  uint8_t m_rgb_bit = 0b00000000;
116 };
120 template <typename I> class DisplayIL9163x16: public NanoDisplayOps<NanoDisplayOps16<I>, I>
121 {
122 public:
129  DisplayIL9163x16(I &intf, int8_t rstPin)
130  : NanoDisplayOps<NanoDisplayOps16<I>, I>(intf)
131  , m_rstPin(rstPin)
132  {
133  }
134 
135 protected:
136  int8_t m_rstPin;
137 
141  void beginDisplay();
142 
146  void endDisplay();
147 };
148 
152 template <typename I> class DisplayIL9163_128x128x16: public DisplayIL9163x16<I>
153 {
154 public:
161  DisplayIL9163_128x128x16(I &intf, int8_t rstPin)
162  : DisplayIL9163x16<I>(intf, rstPin)
163  {
164  }
165 
166 protected:
170  void beginController();
171 
175  void endController();
176 };
177 #ifdef CONFIG_LCDGFX_PLATFORM_SPI
178 
181 class DisplayIL9163_128x128x16_SPI: public DisplayIL9163_128x128x16<InterfaceIL9163<PlatformSpi>>
182 {
183 public:
191  explicit DisplayIL9163_128x128x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0U, -1, -1})
192  : DisplayIL9163_128x128x16(m_spi, rstPin)
193  , m_spi(*this, config.dc,
195  config.busId, {config.cs}, config.dc, config.frequency ?: static_cast<uint32_t>(8000000), config.scl, config.sda})
196  {
197  }
198 
202  void begin() override;
203 
207  void end() override;
208 
209 private:
211 };
212 #endif
213 
218 template <typename I> class DisplayIL9163_128x128x16_CustomSPI: public DisplayIL9163_128x128x16<InterfaceIL9163<I>>
219 {
220 public:
229  template <typename... Args>
230  DisplayIL9163_128x128x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
231  : DisplayIL9163_128x128x16<InterfaceIL9163<I>>(m_spi, rstPin)
232  , m_spi(*this, dcPin, data...)
233  {
234  }
235 
239  void begin() override
240  {
241  m_spi.begin();
243  }
244 
248  void end() override
249  {
251  m_spi.end();
252  }
253 
254 private:
255  InterfaceIL9163<I> m_spi;
256 };
260 template <typename I> class DisplayIL9163_128x160x16: public DisplayIL9163x16<I>
261 {
262 public:
269  DisplayIL9163_128x160x16(I &intf, int8_t rstPin)
270  : DisplayIL9163x16<I>(intf, rstPin)
271  {
272  }
273 
274 protected:
278  void beginController();
279 
283  void endController();
284 };
285 #ifdef CONFIG_LCDGFX_PLATFORM_SPI
286 
289 class DisplayIL9163_128x160x16_SPI: public DisplayIL9163_128x160x16<InterfaceIL9163<PlatformSpi>>
290 {
291 public:
299  explicit DisplayIL9163_128x160x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0U, -1, -1})
300  : DisplayIL9163_128x160x16(m_spi, rstPin)
301  , m_spi(*this, config.dc,
303  config.busId, {config.cs}, config.dc, config.frequency ?: static_cast<uint32_t>(8000000), config.scl, config.sda})
304  {
305  }
306 
310  void begin() override;
311 
315  void end() override;
316 
317 private:
319 };
320 #endif
321 
326 template <typename I> class DisplayIL9163_128x160x16_CustomSPI: public DisplayIL9163_128x160x16<InterfaceIL9163<I>>
327 {
328 public:
337  template <typename... Args>
338  DisplayIL9163_128x160x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
339  : DisplayIL9163_128x160x16<InterfaceIL9163<I>>(m_spi, rstPin)
340  , m_spi(*this, dcPin, data...)
341  {
342  }
343 
347  void begin() override
348  {
349  m_spi.begin();
351  }
352 
356  void end() override
357  {
359  m_spi.end();
360  }
361 
362 private:
363  InterfaceIL9163<I> m_spi;
364 };
365 #include "lcd_il9163.inl"
366 
uint8_t lcduint_t
Definition: canvas_types.h:79
void setDataMode(uint8_t mode)
Definition: lcd_il9163.inl:70
DisplayIL9163_128x128x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:161
DisplayIL9163x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:129
void setRotation(uint8_t rotation)
Sets screen orientation (rotation)
Definition: lcd_il9163.inl:87
void commandStart()
Definition: lcd_il9163.inl:78
DisplayIL9163_128x160x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:269
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_il9163.inl:35
DisplayIL9163_128x160x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 128x160x16 lcd display over spi (based on IL9163 controller): 16-bit mode.
Definition: lcd_il9163.h:338
DisplayIL9163_128x128x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
Inits 128x128x16 lcd display over spi (based on IL9163 controller): 16-bit mode.
Definition: lcd_il9163.h:230
InterfaceIL9163(NanoDisplayBase< InterfaceIL9163< I >> &base, int8_t dc, Args &&... data)
Definition: lcd_il9163.h:54
int8_t m_rstPin
indicates hardware reset pin used, -1 if it is not required
Definition: lcd_il9163.h:136