Skip to content

Commit 2a28f41

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
overlays: Add ssd1306 overlay for OLED display
See: raspberrypi/firmware#1098 Signed-off-by: mincepi <[email protected]>
1 parent 62c4ff5 commit 2a28f41

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
132132
spi2-1cs.dtbo \
133133
spi2-2cs.dtbo \
134134
spi2-3cs.dtbo \
135+
ssd1306.dtbo \
135136
superaudioboard.dtbo \
136137
sx150x.dtbo \
137138
tinylcd35.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,37 @@ Params: cs0_pin GPIO pin for CS0 (default 43 - BCM SPI2_CE0).
19041904
is 'okay' or enabled).
19051905

19061906

1907+
Name: ssd1306
1908+
Info: Overlay for activation of SSD1306 over I2C OLED display framebuffer.
1909+
Load: dtoverlay=ssd1306,<param>=<val>
1910+
Params: address Location in display memory of first character.
1911+
(default=0)
1912+
width Width of display. (default=128)
1913+
height Height of display. (default=64)
1914+
offset virtual channel a. (default=0)
1915+
normal Has no effect on displays tested. (default=not
1916+
set)
1917+
sequential Set this if every other scan line is missing.
1918+
(default=not set)
1919+
remapped Set this if display is garbled. (default=not
1920+
set)
1921+
inverted Set this if display is inverted and mirrored.
1922+
(default=not set)
1923+
1924+
Examples:
1925+
Typical usage for 128x64 display: dtoverlay=ssd1306,inverted
1926+
1927+
Typical usage for 128x32 display: dtoverlay=ssd1306,inverted,sequential
1928+
1929+
i2c_baudrate=400000 will speed up the display.
1930+
1931+
i2c_baudrate=1000000 seems to work even though it's not officially
1932+
supported by the hardware, and is faster still.
1933+
1934+
For more information refer to the device datasheet at:
1935+
https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
1936+
1937+
19071938
Name: superaudioboard
19081939
Info: Configures the SuperAudioBoard sound card
19091940
Load: dtoverlay=superaudioboard,<param>=<val>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Overlay for SSD1306 128x64 and 128x32 OLED displays
2+
/dts-v1/;
3+
/plugin/;
4+
5+
/ {
6+
compatible = "brcm,bcm2718";
7+
8+
fragment@0 {
9+
target = <&i2c1>;
10+
__overlay__ {
11+
status = "okay";
12+
13+
#address-cells = <1>;
14+
#size-cells = <0>;
15+
16+
ssd1306: oled@3c{
17+
compatible = "solomon,ssd1306fb-i2c";
18+
reg = <0x3c>;
19+
solomon,width = <128>;
20+
solomon,height = <64>;
21+
solomon,page-offset = <0>;
22+
};
23+
};
24+
};
25+
26+
__overrides__ {
27+
address = <&ssd1306>,"reg:0";
28+
width = <&ssd1306>,"solomon,width:0";
29+
height = <&ssd1306>,"solomon,height:0";
30+
offset = <&ssd1306>,"solomon,page-offset:0";
31+
normal = <&ssd1306>,"solomon,segment-no-remap?";
32+
sequential = <&ssd1306>,"solomon,com-seq?";
33+
remapped = <&ssd1306>,"solomon,com-lrremap?";
34+
inverted = <&ssd1306>,"solomon,com-invdir?";
35+
};
36+
};

0 commit comments

Comments
 (0)