Overlay for SSD1306 framebuffer for OLED display.

Open
#1,098 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Domain
embedded-iot

Research direction

Start by locating the overlay sources and the overlay README, then compare the proposed SSD1306 device-tree overlay and documentation fragment with existing overlay conventions. Done means the overlay and its parameters, examples, and SSD1306 reference are included consistently and can be built or validated with the repository's normal checks.

Written by the indexing model from the issue text.

Description

I've successfully used the new SSD1307fb framebuffer driver with inexpensive SSD1306 controlled 128x32 and 128x64 OLED displays. They're available for a couple of dollars US from the usual Chinese suppliers, or from Adafruit as parts 3527 and 326.

Here's the overlay source:

// Overlay for SSD1306 128x64 and 128x32 OLED displays
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2718";

fragment@0 {
target = <&i2c1>;
__overlay__ {
    status = "okay";

    #address-cells = <1>;
    #size-cells = <0>;

    ssd1306: oled@3c{
	compatible = "solomon,ssd1306fb-i2c";
	reg = <0x3c>;
	solomon,width = <128>;
	solomon,height = <64>;
	solomon,page-offset = <0>;
    };
};
};

__overrides__ {
address = <&ssd1306>,"reg:0";
width = <&ssd1306>,"solomon,width:0";
height = <&ssd1306>,"solomon,height:0";
offset = <&ssd1306>,"solomon,page-offset:0";
normal = <&ssd1306>,"solomon,segment-no-remap?";
sequential = <&ssd1306>,"solomon,com-seq?";
remapped = <&ssd1306>,"solomon,com-lrremap?";
inverted = <&ssd1306>,"solomon,com-invdir?";
};

};

Also, here's a fragment that could be included in the overlay README:

Name: ssd1306
Info: Overlay for activation of SSD1306 over I2C OLED display framebuffer.
Load: dtoverlay=ssd1306,=
Params: address Location in display memory of first character.
(default=0)
width Width of display. (default=128)
height Height of display. (default=64)
offset virtual channel a. (default=0)
normal Has no effect on displays tested. (default=not set)
sequential Set this if every other scan line is missing.
(default=not set)
remapped Set this if display is garbled. (default=not set)
inverted Set this if display is inverted and mirrored.
(default=not set)

    Examples:
    Typical usage for 128x64 display: dtoverlay=ssd1306,inverted

    Typical usage for 128x32 display: dtoverlay=ssd1306,inverted,sequential

    i2c_baudrate=400000 will speed up the display.

    i2c_baudrate=1000000 seems to work even though it's not officially supported
    by the hardware, and is faster still.

    For more information refer to the device datasheet at:
    https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf

Feel free to include them in Raspbian if you wish: that would free me from maintaining my own copies!

I have a project page here if you want more info: sites.google.com/site/mincepi/pi2oled

Email me at mincepi -at- gmail.com with questions. If I need to do this request via a different method please let me know.

Dominant language
No language data
Stars
5.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/firmware

All issues in raspberrypi/firmware

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.