6namespace ssd1327_base {
8static const char *
const TAG =
"ssd1327";
10static const uint8_t SSD1327_MAX_CONTRAST = 127;
11static const uint8_t SSD1327_COLORMASK = 0x0f;
12static const uint8_t SSD1327_COLORSHIFT = 4;
13static const uint8_t SSD1327_PIXELSPERBYTE = 2;
15static const uint8_t SSD1327_SETCOLUMNADDRESS = 0x15;
16static const uint8_t SSD1327_SETROWADDRESS = 0x75;
17static const uint8_t SSD1327_SETCONTRAST = 0x81;
18static const uint8_t SSD1327_SETREMAP = 0xA0;
19static const uint8_t SSD1327_SETSTARTLINE = 0xA1;
20static const uint8_t SSD1327_SETOFFSET = 0xA2;
21static const uint8_t SSD1327_NORMALDISPLAY = 0xA4;
22static const uint8_t SSD1327_DISPLAYALLON = 0xA5;
23static const uint8_t SSD1327_DISPLAYALLOFF = 0xA6;
24static const uint8_t SSD1327_INVERTDISPLAY = 0xA7;
25static const uint8_t SSD1327_SETMULTIPLEX = 0xA8;
26static const uint8_t SSD1327_FUNCTIONSELECTIONA = 0xAB;
27static const uint8_t SSD1327_DISPLAYOFF = 0xAE;
28static const uint8_t SSD1327_DISPLAYON = 0xAF;
29static const uint8_t SSD1327_SETPHASELENGTH = 0xB1;
30static const uint8_t SSD1327_SETFRONTCLOCKDIVIDER = 0xB3;
31static const uint8_t SSD1327_SETGPIO = 0xB5;
32static const uint8_t SSD1327_SETSECONDPRECHARGEPERIOD = 0xB6;
33static const uint8_t SSD1327_SETGRAYSCALETABLE = 0xB8;
34static const uint8_t SSD1327_SELECTDEFAULTLINEARGRAYSCALETABLE = 0xB9;
35static const uint8_t SSD1327_SETPRECHARGEVOLTAGE = 0xBC;
36static const uint8_t SSD1327_SETVCOMHVOLTAGE = 0xBE;
37static const uint8_t SSD1327_FUNCTIONSELECTIONB = 0xD5;
38static const uint8_t SSD1327_SETCOMMANDLOCK = 0xFD;
39static const uint8_t SSD1327_HORIZONTALSCROLLRIGHTSETUP = 0x26;
40static const uint8_t SSD1327_HORIZONTALSCROLLLEFTSETUP = 0x27;
41static const uint8_t SSD1327_DEACTIVATESCROLL = 0x2E;
42static const uint8_t SSD1327_ACTIVATESCROLL = 0x2F;
48 this->
command(SSD1327_SETFRONTCLOCKDIVIDER);
50 this->
command(SSD1327_SETMULTIPLEX);
52 this->
command(SSD1327_SETOFFSET);
54 this->
command(SSD1327_SETSTARTLINE);
56 this->
command(SSD1327_SETREMAP);
58 this->
command(SSD1327_SETGRAYSCALETABLE);
75 this->
command(SSD1327_SETPHASELENGTH);
77 this->
command(SSD1327_SETVCOMHVOLTAGE);
81 this->
command(SSD1327_NORMALDISPLAY);
88 this->
command(SSD1327_SETCOLUMNADDRESS);
91 this->
command(SSD1327_SETROWADDRESS);
107 this->
command(SSD1327_SETCONTRAST);
112 this->
command(SSD1327_DISPLAYON);
116 this->
command(SSD1327_DISPLAYOFF);
143 uint16_t pos = (
x / SSD1327_PIXELSPERBYTE) + (
y * this->
get_width_internal() / SSD1327_PIXELSPERBYTE);
144 uint8_t shift = (
x % SSD1327_PIXELSPERBYTE) * SSD1327_COLORSHIFT;
146 color4 = (color4 & SSD1327_COLORMASK) << shift;
148 this->
buffer_[pos] &= (~SSD1327_COLORMASK >> shift);
154 uint8_t
fill = (color4 & SSD1327_COLORMASK) | ((color4 & SSD1327_COLORMASK) << SSD1327_COLORSHIFT);
173 return "SSD1327 128x128";