Add SSD1306 64x48 pixel support

Add SSD1306 64x48 pixel support (#6740)
This commit is contained in:
Theo Arends 2019-10-30 10:14:16 +01:00
parent 4e7147708b
commit 3cd8bc2545
2 changed files with 9 additions and 2 deletions

View File

@ -563,6 +563,13 @@ boolean Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, boolean reset,
SSD1306_SETCONTRAST }; // 0x81
ssd1306_commandList(init4c, sizeof(init4c));
ssd1306_command1((vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0xAF);
} else if((WIDTH == 64) && (HEIGHT == 48)) {
static const uint8_t PROGMEM init4d[] = {
SSD1306_SETCOMPINS, // 0xDA
0x12,
SSD1306_SETCONTRAST }; // 0x81
ssd1306_commandList(init4d, sizeof(init4d));
ssd1306_command1((vccstate == SSD1306_EXTERNALVCC) ? 0x9F : 0xCF);
} else {
// Other screen varieties -- TBD
}

View File

@ -61,10 +61,10 @@ void SSD1306InitDriver()
if (XDSP_02 == Settings.display_model) {
if ((Settings.display_width != 96) && (Settings.display_width != 128)) {
if ((Settings.display_width != 64) && (Settings.display_width != 96) && (Settings.display_width != 128)) {
Settings.display_width = 128;
}
if ((Settings.display_height != 16) && (Settings.display_height != 32) && (Settings.display_height != 64)) {
if ((Settings.display_height != 16) && (Settings.display_height != 32) && (Settings.display_height != 48) && (Settings.display_height != 64)) {
Settings.display_height = 64;
}