ESPHome  2021.11.3
st7735.cpp
Go to the documentation of this file.
1 #include "st7735.h"
2 #include "esphome/core/log.h"
3 #include "esphome/core/helpers.h"
4 #include "esphome/core/hal.h"
5 
6 namespace esphome {
7 namespace st7735 {
8 
9 static const uint8_t ST_CMD_DELAY = 0x80; // special signifier for command lists
10 
11 static const uint8_t ST77XX_NOP = 0x00;
12 static const uint8_t ST77XX_SWRESET = 0x01;
13 static const uint8_t ST77XX_RDDID = 0x04;
14 static const uint8_t ST77XX_RDDST = 0x09;
15 
16 static const uint8_t ST77XX_SLPIN = 0x10;
17 static const uint8_t ST77XX_SLPOUT = 0x11;
18 static const uint8_t ST77XX_PTLON = 0x12;
19 static const uint8_t ST77XX_NORON = 0x13;
20 
21 static const uint8_t ST77XX_INVOFF = 0x20;
22 static const uint8_t ST77XX_INVON = 0x21;
23 static const uint8_t ST77XX_DISPOFF = 0x28;
24 static const uint8_t ST77XX_DISPON = 0x29;
25 static const uint8_t ST77XX_CASET = 0x2A;
26 static const uint8_t ST77XX_RASET = 0x2B;
27 static const uint8_t ST77XX_RAMWR = 0x2C;
28 static const uint8_t ST77XX_RAMRD = 0x2E;
29 
30 static const uint8_t ST77XX_PTLAR = 0x30;
31 static const uint8_t ST77XX_TEOFF = 0x34;
32 static const uint8_t ST77XX_TEON = 0x35;
33 static const uint8_t ST77XX_MADCTL = 0x36;
34 static const uint8_t ST77XX_COLMOD = 0x3A;
35 
36 static const uint8_t ST77XX_MADCTL_MY = 0x80;
37 static const uint8_t ST77XX_MADCTL_MX = 0x40;
38 static const uint8_t ST77XX_MADCTL_MV = 0x20;
39 static const uint8_t ST77XX_MADCTL_ML = 0x10;
40 static const uint8_t ST77XX_MADCTL_RGB = 0x00;
41 
42 static const uint8_t ST77XX_RDID1 = 0xDA;
43 static const uint8_t ST77XX_RDID2 = 0xDB;
44 static const uint8_t ST77XX_RDID3 = 0xDC;
45 static const uint8_t ST77XX_RDID4 = 0xDD;
46 
47 // Some register settings
48 static const uint8_t ST7735_MADCTL_BGR = 0x08;
49 
50 static const uint8_t ST7735_MADCTL_MH = 0x04;
51 
52 static const uint8_t ST7735_FRMCTR1 = 0xB1;
53 static const uint8_t ST7735_FRMCTR2 = 0xB2;
54 static const uint8_t ST7735_FRMCTR3 = 0xB3;
55 static const uint8_t ST7735_INVCTR = 0xB4;
56 static const uint8_t ST7735_DISSET5 = 0xB6;
57 
58 static const uint8_t ST7735_PWCTR1 = 0xC0;
59 static const uint8_t ST7735_PWCTR2 = 0xC1;
60 static const uint8_t ST7735_PWCTR3 = 0xC2;
61 static const uint8_t ST7735_PWCTR4 = 0xC3;
62 static const uint8_t ST7735_PWCTR5 = 0xC4;
63 static const uint8_t ST7735_VMCTR1 = 0xC5;
64 
65 static const uint8_t ST7735_PWCTR6 = 0xFC;
66 
67 static const uint8_t ST7735_GMCTRP1 = 0xE0;
68 static const uint8_t ST7735_GMCTRN1 = 0xE1;
69 
70 // clang-format off
71 static const uint8_t PROGMEM
72  BCMD[] = { // Init commands for 7735B screens
73  18, // 18 commands in list:
74  ST77XX_SWRESET, ST_CMD_DELAY, // 1: Software reset, no args, w/delay
75  50, // 50 ms delay
76  ST77XX_SLPOUT, ST_CMD_DELAY, // 2: Out of sleep mode, no args, w/delay
77  255, // 255 = max (500 ms) delay
78  ST77XX_COLMOD, 1+ST_CMD_DELAY, // 3: Set color mode, 1 arg + delay:
79  0x05, // 16-bit color
80  10, // 10 ms delay
81  ST7735_FRMCTR1, 3+ST_CMD_DELAY, // 4: Frame rate control, 3 args + delay:
82  0x00, // fastest refresh
83  0x06, // 6 lines front porch
84  0x03, // 3 lines back porch
85  10, // 10 ms delay
86  ST77XX_MADCTL, 1, // 5: Mem access ctl (directions), 1 arg:
87  0x08, // Row/col addr, bottom-top refresh
88  ST7735_DISSET5, 2, // 6: Display settings #5, 2 args:
89  0x15, // 1 clk cycle nonoverlap, 2 cycle gate
90  // rise, 3 cycle osc equalize
91  0x02, // Fix on VTL
92  ST7735_INVCTR, 1, // 7: Display inversion control, 1 arg:
93  0x0, // Line inversion
94  ST7735_PWCTR1, 2+ST_CMD_DELAY, // 8: Power control, 2 args + delay:
95  0x02, // GVDD = 4.7V
96  0x70, // 1.0uA
97  10, // 10 ms delay
98  ST7735_PWCTR2, 1, // 9: Power control, 1 arg, no delay:
99  0x05, // VGH = 14.7V, VGL = -7.35V
100  ST7735_PWCTR3, 2, // 10: Power control, 2 args, no delay:
101  0x01, // Opamp current small
102  0x02, // Boost frequency
103  ST7735_VMCTR1, 2+ST_CMD_DELAY, // 11: Power control, 2 args + delay:
104  0x3C, // VCOMH = 4V
105  0x38, // VCOML = -1.1V
106  10, // 10 ms delay
107  ST7735_PWCTR6, 2, // 12: Power control, 2 args, no delay:
108  0x11, 0x15,
109  ST7735_GMCTRP1,16, // 13: Gamma Adjustments (pos. polarity), 16 args + delay:
110  0x09, 0x16, 0x09, 0x20, // (Not entirely necessary, but provides
111  0x21, 0x1B, 0x13, 0x19, // accurate colors)
112  0x17, 0x15, 0x1E, 0x2B,
113  0x04, 0x05, 0x02, 0x0E,
114  ST7735_GMCTRN1,16+ST_CMD_DELAY, // 14: Gamma Adjustments (neg. polarity), 16 args + delay:
115  0x0B, 0x14, 0x08, 0x1E, // (Not entirely necessary, but provides
116  0x22, 0x1D, 0x18, 0x1E, // accurate colors)
117  0x1B, 0x1A, 0x24, 0x2B,
118  0x06, 0x06, 0x02, 0x0F,
119  10, // 10 ms delay
120  ST77XX_CASET, 4, // 15: Column addr set, 4 args, no delay:
121  0x00, 0x02, // XSTART = 2
122  0x00, 0x81, // XEND = 129
123  ST77XX_RASET, 4, // 16: Row addr set, 4 args, no delay:
124  0x00, 0x02, // XSTART = 1
125  0x00, 0x81, // XEND = 160
126  ST77XX_NORON, ST_CMD_DELAY, // 17: Normal display on, no args, w/delay
127  10, // 10 ms delay
128  ST77XX_DISPON, ST_CMD_DELAY, // 18: Main screen turn on, no args, delay
129  255 }, // 255 = max (500 ms) delay
130 
131  RCMD1[] = { // 7735R init, part 1 (red or green tab)
132  15, // 15 commands in list:
133  ST77XX_SWRESET, ST_CMD_DELAY, // 1: Software reset, 0 args, w/delay
134  150, // 150 ms delay
135  ST77XX_SLPOUT, ST_CMD_DELAY, // 2: Out of sleep mode, 0 args, w/delay
136  255, // 500 ms delay
137  ST7735_FRMCTR1, 3, // 3: Framerate ctrl - normal mode, 3 arg:
138  0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
139  ST7735_FRMCTR2, 3, // 4: Framerate ctrl - idle mode, 3 args:
140  0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
141  ST7735_FRMCTR3, 6, // 5: Framerate - partial mode, 6 args:
142  0x01, 0x2C, 0x2D, // Dot inversion mode
143  0x01, 0x2C, 0x2D, // Line inversion mode
144  ST7735_INVCTR, 1, // 6: Display inversion ctrl, 1 arg:
145  0x07, // No inversion
146  ST7735_PWCTR1, 3, // 7: Power control, 3 args, no delay:
147  0xA2,
148  0x02, // -4.6V
149  0x84, // AUTO mode
150  ST7735_PWCTR2, 1, // 8: Power control, 1 arg, no delay:
151  0xC5, // VGH25=2.4C VGSEL=-10 VGH=3 * AVDD
152  ST7735_PWCTR3, 2, // 9: Power control, 2 args, no delay:
153  0x0A, // Opamp current small
154  0x00, // Boost frequency
155  ST7735_PWCTR4, 2, // 10: Power control, 2 args, no delay:
156  0x8A, // BCLK/2,
157  0x2A, // opamp current small & medium low
158  ST7735_PWCTR5, 2, // 11: Power control, 2 args, no delay:
159  0x8A, 0xEE,
160  ST7735_VMCTR1, 1, // 12: Power control, 1 arg, no delay:
161  0x0E,
162  ST77XX_INVOFF, 0, // 13: Don't invert display, no args
163  ST77XX_MADCTL, 1, // 14: Mem access ctl (directions), 1 arg:
164  0xC8, // row/col addr, bottom-top refresh
165  ST77XX_COLMOD, 1, // 15: set color mode, 1 arg, no delay:
166  0x05 }, // 16-bit color
167 
168  RCMD2GREEN[] = { // 7735R init, part 2 (green tab only)
169  2, // 2 commands in list:
170  ST77XX_CASET, 4, // 1: Column addr set, 4 args, no delay:
171  0x00, 0x02, // XSTART = 0
172  0x00, 0x7F+0x02, // XEND = 127
173  ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
174  0x00, 0x01, // XSTART = 0
175  0x00, 0x9F+0x01 }, // XEND = 159
176 
177  RCMD2RED[] = { // 7735R init, part 2 (red tab only)
178  2, // 2 commands in list:
179  ST77XX_CASET, 4, // 1: Column addr set, 4 args, no delay:
180  0x00, 0x00, // XSTART = 0
181  0x00, 0x7F, // XEND = 127
182  ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
183  0x00, 0x00, // XSTART = 0
184  0x00, 0x9F }, // XEND = 159
185 
186  RCMD2GREEN144[] = { // 7735R init, part 2 (green 1.44 tab)
187  2, // 2 commands in list:
188  ST77XX_CASET, 4, // 1: Column addr set, 4 args, no delay:
189  0x00, 0x00, // XSTART = 0
190  0x00, 0x7F, // XEND = 127
191  ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
192  0x00, 0x00, // XSTART = 0
193  0x00, 0x7F }, // XEND = 127
194 
195  RCMD2GREEN160X80[] = { // 7735R init, part 2 (mini 160x80)
196  2, // 2 commands in list:
197  ST77XX_CASET, 4, // 1: Column addr set, 4 args, no delay:
198  0x00, 0x00, // XSTART = 0
199  0x00, 0x4F, // XEND = 79
200  ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
201  0x00, 0x00, // XSTART = 0
202  0x00, 0x9F }, // XEND = 159
203 
204  RCMD3[] = { // 7735R init, part 3 (red or green tab)
205  4, // 4 commands in list:
206  ST7735_GMCTRP1, 16 , // 1: Gamma Adjustments (pos. polarity), 16 args + delay:
207  0x02, 0x1c, 0x07, 0x12, // (Not entirely necessary, but provides
208  0x37, 0x32, 0x29, 0x2d, // accurate colors)
209  0x29, 0x25, 0x2B, 0x39,
210  0x00, 0x01, 0x03, 0x10,
211  ST7735_GMCTRN1, 16 , // 2: Gamma Adjustments (neg. polarity), 16 args + delay:
212  0x03, 0x1d, 0x07, 0x06, // (Not entirely necessary, but provides
213  0x2E, 0x2C, 0x29, 0x2D, // accurate colors)
214  0x2E, 0x2E, 0x37, 0x3F,
215  0x00, 0x00, 0x02, 0x10,
216  ST77XX_NORON, ST_CMD_DELAY, // 3: Normal display on, no args, w/delay
217  10, // 10 ms delay
218  ST77XX_DISPON, ST_CMD_DELAY, // 4: Main screen turn on, no args w/delay
219  100 }; // 100 ms delay
220 
221 // clang-format on
222 static const char *const TAG = "st7735";
223 
224 ST7735::ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, bool eightbitcolor, bool usebgr,
225  bool invert_colors)
226  : model_(model),
227  colstart_(colstart),
228  rowstart_(rowstart),
229  eightbitcolor_(eightbitcolor),
230  usebgr_(usebgr),
231  invert_colors_(invert_colors),
232  width_(width),
233  height_(height) {}
234 
236  ESP_LOGCONFIG(TAG, "Setting up ST7735...");
237  this->spi_setup();
238 
239  this->dc_pin_->setup(); // OUTPUT
240  this->cs_->setup(); // OUTPUT
241 
242  this->dc_pin_->digital_write(true);
243  this->cs_->digital_write(true);
244 
245  this->init_reset_();
246  delay(100); // NOLINT
247 
248  ESP_LOGD(TAG, " START");
249  dump_config();
250  ESP_LOGD(TAG, " END");
251 
252  display_init_(RCMD1);
253 
254  if (this->model_ == INITR_GREENTAB) {
255  display_init_(RCMD2GREEN);
256  colstart_ == 0 ? colstart_ = 2 : colstart_;
257  rowstart_ == 0 ? rowstart_ = 1 : rowstart_;
258  } else if ((this->model_ == INITR_144GREENTAB) || (this->model_ == INITR_HALLOWING)) {
259  height_ == 0 ? height_ = ST7735_TFTHEIGHT_128 : height_;
260  width_ == 0 ? width_ = ST7735_TFTWIDTH_128 : width_;
261  display_init_(RCMD2GREEN144);
262  colstart_ == 0 ? colstart_ = 2 : colstart_;
263  rowstart_ == 0 ? rowstart_ = 3 : rowstart_;
264  } else if (this->model_ == INITR_MINI_160X80) {
265  height_ == 0 ? height_ = ST7735_TFTHEIGHT_160 : height_;
266  width_ == 0 ? width_ = ST7735_TFTWIDTH_80 : width_;
267  display_init_(RCMD2GREEN160X80);
268  colstart_ = 24;
269  rowstart_ = 0; // For default rotation 0
270  } else {
271  // colstart, rowstart left at default '0' values
272  display_init_(RCMD2RED);
273  }
274  display_init_(RCMD3);
275 
276  uint8_t data = 0;
277  if (this->model_ != INITR_HALLOWING) {
278  uint8_t data = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY;
279  }
280  if (this->usebgr_) {
281  data = data | ST7735_MADCTL_BGR;
282  } else {
283  data = data | ST77XX_MADCTL_RGB;
284  }
285  sendcommand_(ST77XX_MADCTL, &data, 1);
286 
287  if (this->invert_colors_)
288  sendcommand_(ST77XX_INVON, nullptr, 0);
289 
290  this->init_internal_(this->get_buffer_length());
291  memset(this->buffer_, 0x00, this->get_buffer_length());
292 }
293 
295  this->do_update_();
296  this->write_display_data_();
297 }
298 
300 
302 
304  if (this->eightbitcolor_) {
305  return size_t(this->get_width_internal()) * size_t(this->get_height_internal());
306  }
307  return size_t(this->get_width_internal()) * size_t(this->get_height_internal()) * 2;
308 }
309 
310 void HOT ST7735::draw_absolute_pixel_internal(int x, int y, Color color) {
311  if (x >= this->get_width_internal() || x < 0 || y >= this->get_height_internal() || y < 0)
312  return;
313 
314  if (this->eightbitcolor_) {
315  const uint32_t color332 = display::ColorUtil::color_to_332(color);
316  uint16_t pos = (x + y * this->get_width_internal());
317  this->buffer_[pos] = color332;
318  } else {
319  const uint32_t color565 = display::ColorUtil::color_to_565(color);
320  uint16_t pos = (x + y * this->get_width_internal()) * 2;
321  this->buffer_[pos++] = (color565 >> 8) & 0xff;
322  this->buffer_[pos] = color565 & 0xff;
323  }
324 }
325 
327  if (this->reset_pin_ != nullptr) {
328  this->reset_pin_->setup();
329  this->reset_pin_->digital_write(true);
330  delay(1);
331  // Trigger Reset
332  this->reset_pin_->digital_write(false);
333  delay(10);
334  // Wake up
335  this->reset_pin_->digital_write(true);
336  }
337 }
338 const char *ST7735::model_str_() {
339  switch (this->model_) {
340  case INITR_GREENTAB:
341  return "ST7735 GREENTAB";
342  case INITR_REDTAB:
343  return "ST7735 REDTAB";
344  case INITR_BLACKTAB:
345  return "ST7735 BLACKTAB";
346  case INITR_MINI_160X80:
347  return "ST7735 MINI160x80";
348  default:
349  return "Unknown";
350  }
351 }
352 
353 void ST7735::display_init_(const uint8_t *addr) {
354  uint8_t num_commands, cmd, num_args;
355  uint16_t ms;
356 
357  num_commands = progmem_read_byte(addr++); // Number of commands to follow
358  while (num_commands--) { // For each command...
359  cmd = progmem_read_byte(addr++); // Read command
360  num_args = progmem_read_byte(addr++); // Number of args to follow
361  ms = num_args & ST_CMD_DELAY; // If hibit set, delay follows args
362  num_args &= ~ST_CMD_DELAY; // Mask out delay bit
363  this->sendcommand_(cmd, addr, num_args);
364  addr += num_args;
365 
366  if (ms) {
367  ms = progmem_read_byte(addr++); // Read post-command delay time (ms)
368  if (ms == 255)
369  ms = 500; // If 255, delay for 500 ms
370  delay(ms);
371  }
372  }
373 }
374 
376  LOG_DISPLAY("", "ST7735", this);
377  ESP_LOGCONFIG(TAG, " Model: %s", this->model_str_());
378  LOG_PIN(" CS Pin: ", this->cs_);
379  LOG_PIN(" DC Pin: ", this->dc_pin_);
380  LOG_PIN(" Reset Pin: ", this->reset_pin_);
381  ESP_LOGD(TAG, " Buffer Size: %zu", this->get_buffer_length());
382  ESP_LOGD(TAG, " Height: %d", this->height_);
383  ESP_LOGD(TAG, " Width: %d", this->width_);
384  ESP_LOGD(TAG, " ColStart: %d", this->colstart_);
385  ESP_LOGD(TAG, " RowStart: %d", this->rowstart_);
386  LOG_UPDATE_INTERVAL(this);
387 }
388 
389 void HOT ST7735::writecommand_(uint8_t value) {
390  this->enable();
391  this->dc_pin_->digital_write(false);
392  this->write_byte(value);
393  this->dc_pin_->digital_write(true);
394  this->disable();
395 }
396 
397 void HOT ST7735::writedata_(uint8_t value) {
398  this->dc_pin_->digital_write(true);
399  this->enable();
400  this->write_byte(value);
401  this->disable();
402 }
403 
404 void HOT ST7735::sendcommand_(uint8_t cmd, const uint8_t *data_bytes, uint8_t num_data_bytes) {
405  this->writecommand_(cmd);
406  this->senddata_(data_bytes, num_data_bytes);
407 }
408 
409 void HOT ST7735::senddata_(const uint8_t *data_bytes, uint8_t num_data_bytes) {
410  this->dc_pin_->digital_write(true); // pull DC high to indicate data
411  this->cs_->digital_write(false);
412  this->enable();
413  for (uint8_t i = 0; i < num_data_bytes; i++) {
414  this->write_byte(progmem_read_byte(data_bytes++)); // write byte - SPI library
415  }
416  this->cs_->digital_write(true);
417  this->disable();
418 }
419 
421  uint16_t offsetx = colstart_;
422  uint16_t offsety = rowstart_;
423 
424  uint16_t x1 = offsetx;
425  uint16_t x2 = x1 + get_width_internal() - 1;
426  uint16_t y1 = offsety;
427  uint16_t y2 = y1 + get_height_internal() - 1;
428 
429  this->enable();
430 
431  // set column(x) address
432  this->dc_pin_->digital_write(false);
433  this->write_byte(ST77XX_CASET);
434  this->dc_pin_->digital_write(true);
435  this->spi_master_write_addr_(x1, x2);
436 
437  // set Page(y) address
438  this->dc_pin_->digital_write(false);
439  this->write_byte(ST77XX_RASET);
440  this->dc_pin_->digital_write(true);
441  this->spi_master_write_addr_(y1, y2);
442 
443  // Memory Write
444  this->dc_pin_->digital_write(false);
445  this->write_byte(ST77XX_RAMWR);
446  this->dc_pin_->digital_write(true);
447 
448  if (this->eightbitcolor_) {
449  for (int line = 0; line < this->get_buffer_length(); line = line + this->get_width_internal()) {
450  for (int index = 0; index < this->get_width_internal(); ++index) {
453 
454  auto color = display::ColorUtil::color_to_565(color332);
455 
456  this->write_byte((color >> 8) & 0xff);
457  this->write_byte(color & 0xff);
458  }
459  }
460  } else {
461  this->write_array(this->buffer_, this->get_buffer_length());
462  }
463  this->disable();
464 }
465 
466 void ST7735::spi_master_write_addr_(uint16_t addr1, uint16_t addr2) {
467  static uint8_t byte[4];
468  byte[0] = (addr1 >> 8) & 0xFF;
469  byte[1] = addr1 & 0xFF;
470  byte[2] = (addr2 >> 8) & 0xFF;
471  byte[3] = addr2 & 0xFF;
472 
473  this->dc_pin_->digital_write(true);
474  this->write_array(byte, 4);
475 }
476 
477 void ST7735::spi_master_write_color_(uint16_t color, uint16_t size) {
478  static uint8_t byte[1024];
479  int index = 0;
480  for (int i = 0; i < size; i++) {
481  byte[index++] = (color >> 8) & 0xFF;
482  byte[index++] = color & 0xFF;
483  }
484 
485  this->dc_pin_->digital_write(true);
486  return write_array(byte, size * 2);
487 }
488 
489 } // namespace st7735
490 } // namespace esphome
virtual void digital_write(bool value)=0
void senddata_(const uint8_t *data_bytes, uint8_t num_data_bytes)
Definition: st7735.cpp:409
void update() override
Definition: st7735.cpp:294
void dump_config() override
Definition: st7735.cpp:375
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, bool eightbitcolor, bool usebgr, bool invert_colors)
Definition: st7735.cpp:224
virtual void setup()=0
GPIOPin * reset_pin_
Definition: st7735.h:84
void init_internal_(uint32_t buffer_length)
void line(int x1, int y1, int x2, int y2, Color color=COLOR_ON)
Draw a straight line from the point [x1,y1] to [x2,y2] with the given color.
const float BME680_GAS_LOOKUP_TABLE_1 [16] PROGMEM
Definition: bme680.cpp:25
const char * model_str_()
Definition: st7735.cpp:338
static uint8_t color_to_332(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void spi_master_write_color_(uint16_t color, uint16_t size)
Definition: st7735.cpp:477
void spi_master_write_addr_(uint16_t addr1, uint16_t addr2)
Definition: st7735.cpp:466
void sendcommand_(uint8_t cmd, const uint8_t *data_bytes, uint8_t num_data_bytes)
Definition: st7735.cpp:404
void writedata_(uint8_t value)
Definition: st7735.cpp:397
void setup() override
Definition: st7735.cpp:235
void draw_absolute_pixel_internal(int x, int y, Color color) override
Definition: st7735.cpp:310
uint8_t progmem_read_byte(const uint8_t *addr)
Definition: core.cpp:51
int get_width_internal() override
Definition: st7735.cpp:301
void writecommand_(uint8_t value)
Definition: st7735.cpp:389
Library based on https://github.com/miguelbalboa/rfid and adapted to ESPHome by . ...
Definition: a4988.cpp:4
static Color to_color(uint32_t colorcode, ColorOrder color_order, ColorBitness color_bitness=ColorBitness::COLOR_BITNESS_888, bool right_bit_aligned=true)
size_t get_buffer_length()
Definition: st7735.cpp:303
void display_init_(const uint8_t *addr)
Definition: st7735.cpp:353
int get_height_internal() override
Definition: st7735.cpp:299
ST7735Model model_
Definition: st7735.h:77
GPIOPin * dc_pin_
Definition: st7735.h:85
void IRAM_ATTR HOT delay(uint32_t ms)
Definition: core.cpp:22