@@ -467,12 +467,15 @@ bool Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, bool reset,
467
467
return false ;
468
468
469
469
clearDisplay ();
470
- if (HEIGHT > 32 ) {
470
+ if (WIDTH > 64 && HEIGHT > 32 ) {
471
471
drawBitmap ((WIDTH - splash1_width) / 2 , (HEIGHT - splash1_height) / 2 ,
472
472
splash1_data, splash1_width, splash1_height, 1 );
473
- } else {
473
+ } else if (WIDTH > 64 ) {
474
474
drawBitmap ((WIDTH - splash2_width) / 2 , (HEIGHT - splash2_height) / 2 ,
475
475
splash2_data, splash2_width, splash2_height, 1 );
476
+ } else {
477
+ drawBitmap ((WIDTH - splash3_width) / 2 , (HEIGHT - splash3_height) / 2 ,
478
+ splash3_data, splash3_width, splash3_height, 1 );
476
479
}
477
480
478
481
vccstate = vcs;
@@ -563,6 +566,13 @@ bool Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, bool reset,
563
566
} else if ((WIDTH == 96 ) && (HEIGHT == 16 )) {
564
567
comPins = 0x2 ; // ada x12
565
568
contrast = (vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0xAF ;
569
+ } else if ((WIDTH == 64 ) && (HEIGHT == 48 )) {
570
+ static const uint8_t PROGMEM init4d[] = {
571
+ SSD1306_SETCOMPINS, // 0xDA
572
+ 0x12 ,
573
+ SSD1306_SETCONTRAST }; // 0x81
574
+ ssd1306_commandList (init4d, sizeof (init4d));
575
+ ssd1306_command1 ((vccstate == SSD1306_EXTERNALVCC) ? 0x9F : 0xCF );
566
576
} else {
567
577
// Other screen varieties -- TBD
568
578
}
@@ -925,13 +935,27 @@ uint8_t *Adafruit_SSD1306::getBuffer(void) { return buffer; }
925
935
*/
926
936
void Adafruit_SSD1306::display (void ) {
927
937
TRANSACTION_START
928
- static const uint8_t PROGMEM dlist1[] = {
938
+ if ((WIDTH != 64 ) || (HEIGHT != 48 )) {
939
+ static const uint8_t PROGMEM dlist1a[] = {
929
940
SSD1306_PAGEADDR,
930
- 0 , // Page start address
931
- 0xFF , // Page end (not really, but works here)
932
- SSD1306_COLUMNADDR, 0 }; // Column start address
933
- ssd1306_commandList (dlist1, sizeof (dlist1));
934
- ssd1306_command1 (WIDTH - 1 ); // Column end address
941
+ 0 , // Page start address
942
+ 0xFF , // Page end (not really, but works here)
943
+ SSD1306_COLUMNADDR,
944
+ 0 }; // Column start address
945
+ ssd1306_commandList (dlist1a, sizeof (dlist1a));
946
+ ssd1306_command1 (WIDTH - 1 ); // Column end address
947
+ } else {
948
+ static const uint8_t PROGMEM dlist1b[] = {
949
+ SSD1306_PAGEADDR,
950
+ 0 }; // Page start address
951
+ ssd1306_commandList (dlist1b, sizeof (dlist1b));
952
+ ssd1306_command1 ((HEIGHT / 8 ) - 1 ); // Page end address
953
+ static const uint8_t PROGMEM dlist2b[] = {
954
+ SSD1306_COLUMNADDR,
955
+ 32 }; // Column start address
956
+ ssd1306_commandList (dlist2b, sizeof (dlist2b));
957
+ ssd1306_command1 (32 + WIDTH - 1 ); // Column end address
958
+ }
935
959
936
960
#if defined(ESP8266)
937
961
// ESP8266 needs a periodic yield() call to avoid watchdog reset.
0 commit comments