6namespace ssd1351_base {
8static const char *
const TAG =
"ssd1351";
10static const uint16_t SSD1351_COLORMASK = 0xffff;
11static const uint8_t SSD1351_MAX_CONTRAST = 15;
12static const uint8_t SSD1351_BYTESPERPIXEL = 2;
14static const uint8_t SSD1351_SETCOLUMN = 0x15;
15static const uint8_t SSD1351_SETROW = 0x75;
16static const uint8_t SSD1351_SETREMAP = 0xA0;
17static const uint8_t SSD1351_STARTLINE = 0xA1;
18static const uint8_t SSD1351_DISPLAYOFFSET = 0xA2;
19static const uint8_t SSD1351_DISPLAYOFF = 0xAE;
20static const uint8_t SSD1351_DISPLAYON = 0xAF;
21static const uint8_t SSD1351_PRECHARGE = 0xB1;
22static const uint8_t SSD1351_CLOCKDIV = 0xB3;
23static const uint8_t SSD1351_PRECHARGELEVEL = 0xBB;
24static const uint8_t SSD1351_VCOMH = 0xBE;
26static const uint8_t SSD1351_DISPLAYALLOFF = 0xA4;
27static const uint8_t SSD1351_DISPLAYALLON = 0xA5;
28static const uint8_t SSD1351_NORMALDISPLAY = 0xA6;
29static const uint8_t SSD1351_INVERTDISPLAY = 0xA7;
31static const uint8_t SSD1351_CONTRASTABC = 0xC1;
32static const uint8_t SSD1351_CONTRASTMASTER = 0xC7;
34static const uint8_t SSD1351_WRITERAM = 0x5C;
35static const uint8_t SSD1351_READRAM = 0x5D;
37static const uint8_t SSD1351_FUNCTIONSELECT = 0xAB;
38static const uint8_t SSD1351_DISPLAYENHANCE = 0xB2;
39static const uint8_t SSD1351_SETVSL = 0xB4;
40static const uint8_t SSD1351_SETGPIO = 0xB5;
41static const uint8_t SSD1351_PRECHARGE2 = 0xB6;
42static const uint8_t SSD1351_SETGRAY = 0xB8;
43static const uint8_t SSD1351_USELUT = 0xB9;
44static const uint8_t SSD1351_MUXRATIO = 0xCA;
45static const uint8_t SSD1351_COMMANDLOCK = 0xFD;
46static const uint8_t SSD1351_HORIZSCROLL = 0x96;
47static const uint8_t SSD1351_STOPSCROLL = 0x9E;
48static 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";