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)
201 static const PROGMEM uint8_t s_ST7789_lcd135x240x16_initData[] = {
203 SDL_LCD_ST7789, 0x00,
206 0x01, CMD_DELAY, 150,
210 0x36, 0x01, 0b00001000,
211 0xB6, 0x02, 0x0A, 0x82,
212 0xB2, 0x05, 0x0C, 0x0C, 0x00, 0x33, 0x33,
216 0xC2, 0x02, 0x01, 0xFF,
220 0xD0, 0x02, 0xA4, 0xA1,
222 0xD0, 0x00, 0x02, 0x07,
223 0x0A, 0x28, 0x32, 0x44,
224 0x42, 0x06, 0x0E, 0x12,
227 0xD0, 0x00, 0x02, 0x07,
228 0x0A, 0x28, 0x31, 0x54,
229 0x47, 0x0E, 0x1C, 0x17,
234 0x29, CMD_DELAY, 120,
248 _configureSpiDisplay<I>(this->m_intf,
249 s_ST7789_lcd135x240x16_initData,
250 sizeof(s_ST7789_lcd135x240x16_initData));
258 static const PROGMEM uint8_t s_ST7789_lcd240x240x16_initData[] = {
260 SDL_LCD_ST7789, 0x00,
263 0x01, CMD_DELAY, 150,
267 0x36, 0x01, 0b00001000,
268 0xB6, 0x02, 0x0A, 0x82,
269 0xB2, 0x05, 0x0C, 0x0C, 0x00, 0x33, 0x33,
273 0xC2, 0x02, 0x01, 0xFF,
277 0xD0, 0x02, 0xA4, 0xA1,
279 0xD0, 0x00, 0x02, 0x07,
280 0x0A, 0x28, 0x32, 0x44,
281 0x42, 0x06, 0x0E, 0x12,
284 0xD0, 0x00, 0x02, 0x07,
285 0x0A, 0x28, 0x31, 0x54,
286 0x47, 0x0E, 0x1C, 0x17,
291 0x29, CMD_DELAY, 120,
305 _configureSpiDisplay<I>(this->m_intf,
306 s_ST7789_lcd240x240x16_initData,
307 sizeof(s_ST7789_lcd240x240x16_initData));
308 this->m_intf.setOffset( 0, 0 );
315 static const PROGMEM uint8_t s_ST7789_lcd170x320x16_initData[] = {
317 SDL_LCD_ST7789, 0x00,
320 0x01, CMD_DELAY, 150,
324 0x36, 0x01, 0b00001000,
325 0xB6, 0x02, 0x0A, 0x82,
326 0xB2, 0x05, 0x0C, 0x0C, 0x00, 0x33, 0x33,
330 0xC2, 0x02, 0x01, 0xFF,
334 0xD0, 0x02, 0xA4, 0xA1,
336 0xD0, 0x00, 0x02, 0x07,
337 0x0A, 0x28, 0x32, 0x44,
338 0x42, 0x06, 0x0E, 0x12,
341 0xD0, 0x00, 0x02, 0x07,
342 0x0A, 0x28, 0x31, 0x54,
343 0x47, 0x0E, 0x1C, 0x17,
348 0x29, CMD_DELAY, 120,
362 _configureSpiDisplay<I>(this->m_intf,
363 s_ST7789_lcd170x320x16_initData,
364 sizeof(s_ST7789_lcd170x320x16_initData));
365 this->m_intf.setOffset( 35, 0 );
void nextBlock()
Switches to the start of next RAM page for the block, specified by startBlock().
void startBlock(lcduint_t x, lcduint_t y, lcduint_t w)
Sets block in RAM of lcd display controller to write data to.
void beginController()
Basic ST7789 240x240x16 initialization.
uint8_t lcduint_t
internal int type, used by the library.
void lcd_gpioWrite(int pin, int level)
Writes value to gpio.
void setRotation(uint8_t rotation)
Sets screen orientation (rotation)
void setDataMode(uint8_t mode)
Enables either data or command mode on SPI bus.
int8_t lcdint_t
internal int type, used by the library.
void endController()
Basic ST7789 deinitialization.
SSD1306 HAL IO communication functions.
void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
void beginController()
Basic ST7789 135x240x16 initialization.
#define LCD_LOW
Constant corresponds to low level of gpio pin.
Basic structures of nano gfx library.
void endController()
Basic ST7789 deinitialization.
void beginDisplay()
Basic ST7789 initialization.
void endBlock()
Closes data send operation to lcd display.
void endController()
Basic ST7789 deinitialization.
void invertMode()
Switches display to inverted mode (sends INVON command).
void setOffset(lcdint_t ox, lcdint_t oy)
Sets display offset in GDRAM memory.
void endDisplay()
Basic ST7789 deinitialization.
void beginController()
Basic ST7789 170x320x16 initialization.
void normalMode()
Switches display to normal mode (sends INVOFF command).
#define LCD_HIGH
Constant corresponds to high level of gpio pin.
void commandStart()
Starts communication with LCD display in command mode.
void lcd_delay(unsigned long ms)
Forces current thread to sleeps for specified number of milliseconds.