37 lcduint_t rx = x + (w ? w : m_base.width()) - 1;
43 this->send(pos & 0xFF);
44 pos = rx + m_offset_x;
46 this->send(pos & 0xFF);
52 this->send(pos & 0xFF);
53 pos = m_base.height() - 1 + m_offset_y;
55 this->send(pos & 0xFF);
100 if ( (rotation ^ m_rotation) & 0x01 )
102 m_base.swapDimensions();
104 m_offset_x = m_offset_y;
107 if ( (rotation ^ m_rotation) == 0x01 || (rotation ^ m_rotation) == 0x11 )
110 if ( (m_base.width() & 0x01) || (m_base.height() & 0x01) )
131 m_rotation = (rotation & 0x03);
137 switch ( m_rotation )
140 ram_mode = 0b00000000;
143 ram_mode = 0b01100000;
146 ram_mode = 0b11000000;
149 ram_mode = 0b10100000;
152 this->send(ram_mode | m_rgb_bit);
160 if (m_rotation & 0x01)
185 static const PROGMEM uint8_t s_ST7789_lcd135x240x16_initData[] = {
187 SDL_LCD_ST7789, 0x00,
190 0x01, CMD_DELAY, 150,
194 0x36, 0x01, 0b00001000,
195 0xB6, 0x02, 0x0A, 0x82,
196 0xB2, 0x05, 0x0C, 0x0C, 0x00, 0x33, 0x33,
200 0xC2, 0x02, 0x01, 0xFF,
204 0xD0, 0x02, 0xA4, 0xA1,
206 0xD0, 0x00, 0x02, 0x07,
207 0x0A, 0x28, 0x32, 0x44,
208 0x42, 0x06, 0x0E, 0x12,
211 0xD0, 0x00, 0x02, 0x07,
212 0x0A, 0x28, 0x31, 0x54,
213 0x47, 0x0E, 0x1C, 0x17,
218 0x29, CMD_DELAY, 120,
232 _configureSpiDisplay<I>(this->m_intf,
233 s_ST7789_lcd135x240x16_initData,
234 sizeof(s_ST7789_lcd135x240x16_initData));
242 static const PROGMEM uint8_t s_ST7789_lcd240x240x16_initData[] = {
244 SDL_LCD_ST7789, 0x00,
247 0x01, CMD_DELAY, 150,
251 0x36, 0x01, 0b00001000,
252 0xB6, 0x02, 0x0A, 0x82,
253 0xB2, 0x05, 0x0C, 0x0C, 0x00, 0x33, 0x33,
257 0xC2, 0x02, 0x01, 0xFF,
261 0xD0, 0x02, 0xA4, 0xA1,
263 0xD0, 0x00, 0x02, 0x07,
264 0x0A, 0x28, 0x32, 0x44,
265 0x42, 0x06, 0x0E, 0x12,
268 0xD0, 0x00, 0x02, 0x07,
269 0x0A, 0x28, 0x31, 0x54,
270 0x47, 0x0E, 0x1C, 0x17,
275 0x29, CMD_DELAY, 120,
289 _configureSpiDisplay<I>(this->m_intf,
290 s_ST7789_lcd240x240x16_initData,
291 sizeof(s_ST7789_lcd240x240x16_initData));
void startBlock(lcduint_t x, lcduint_t y, lcduint_t w)
Sets block in RAM of lcd display controller to write data to.
void lcd_gpioWrite(int pin, int level)
void setRotation(uint8_t rotation)
Sets screen orientation (rotation)
void setDataMode(uint8_t mode)
void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
void setOffset(lcdint_t ox, lcdint_t oy)
Sets display offset in GDRAM memory.
void lcd_delay(unsigned long ms)