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_ssd1325.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 // SSD1325 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_SSD1325_lcd128x64_initData[] =
105 {
106 #ifdef SDL_EMULATION
107  SDL_LCD_SSD1325, 0x00,
108  SDL_LCD_SSD1325_GENERIC, 0x00,
109 #endif
110  0xAE, 0x00, // OFF /* display off */
111  0xB3, 0x01, 0x91, // CLK
112  0xA8, 0x01, 0x3F, // multiplex 64
113  0xA2, 0x01, 0x00, // Display offset
114  0xA1, 0x01, 0x00, // Start line
115  0xAD, 0x01, 0x02, // VCOMH
116  0xA0, 0x01, 0x40 | 0x10 | 0x00 | (0x02 | 0x01), // REMAP: horizontal increment mode
117  0x86, 0x00, // CURRENT
118  0x81, 0x01, 0x70, // CONTRAST
119  0xB2, 0x01, 0x51, // FREQ
120  0xB1, 0x01, 0x55, // PHASE
121  0xBC, 0x01, 0x10, // PRECHARGE
122  0xBE, 0x01, 0x1C, // VCOMH voltage
123  0xA4, 0x00, // NORMAL
124 };
125 
127 // SSD1325 basic 4-bit implementation
129 
130 template <class I>
132 {
133  ssd1306_resetController2( this->m_rstPin, 10 );
134  this->m_w = 128;
135  this->m_h = 64;
136  // Give LCD some time to initialize. Refer to SSD1325 datasheet
137  lcd_delay(0);
138  _configureSpiDisplayCmdModeOnly<I>(this->m_intf,
139  s_SSD1325_lcd128x64_initData,
140  sizeof(s_SSD1325_lcd128x64_initData));
141 }
142 
143 template <class I>
145 {
146 }
uint8_t lcduint_t
Definition: canvas_types.h:81
void lcd_gpioWrite(int pin, int level)
void begin() override
void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
#define LCD_LOW
Definition: io.h:140
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_ssd1325.inl:36
void begin() override
Definition: lcd_ssd1325.inl:95
void end() override
#define LCD_HIGH
Definition: io.h:142
void end() override
void lcd_delay(unsigned long ms)
void spiDataMode(uint8_t mode)
Definition: lcd_ssd1325.inl:71