6 namespace ssd1351_base {
8 static const char *
const TAG =
"ssd1351";
10 static const uint16_t SSD1351_COLORMASK = 0xffff;
11 static const uint8_t SSD1351_MAX_CONTRAST = 15;
12 static const uint8_t SSD1351_BYTESPERPIXEL = 2;
14 static const uint8_t SSD1351_SETCOLUMN = 0x15;
15 static const uint8_t SSD1351_SETROW = 0x75;
16 static const uint8_t SSD1351_SETREMAP = 0xA0;
17 static const uint8_t SSD1351_STARTLINE = 0xA1;
18 static const uint8_t SSD1351_DISPLAYOFFSET = 0xA2;
19 static const uint8_t SSD1351_DISPLAYOFF = 0xAE;
20 static const uint8_t SSD1351_DISPLAYON = 0xAF;
21 static const uint8_t SSD1351_PRECHARGE = 0xB1;
22 static const uint8_t SSD1351_CLOCKDIV = 0xB3;
23 static const uint8_t SSD1351_PRECHARGELEVEL = 0xBB;
24 static const uint8_t SSD1351_VCOMH = 0xBE;
26 static const uint8_t SSD1351_DISPLAYALLOFF = 0xA4;
27 static const uint8_t SSD1351_DISPLAYALLON = 0xA5;
28 static const uint8_t SSD1351_NORMALDISPLAY = 0xA6;
29 static const uint8_t SSD1351_INVERTDISPLAY = 0xA7;
31 static const uint8_t SSD1351_CONTRASTABC = 0xC1;
32 static const uint8_t SSD1351_CONTRASTMASTER = 0xC7;
34 static const uint8_t SSD1351_WRITERAM = 0x5C;
35 static const uint8_t SSD1351_READRAM = 0x5D;
37 static const uint8_t SSD1351_FUNCTIONSELECT = 0xAB;
38 static const uint8_t SSD1351_DISPLAYENHANCE = 0xB2;
39 static const uint8_t SSD1351_SETVSL = 0xB4;
40 static const uint8_t SSD1351_SETGPIO = 0xB5;
41 static const uint8_t SSD1351_PRECHARGE2 = 0xB6;
42 static const uint8_t SSD1351_SETGRAY = 0xB8;
43 static const uint8_t SSD1351_USELUT = 0xB9;
44 static const uint8_t SSD1351_MUXRATIO = 0xCA;
45 static const uint8_t SSD1351_COMMANDLOCK = 0xFD;
46 static const uint8_t SSD1351_HORIZSCROLL = 0x96;
47 static const uint8_t SSD1351_STOPSCROLL = 0x9E;
48 static const uint8_t SSD1351_STARTSCROLL = 0x9F;
53 this->
command(SSD1351_COMMANDLOCK);
55 this->
command(SSD1351_COMMANDLOCK);
57 this->
command(SSD1351_DISPLAYOFF);
58 this->
command(SSD1351_CLOCKDIV);
60 this->
command(SSD1351_MUXRATIO);
62 this->
command(SSD1351_DISPLAYOFFSET);
66 this->
command(SSD1351_FUNCTIONSELECT);
68 this->
command(SSD1351_PRECHARGE);
72 this->
command(SSD1351_NORMALDISPLAY);
77 this->
command(SSD1351_PRECHARGE2);
79 this->
command(SSD1351_SETREMAP);
81 this->
command(SSD1351_STARTLINE);
83 this->
command(SSD1351_CONTRASTABC);
93 this->
command(SSD1351_SETCOLUMN);
99 this->
command(SSD1351_WRITERAM);
108 if (brightness > 1) {
110 }
else if (brightness < 0) {
119 this->
command(SSD1351_CONTRASTMASTER);
124 this->
command(SSD1351_DISPLAYON);
128 this->
command(SSD1351_DISPLAYOFF);
159 this->
buffer_[pos++] = (color565 >> 8) & 0xff;
160 this->
buffer_[pos] = color565 & 0xff;
166 this->
buffer_[i] = color565 & 0xff;
168 this->
buffer_[i] = (color565 >> 8) & 0xff;
187 return "SSD1351 128x96";
189 return "SSD1351 128x128";
virtual void digital_write(bool value)=0
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void set_brightness(float brightness)
int get_height_internal() override
const char * model_str_()
void draw_absolute_pixel_internal(int x, int y, Color color) override
virtual void write_display_data()=0
size_t get_buffer_length_()
virtual void data(uint8_t value)=0
void fill(Color color) override
void init_internal_(uint32_t buffer_length)
virtual void command(uint8_t value)=0
int get_width_internal() override
Implementation of SPI Controller mode.
void IRAM_ATTR HOT delay(uint32_t ms)