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_ssd1325.inl
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 !!! */
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 
36 {
37  lcduint_t rx = w ? (x + w - 1) : (m_base.width() - 1);
38  commandStart();
39  this->send(0x15);
40  this->send(x / 2);
41  this->send( (rx < m_base.width() ? rx : (m_base.width() - 1)) / 2 );
42  this->send(0x75);
43  this->send(y);
44  this->send(m_base.height() - 1);
45  if ( m_dc >= 0 )
46  {
47  setDataMode(1);
48  }
49  else
50  {
51  this->stop();
52  this->start();
53  this->send(0x40);
54  }
55 }
56 
57 template <class I> void InterfaceSSD1325<I>::nextBlock()
58 {
59 
60 }
61 
62 template <class I> void InterfaceSSD1325<I>::endBlock()
63 {
64  this->stop();
65 }
66 
67 template <class I> void InterfaceSSD1325<I>::setDataMode(uint8_t mode)
68 {
69  if ( m_dc >= 0 )
70  {
71  lcd_gpioWrite(m_dc, mode ? LCD_HIGH : LCD_LOW);
72  }
73 }
74 
75 template <class I> void InterfaceSSD1325<I>::commandStart()
76 {
77  this->start();
78  if ( m_dc >= 0 )
79  setDataMode(0);
80  else
81  this->send(0x00);
82 }
83 
84 
86 // SSD1325 basic 4-bit implementation
88 
89 template <class I> void DisplaySSD1325<I>::beginDisplay()
90 {
91 }
92 
93 template <class I> void DisplaySSD1325<I>::endDisplay()
94 {
95 }
96 
97 static const PROGMEM uint8_t s_SSD1325_lcd128x64_initData[] = {
98 #ifdef SDL_EMULATION
99  SDL_LCD_SSD1325, 0x00,
100  SDL_LCD_SSD1325_GENERIC, 0x00,
101 #endif
102  0xAE, 0x00, // OFF /* display off */
103  0xB3, 0x01, 0x91, // CLK
104  0xA8, 0x01, 0x3F, // multiplex 64
105  0xA2, 0x01, 0x00, // Display offset
106  0xA1, 0x01, 0x00, // Start line
107  0xAD, 0x01, 0x02, // VCOMH
108  0xA0, 0x01, 0x40 | 0x10 | (0x02 | 0x01), // REMAP: horizontal increment mode
109  0x86, 0x00, // CURRENT
110  0x81, 0x01, 0x70, // CONTRAST
111  0xB2, 0x01, 0x51, // FREQ
112  0xB1, 0x01, 0x55, // PHASE
113  0xBC, 0x01, 0x10, // PRECHARGE
114  0xBE, 0x01, 0x1C, // VCOMH voltage
115  0xA4, 0x00, // NORMAL
116 };
117 
119 // SSD1325 basic 4-bit implementation
121 
123 {
124  ssd1306_resetController2(this->m_rstPin, 10);
125  this->m_w = 128;
126  this->m_h = 64;
127  // Give LCD some time to initialize. Refer to SSD1325 datasheet
128  lcd_delay(0);
129  _configureSpiDisplayCmdModeOnly<I>(this->m_intf,
130  s_SSD1325_lcd128x64_initData,
131  sizeof(s_SSD1325_lcd128x64_initData));
132 
133 }
134 
136 {
137 }
uint8_t lcduint_t
Definition: canvas_types.h:79
void lcd_gpioWrite(int pin, int level)
void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
void setDataMode(uint8_t mode)
Definition: lcd_ssd1325.inl:67
void beginDisplay()
Definition: lcd_ssd1325.inl:89
#define LCD_LOW
Definition: io.h:175
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:35
#define LCD_HIGH
Definition: io.h:177
void lcd_delay(unsigned long ms)