6namespace ssd1325_base {
8static const char *
const TAG =
"ssd1325";
10static const uint8_t SSD1325_MAX_CONTRAST = 127;
11static const uint8_t SSD1325_COLORMASK = 0x0f;
12static const uint8_t SSD1325_COLORSHIFT = 4;
13static const uint8_t SSD1325_PIXELSPERBYTE = 2;
15static const uint8_t SSD1325_SETCOLADDR = 0x15;
16static const uint8_t SSD1325_SETROWADDR = 0x75;
17static const uint8_t SSD1325_SETCONTRAST = 0x81;
18static const uint8_t SSD1325_SETCURRENT = 0x84;
20static const uint8_t SSD1325_SETREMAP = 0xA0;
21static const uint8_t SSD1325_SETSTARTLINE = 0xA1;
22static const uint8_t SSD1325_SETOFFSET = 0xA2;
23static const uint8_t SSD1325_NORMALDISPLAY = 0xA4;
24static const uint8_t SSD1325_DISPLAYALLON = 0xA5;
25static const uint8_t SSD1325_DISPLAYALLOFF = 0xA6;
26static const uint8_t SSD1325_INVERTDISPLAY = 0xA7;
27static const uint8_t SSD1325_SETMULTIPLEX = 0xA8;
28static const uint8_t SSD1325_MASTERCONFIG = 0xAD;
29static const uint8_t SSD1325_DISPLAYOFF = 0xAE;
30static const uint8_t SSD1325_DISPLAYON = 0xAF;
32static const uint8_t SSD1325_SETPRECHARGECOMPENABLE = 0xB0;
33static const uint8_t SSD1325_SETPHASELEN = 0xB1;
34static const uint8_t SSD1325_SETROWPERIOD = 0xB2;
35static const uint8_t SSD1325_SETCLOCK = 0xB3;
36static const uint8_t SSD1325_SETPRECHARGECOMP = 0xB4;
37static const uint8_t SSD1325_SETGRAYTABLE = 0xB8;
38static const uint8_t SSD1325_SETDEFAULTGRAYTABLE = 0xB9;
39static const uint8_t SSD1325_SETPRECHARGEVOLTAGE = 0xBC;
40static const uint8_t SSD1325_SETVCOMLEVEL = 0xBE;
41static const uint8_t SSD1325_SETVSL = 0xBF;
43static const uint8_t SSD1325_GFXACCEL = 0x23;
44static const uint8_t SSD1325_DRAWRECT = 0x24;
45static const uint8_t SSD1325_COPY = 0x25;
50 this->
command(SSD1325_DISPLAYOFF);
51 this->
command(SSD1325_SETCLOCK);
53 this->
command(SSD1325_SETMULTIPLEX);
59 this->
command(SSD1325_SETOFFSET);
65 this->
command(SSD1325_SETSTARTLINE);
67 this->
command(SSD1325_MASTERCONFIG);
69 this->
command(SSD1325_SETREMAP);
75 this->
command(SSD1325_SETCURRENT + 0x2);
76 this->
command(SSD1325_SETGRAYTABLE);
104 this->
command(SSD1325_SETROWPERIOD);
106 this->
command(SSD1325_SETPHASELEN);
108 this->
command(SSD1325_SETPRECHARGECOMP);
110 this->
command(SSD1325_SETPRECHARGECOMPENABLE);
112 this->
command(SSD1325_SETVCOMLEVEL);
116 this->
command(SSD1325_NORMALDISPLAY);
123 this->
command(SSD1325_SETCOLADDR);
126 this->
command(SSD1325_SETROWADDR);
142 if (brightness > 1) {
144 }
else if (brightness < 0) {
150 this->
command(SSD1325_SETCONTRAST);
155 this->
command(SSD1325_DISPLAYON);
159 this->
command(SSD1325_DISPLAYOFF);
200 uint16_t pos = (
x / SSD1325_PIXELSPERBYTE) + (
y * this->
get_width_internal() / SSD1325_PIXELSPERBYTE);
201 uint8_t shift = (
x % SSD1325_PIXELSPERBYTE) * SSD1325_COLORSHIFT;
203 color4 = (color4 & SSD1325_COLORMASK) << shift;
205 this->
buffer_[pos] &= (~SSD1325_COLORMASK >> shift);
211 uint8_t
fill = (color4 & SSD1325_COLORMASK) | ((color4 & SSD1325_COLORMASK) << SSD1325_COLORSHIFT);
230 return "SSD1325 128x32";
232 return "SSD1325 128x64";
234 return "SSD1325 96x16";
236 return "SSD1325 64x48";
238 return "SSD1327 128x128";