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
lcd_il9163.h
Go to the documentation of this file.
1 /*
2  MIT License
3 
4  Copyright (c) 2019-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 /* !!! 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 <class I>
44 class InterfaceIL9163: public I
45 {
46 public:
54  template <typename... Args>
55  InterfaceIL9163(NanoDisplayBase<InterfaceIL9163<I>> &base, int8_t dc, Args&&... data)
56  : I(data...)
57  , m_dc( dc )
58  , m_base(base)
59  {
60  }
61 
78 
85  void nextBlock();
86 
90  void endBlock();
91 
96  void spiDataMode(uint8_t mode);
97 
102  void commandStart();
103 
110  void setRotation(uint8_t rotation);
111 
112 private:
113  const int8_t m_dc = -1;
115 
116  uint8_t m_rotation = 0x00;
117  static const uint8_t m_rgb_bit = 0b00000000;
118 };
119 
120 
124 template <class I>
125 class DisplayIL9163x16: public NanoDisplayOps<NanoDisplayOps16<I>,I>
126 {
127 public:
134  DisplayIL9163x16(I &intf, int8_t rstPin)
135  : NanoDisplayOps<NanoDisplayOps16<I>, I>(intf)
136  , m_rstPin( rstPin ) { }
137 
138 protected:
139  int8_t m_rstPin;
140 
144  void begin() override;
145 
149  void end() override;
150 };
151 
155 template <class I>
157 {
158 public:
165  DisplayIL9163_128x128x16(I &intf, int8_t rstPin)
166  : DisplayIL9163x16<I>(intf, rstPin) { }
167 
168 protected:
169 
173  void begin() override;
174 
178  void end() override;
179 };
180 
184 class DisplayIL9163_128x128x16_SPI: public DisplayIL9163_128x128x16<InterfaceIL9163<PlatformSpi>>
185 {
186 public:
194  DisplayIL9163_128x128x16_SPI( int8_t rstPin, const SPlatformSpiConfig &config = { -1, { -1 }, -1, 0, -1, -1 } )
195  : DisplayIL9163_128x128x16(m_spi, rstPin)
196  , m_spi( *this, config.dc,
197  SPlatformSpiConfig{ config.busId,
198  { config.cs },
199  config.dc,
200  config.frequency ?: 8000000,
201  config.scl,
202  config.sda } ) {}
203 
207  void begin() override;
208 
212  void end() override;
213 
214 private:
216 };
217 
222 template <class I>
224 {
225 public:
234  template <typename... Args>
235  DisplayIL9163_128x128x16_CustomSPI( int8_t rstPin, int8_t dcPin, Args&&... data )
236  : DisplayIL9163_128x128x16<InterfaceIL9163<I>>(m_spi, rstPin)
237  , m_spi( *this, dcPin,
238  data... ) {}
239 
243  void begin() override
244  {
245  m_spi.begin();
247  }
248 
252  void end() override
253  {
255  m_spi.end();
256  }
257 
258 private:
259  InterfaceIL9163<I> m_spi;
260 };
264 template <class I>
266 {
267 public:
274  DisplayIL9163_128x160x16(I &intf, int8_t rstPin)
275  : DisplayIL9163x16<I>(intf, rstPin) { }
276 
277 protected:
278 
282  void begin() override;
283 
287  void end() override;
288 };
289 
293 class DisplayIL9163_128x160x16_SPI: public DisplayIL9163_128x160x16<InterfaceIL9163<PlatformSpi>>
294 {
295 public:
303  DisplayIL9163_128x160x16_SPI( int8_t rstPin, const SPlatformSpiConfig &config = { -1, { -1 }, -1, 0, -1, -1 } )
304  : DisplayIL9163_128x160x16(m_spi, rstPin)
305  , m_spi( *this, config.dc,
306  SPlatformSpiConfig{ config.busId,
307  { config.cs },
308  config.dc,
309  config.frequency ?: 8000000,
310  config.scl,
311  config.sda } ) {}
312 
316  void begin() override;
317 
321  void end() override;
322 
323 private:
325 };
326 
331 template <class I>
333 {
334 public:
343  template <typename... Args>
344  DisplayIL9163_128x160x16_CustomSPI( int8_t rstPin, int8_t dcPin, Args&&... data )
345  : DisplayIL9163_128x160x16<InterfaceIL9163<I>>(m_spi, rstPin)
346  , m_spi( *this, dcPin,
347  data... ) {}
348 
352  void begin() override
353  {
354  m_spi.begin();
356  }
357 
361  void end() override
362  {
364  m_spi.end();
365  }
366 
367 private:
368  InterfaceIL9163<I> m_spi;
369 };
370 #include "lcd_il9163.inl"
371 
uint8_t lcduint_t
Definition: canvas_types.h:81
void spiDataMode(uint8_t mode)
Definition: lcd_il9163.inl:75
DisplayIL9163_128x128x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:165
DisplayIL9163x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:134
void setRotation(uint8_t rotation)
Sets screen orientation (rotation)
Definition: lcd_il9163.inl:94
void commandStart()
Definition: lcd_il9163.inl:84
DisplayIL9163_128x160x16(I &intf, int8_t rstPin)
Definition: lcd_il9163.h:274
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:194
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:36
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:303
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:344
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:235
InterfaceIL9163(NanoDisplayBase< InterfaceIL9163< I >> &base, int8_t dc, Args &&... data)
Definition: lcd_il9163.h:55
int8_t m_rstPin
indicates hardware reset pin used, -1 if it is not required
Definition: lcd_il9163.h:139