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 };
180 class DisplayIL9163_128x128x16_SPI: public DisplayIL9163_128x128x16<InterfaceIL9163<PlatformSpi>>
181 {
182 public:
190  explicit DisplayIL9163_128x128x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0, -1, -1})
191  : DisplayIL9163_128x128x16(m_spi, rstPin)
192  , m_spi(*this, config.dc,
194  config.busId, {config.cs}, config.dc, config.frequency ?: 8000000, config.scl, config.sda})
195  {
196  }
197 
201  void begin() override;
202 
206  void end() override;
207 
208 private:
210 };
211 
216 template <typename I> class DisplayIL9163_128x128x16_CustomSPI: public DisplayIL9163_128x128x16<InterfaceIL9163<I>>
217 {
218 public:
227  template <typename... Args>
228  DisplayIL9163_128x128x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
229  : DisplayIL9163_128x128x16<InterfaceIL9163<I>>(m_spi, rstPin)
230  , m_spi(*this, dcPin, data...)
231  {
232  }
233 
237  void begin() override
238  {
239  m_spi.begin();
241  }
242 
246  void end() override
247  {
249  m_spi.end();
250  }
251 
252 private:
253  InterfaceIL9163<I> m_spi;
254 };
258 template <typename I> class DisplayIL9163_128x160x16: public DisplayIL9163x16<I>
259 {
260 public:
267  DisplayIL9163_128x160x16(I &intf, int8_t rstPin)
268  : DisplayIL9163x16<I>(intf, rstPin)
269  {
270  }
271 
272 protected:
276  void beginController();
277 
281  void endController();
282 };
286 class DisplayIL9163_128x160x16_SPI: public DisplayIL9163_128x160x16<InterfaceIL9163<PlatformSpi>>
287 {
288 public:
296  explicit DisplayIL9163_128x160x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config = {-1, {-1}, -1, 0, -1, -1})
297  : DisplayIL9163_128x160x16(m_spi, rstPin)
298  , m_spi(*this, config.dc,
300  config.busId, {config.cs}, config.dc, config.frequency ?: 8000000, config.scl, config.sda})
301  {
302  }
303 
307  void begin() override;
308 
312  void end() override;
313 
314 private:
316 };
317 
322 template <typename I> class DisplayIL9163_128x160x16_CustomSPI: public DisplayIL9163_128x160x16<InterfaceIL9163<I>>
323 {
324 public:
333  template <typename... Args>
334  DisplayIL9163_128x160x16_CustomSPI(int8_t rstPin, int8_t dcPin, Args &&... data)
335  : DisplayIL9163_128x160x16<InterfaceIL9163<I>>(m_spi, rstPin)
336  , m_spi(*this, dcPin, data...)
337  {
338  }
339 
343  void begin() override
344  {
345  m_spi.begin();
347  }
348 
352  void end() override
353  {
355  m_spi.end();
356  }
357 
358 private:
359  InterfaceIL9163<I> m_spi;
360 };
361 #include "lcd_il9163.inl"
362 
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
DisplayIL9163_128x128x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config={-1, {-1}, -1, 0, -1, -1})
Inits 128x128x16 lcd display over spi (based on IL9163 controller): 16-bit mode.
Definition: lcd_il9163.h:190
void commandStart()
Definition: lcd_il9163.inl:78
DisplayIL9163_128x160x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:267
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:334
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:228
InterfaceIL9163(NanoDisplayBase< InterfaceIL9163< I >> &base, int8_t dc, Args &&... data)
Definition: lcd_il9163.h:54
DisplayIL9163_128x160x16_SPI(int8_t rstPin, const SPlatformSpiConfig &config={-1, {-1}, -1, 0, -1, -1})
Inits 128x160x16 lcd display over spi (based on IL9163 controller): 16-bit mode.
Definition: lcd_il9163.h:296
int8_t m_rstPin
indicates hardware reset pin used, -1 if it is not required
Definition: lcd_il9163.h:136