Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LCD controller: SSD1306B #118

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

simon-77
Copy link
Contributor

@simon-77 simon-77 commented Jun 1, 2024

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
Copy link
Contributor Author

simon-77 commented Jun 1, 2024

The SSD1306 library has the following #define directive

               "128x64":
                {
                    "init":
                    [
                        "#ifdef SDL_EMULATION",
                        "    SDL_LCD_SSD1306, 0x00,",
                        "    0x00, 0x00,",
                        "#endif",

which I have modified for SSD1306B to SDL_LCD_SSD1306B, 0x00,",.
I guess this is why the build test is failing.

I don't know what it is actually used for and if I should have deleted these 4 lines for the new implementation.

Nevertheless, building the library for a micro controller (raspberry pi pico in my case) without the SDL_EMULATION does work.

Maybe you can have a look and modify this line accordingly to what makes sense.

Cheers
Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant