7static const char *
const TAG =
"ssd1322";
9static const uint8_t SSD1322_MAX_CONTRAST = 255;
10static const uint8_t SSD1322_COLORMASK = 0x0f;
11static const uint8_t SSD1322_COLORSHIFT = 4;
12static const uint8_t SSD1322_PIXELSPERBYTE = 2;
14static const uint8_t SSD1322_ENABLEGRAYSCALETABLE = 0x00;
15static const uint8_t SSD1322_SETCOLUMNADDRESS = 0x15;
16static const uint8_t SSD1322_WRITERAM = 0x5C;
17static const uint8_t SSD1322_READRAM = 0x5D;
18static const uint8_t SSD1322_SETROWADDRESS = 0x75;
19static const uint8_t SSD1322_SETREMAP = 0xA0;
20static const uint8_t SSD1322_SETSTARTLINE = 0xA1;
21static const uint8_t SSD1322_SETOFFSET = 0xA2;
22static const uint8_t SSD1322_SETMODEALLOFF = 0xA4;
23static const uint8_t SSD1322_SETMODEALLON = 0xA5;
24static const uint8_t SSD1322_SETMODENORMAL = 0xA6;
25static const uint8_t SSD1322_SETMODEINVERTED = 0xA7;
26static const uint8_t SSD1322_ENABLEPARTIALDISPLAY = 0xA8;
27static const uint8_t SSD1322_EXITPARTIALDISPLAY = 0xA9;
28static const uint8_t SSD1322_SETFUNCTIONSELECTION = 0xAB;
29static const uint8_t SSD1322_SETDISPLAYOFF = 0xAE;
30static const uint8_t SSD1322_SETDISPLAYON = 0xAF;
31static const uint8_t SSD1322_SETPHASELENGTH = 0xB1;
32static const uint8_t SSD1322_SETFRONTCLOCKDIVIDER = 0xB3;
33static const uint8_t SSD1322_DISPLAYENHANCEMENTA = 0xB4;
34static const uint8_t SSD1322_SETGPIO = 0xB5;
35static const uint8_t SSD1322_SETSECONDPRECHARGEPERIOD = 0xB6;
36static const uint8_t SSD1322_SETGRAYSCALETABLE = 0xB8;
37static const uint8_t SSD1322_SELECTDEFAULTLINEARGRAYSCALETABLE = 0xB9;
38static const uint8_t SSD1322_SETPRECHARGEVOLTAGE = 0xBB;
39static const uint8_t SSD1322_SETVCOMHVOLTAGE = 0xBE;
40static const uint8_t SSD1322_SETCONTRAST = 0xC1;
41static const uint8_t SSD1322_MASTERCURRENTCONTROL = 0xC7;
42static const uint8_t SSD1322_SETMULTIPLEXRATIO = 0xCA;
43static const uint8_t SSD1322_DISPLAYENHANCEMENTB = 0xD1;
44static const uint8_t SSD1322_SETCOMMANDLOCK = 0xFD;
46static const uint8_t SSD1322_SETCOMMANDLOCK_UNLOCK = 0x12;
47static const uint8_t SSD1322_SETCOMMANDLOCK_LOCK = 0x16;
52 this->
command(SSD1322_SETCOMMANDLOCK);
53 this->
data(SSD1322_SETCOMMANDLOCK_UNLOCK);
55 this->
command(SSD1322_SETFRONTCLOCKDIVIDER);
57 this->
command(SSD1322_SETMULTIPLEXRATIO);
59 this->
command(SSD1322_SETOFFSET);
61 this->
command(SSD1322_SETSTARTLINE);
63 this->
command(SSD1322_SETREMAP);
68 this->
command(SSD1322_SETFUNCTIONSELECTION);
70 this->
command(SSD1322_DISPLAYENHANCEMENTA);
73 this->
command(SSD1322_MASTERCURRENTCONTROL);
75 this->
command(SSD1322_SETPHASELENGTH);
77 this->
command(SSD1322_DISPLAYENHANCEMENTB);
80 this->
command(SSD1322_SETPRECHARGEVOLTAGE);
82 this->
command(SSD1322_SETSECONDPRECHARGEPERIOD);
84 this->
command(SSD1322_SETVCOMHVOLTAGE);
86 this->
command(SSD1322_SETMODENORMAL);
87 this->
command(SSD1322_EXITPARTIALDISPLAY);
89 this->
command(SSD1322_SETGRAYSCALETABLE);
106 this->
command(SSD1322_ENABLEGRAYSCALETABLE);
113 this->
command(SSD1322_SETCOLUMNADDRESS);
116 this->
command(SSD1322_SETROWADDRESS);
119 this->
command(SSD1322_WRITERAM);
130 this->
command(SSD1322_SETCONTRAST);
135 this->
command(SSD1322_SETDISPLAYON);
139 this->
command(SSD1322_SETDISPLAYOFF);
167 uint8_t shift = (1u - (
x % SSD1322_PIXELSPERBYTE)) * SSD1322_COLORSHIFT;
169 color4 = (color4 & SSD1322_COLORMASK) << shift;
171 this->
buffer_[
pos] &= (
static_cast<uint8_t
>(~SSD1322_COLORMASK) >> shift);
178 Display::fill(color);
183 uint8_t
fill = (color4 & SSD1322_COLORMASK) | ((color4 & SSD1322_COLORMASK) << SSD1322_COLORSHIFT);
202 return "SSD1322 256x64";