LCDGFX LCD display driver  2.0.1
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
lcd_ssd1327.inl
1 /*
2  MIT License
3 
4  Copyright (c) 2019, 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 !!! */
25 #include "lcd_hal/io.h"
26 #ifdef SDL_EMULATION
27 #include "sdl_core.h"
28 #endif
29 #include "nano_gfx_types.h"
30 
31 #ifndef CMD_ARG
32 #define CMD_ARG 0xFF
33 #endif
34 
35 template <class I>
37 {
38  lcduint_t rx = w ? (x + w - 1) : (m_base.width() - 1);
39  commandStart();
40  this->send(0x15);
41  this->send(x / 2);
42  this->send( (rx < m_base.width() ? rx : (m_base.width() - 1)) / 2 );
43  this->send(0x75);
44  this->send(y);
45  this->send(m_base.height() - 1);
46  if (m_dc >= 0)
47  {
48  spiDataMode(1);
49  }
50  else
51  {
52  this->stop();
53  this->start();
54  this->send(0x40);
55  }
56 }
57 
58 template <class I>
60 {
61 
62 }
63 
64 template <class I>
66 {
67  this->stop();
68 }
69 
70 template <class I>
72 {
73  if ( m_dc >= 0 )
74  {
75  lcd_gpioWrite( m_dc, mode ? LCD_HIGH : LCD_LOW );
76  }
77 }
78 
79 template <class I>
81 {
82  this->start();
83  if (m_dc >= 0)
84  spiDataMode(0);
85  else
86  this->send(0x00);
87 }
88 
89 
91 // SSD1327 basic 4-bit implementation
93 
94 template <class I>
96 {
97 }
98 
99 template <class I>
101 {
102 }
103 
104 static const PROGMEM uint8_t s_SSD1327_lcd128x128_initData[] =
105 {
106 #ifdef SDL_EMULATION
107  SDL_LCD_SSD1327, 0x00,
108  SDL_LCD_SSD1327_GENERIC, 0x00,
109 #endif
110  0xFD, 0x01, 0x12, // Unlock OLED
111  0xAE, 0x00, // OFF /* display off */
112  0xA8, 0x01, 0x7F, // multiplex 128
113  0xA1, 0x01, 0x00, // Start line
114  0xA2, 0x01, 0x00, // Display offset
115  0xA0, 0x01, 0x40 | 0x10 | 0x00 | (0x02 | 0x01), // REMAP: horizontal increment mode
116  0xAB, 0x01, 0x01, // VDD internal
117  0x81, 0x01, 0x70, // CONTRAST
118  0xB1, 0x01, 0x55, // PHASE 0x51
119  0xB3, 0x01, 0x01, // CLK
120 // 0xB9, //Reload grey scale
121  0xBC, 0x01, 0x08, // PRECHARGE
122  0xBE, 0x01, 0x07, // VCOMH voltage
123  0xB6, 0x01, 0x01, // Second pre-charge
124  0xA4, 0x00, // NORMAL
125  0x2E, 0x00, // Deactivate scroll
126  0xAF, 0x00, // Display ON
127 };
128 
130 // SSD1327 basic 4-bit implementation
132 
133 template <class I>
135 {
136  ssd1306_resetController2( this->m_rstPin, 10 );
137  this->m_w = 128;
138  this->m_h = 128;
139  // Give LCD some time to initialize. Refer to SSD1327 datasheet
140  lcd_delay(0);
141  _configureSpiDisplayCmdModeOnly<I>(this->m_intf,
142  s_SSD1327_lcd128x128_initData,
143  sizeof(s_SSD1327_lcd128x128_initData));
144 }
145 
146 template <class I>
148 {
149 }
uint8_t lcduint_t
Definition: canvas_types.h:81
void lcd_gpioWrite(int pin, int level)
void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
void begin() override
Definition: lcd_ssd1327.inl:95
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_ssd1327.inl:36
void spiDataMode(uint8_t mode)
Definition: lcd_ssd1327.inl:71
void end() override
#define LCD_LOW
Definition: io.h:140
void begin() override
void end() override
#define LCD_HIGH
Definition: io.h:142
void lcd_delay(unsigned long ms)