lcdgfx icon indicating copy to clipboard operation
lcdgfx copied to clipboard

Add support for LCD controller: SSD1306B

Open simon-77 opened this issue 1 month ago • 1 comments

The SSD1306 is already implemented, but not fully compatible with the SSD1306B controller.

I am using the OLEDS102-6 display with the SSD1306B controller. I needed to modify the startup sequence slightly, in order to get the charge pump set up correctly.

I have copied the configuration (for the lcd_code_generator.py script) from the SSD1306 and modified the startup sequence.

This pull request contains the new json configuration files as well as the newly created source files.

And I have tested the new class successfully with my OLEDS102-6 display. Used testing code snippets:

#include <stdio.h>
#include "pico/stdlib.h"
#include "lcdgfx.h"

#define OLED_RST 3
#define OLED_DC 2
#define OLED_CS 5
#define OLED_SCK 18
#define OLED_MOSI 19
#define SPI_FREQ 0 // 0 means default frequency
DisplaySSD1306B_128x64_SPI oled(OLED_RST, {-1, OLED_CS, OLED_DC, SPI_FREQ, OLED_SCK, OLED_MOSI});


int main()
{
    stdio_init_all();

    oled.begin();

    oled.setFixedFont( ssd1306xled_font6x8 );
    oled.getInterface().flipHorizontal(true);
    oled.getInterface().flipVertical(true);
    oled.clear();
    
    oled.printFixed(12,  0, "Normal text", STYLE_NORMAL);
    oled.printFixed(12, 16, "Bold text", STYLE_BOLD);
    oled.printFixed(12, 24, "Italic text", STYLE_ITALIC);

    while (true);
}

simon-77 avatar Jun 01 '24 20:06 simon-77