37 lcduint_t rx = w ? (x + w - 1) : (m_base.width() - 1);
42 this->send(x + m_offset_x);
44 this->send( (rx < m_base.width() ? rx : (m_base.width() - 1)) + m_offset_x);
49 this->send( y + m_offset_y );
51 this->send( m_base.height() - 1 + m_offset_y);
96 if ( (rotation ^ m_rotation) & 0x01 )
98 m_base.swapDimensions();
100 m_offset_x = m_offset_y;
103 m_rotation = (rotation & 0x03);
109 switch ( m_rotation )
112 ram_mode = 0b00000000;
115 ram_mode = 0b01100000;
118 ram_mode = 0b11000000;
121 ram_mode = 0b10100000;
124 this->send(ram_mode | m_rgb_bit);
132 if (m_rotation & 0x01)
146 this->m_rgb_bit = mode ? 0b00001000: 0b00000000;
147 this->setRotation( m_rotation );
163 static const PROGMEM uint8_t s_ST7735_lcd128x128x16_initData[] = {
165 SDL_LCD_ST7735, 0x00,
168 0x01, CMD_DELAY, 150,
169 0x11, CMD_DELAY, 255,
170 0xB1, 0x03, 0x01, 0x2C, 0x2D,
171 0xB2, 0x03, 0x01, 0x2C, 0x2D,
176 0xB6, 0x02, 0x15, 0x02,
177 0xC0, 0x03, 0xA2, 0x02, 0x84,
179 0xC2, 0x02, 0x0A, 0x00,
180 0xC3, 0x02, 0x8A, 0x2A,
181 0xC4, 0x02, 0x8A, 0xEE,
185 0x36, 0x01, 0b00000000,
190 0x0F, 0x1A, 0x0F, 0x18,
191 0x2F, 0x28, 0x20, 0x22,
192 0x1F, 0x1B, 0x23, 0x37,
193 0x00, 0x07, 0x02, 0x10,
195 0x0F, 0x1B, 0x0F, 0x17,
196 0x33, 0x2C, 0x29, 0x2E,
197 0x30, 0x30, 0x39, 0x3F,
198 0x00, 0x07, 0x03, 0x10,
202 0x29, CMD_DELAY, 100,
217 _configureSpiDisplay<I>(this->m_intf,
218 s_ST7735_lcd128x128x16_initData,
219 sizeof(s_ST7735_lcd128x128x16_initData));
227 static const PROGMEM uint8_t s_ST7735_lcd80x160x16_initData[] = {
229 SDL_LCD_ST7735, 0x00,
232 0x01, CMD_DELAY, 150,
233 0x11, CMD_DELAY, 255,
234 0xB1, 0x03, 0x01, 0x2C, 0x2D,
235 0xB2, 0x03, 0x01, 0x2C, 0x2D,
240 0xB6, 0x02, 0x15, 0x02,
241 0xC0, 0x03, 0xA2, 0x02, 0x84,
243 0xC2, 0x02, 0x0A, 0x00,
244 0xC3, 0x02, 0x8A, 0x2A,
245 0xC4, 0x02, 0x8A, 0xEE,
249 0x36, 0x01, 0b00000000,
254 0x0F, 0x1A, 0x0F, 0x18,
255 0x2F, 0x28, 0x20, 0x22,
256 0x1F, 0x1B, 0x23, 0x37,
257 0x00, 0x07, 0x02, 0x10,
259 0x0F, 0x1B, 0x0F, 0x17,
260 0x33, 0x2C, 0x29, 0x2E,
261 0x30, 0x30, 0x39, 0x3F,
262 0x00, 0x07, 0x03, 0x10,
266 0x29, CMD_DELAY, 100,
281 _configureSpiDisplay<I>(this->m_intf,
282 s_ST7735_lcd80x160x16_initData,
283 sizeof(s_ST7735_lcd80x160x16_initData));
284 this->m_intf.setOffset( 26, 0 );
291 static const PROGMEM uint8_t s_ST7735_lcd128x160x16_initData[] = {
293 SDL_LCD_ST7735, 0x00,
296 0x01, CMD_DELAY, 150,
297 0x11, CMD_DELAY, 255,
298 0xB1, 0x03, 0x01, 0x2C, 0x2D,
299 0xB2, 0x03, 0x01, 0x2C, 0x2D,
304 0xB6, 0x02, 0x15, 0x02,
305 0xC0, 0x03, 0xA2, 0x02, 0x84,
307 0xC2, 0x02, 0x0A, 0x00,
308 0xC3, 0x02, 0x8A, 0x2A,
309 0xC4, 0x02, 0x8A, 0xEE,
313 0x36, 0x01, 0b00000000,
318 0x0F, 0x1A, 0x0F, 0x18,
319 0x2F, 0x28, 0x20, 0x22,
320 0x1F, 0x1B, 0x23, 0x37,
321 0x00, 0x07, 0x02, 0x10,
323 0x0F, 0x1B, 0x0F, 0x17,
324 0x33, 0x2C, 0x29, 0x2E,
325 0x30, 0x30, 0x39, 0x3F,
326 0x00, 0x07, 0x03, 0x10,
330 0x29, CMD_DELAY, 100,
345 _configureSpiDisplay<I>(this->m_intf,
346 s_ST7735_lcd128x160x16_initData,
347 sizeof(s_ST7735_lcd128x160x16_initData));
void endBlock()
Closes data send operation to lcd display.
uint8_t lcduint_t
internal int type, used by the library.
void beginController()
Basic ST7735 128x128x16 initialization.
void lcd_gpioWrite(int pin, int level)
Writes value to gpio.
void setDataMode(uint8_t mode)
Enables either data or command mode on SPI bus.
void commandStart()
Starts communication with LCD display in command mode.
int8_t lcdint_t
internal int type, used by the library.
void beginController()
Basic ST7735 128x160x16 initialization.
SSD1306 HAL IO communication functions.
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 setRotation(uint8_t rotation)
Sets screen orientation (rotation)
void startBlock(lcduint_t x, lcduint_t y, lcduint_t w)
Sets block in RAM of lcd display controller to write data to.
void endController()
Basic ST7735 deinitialization.
#define LCD_LOW
Constant corresponds to low level of gpio pin.
Basic structures of nano gfx library.
void endController()
Basic ST7735 deinitialization.
void setRgbMode(uint8_t mode)
Sets RGB mode used by display controller.
void beginController()
Basic ST7735 80x160x16 initialization.
void endController()
Basic ST7735 deinitialization.
void endDisplay()
Basic ST7735 deinitialization.
void beginDisplay()
Basic ST7735 initialization.
#define LCD_HIGH
Constant corresponds to high level of gpio pin.
void nextBlock()
Switches to the start of next RAM page for the block, specified by startBlock().
void lcd_delay(unsigned long ms)
Forces current thread to sleeps for specified number of milliseconds.