Skip to content

Commit dac753d

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 0feb864 commit dac753d

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
@@ -135,6 +135,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
135135
spi2-1cs.dtbo \
136136
spi2-2cs.dtbo \
137137
spi2-3cs.dtbo \
138+
ssd1306.dtbo \
138139
superaudioboard.dtbo \
139140
sx150x.dtbo \
140141
tc358743.dtbo \

arch/arm/boot/dts/overlays/README

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

19521952

1953+
Name: ssd1306
1954+
Info: Overlay for activation of SSD1306 over I2C OLED display framebuffer.
1955+
Load: dtoverlay=ssd1306,<param>=<val>
1956+
Params: address Location in display memory of first character.
1957+
(default=0)
1958+
width Width of display. (default=128)
1959+
height Height of display. (default=64)
1960+
offset virtual channel a. (default=0)
1961+
normal Has no effect on displays tested. (default=not
1962+
set)
1963+
sequential Set this if every other scan line is missing.
1964+
(default=not set)
1965+
remapped Set this if display is garbled. (default=not
1966+
set)
1967+
inverted Set this if display is inverted and mirrored.
1968+
(default=not set)
1969+
1970+
Examples:
1971+
Typical usage for 128x64 display: dtoverlay=ssd1306,inverted
1972+
1973+
Typical usage for 128x32 display: dtoverlay=ssd1306,inverted,sequential
1974+
1975+
i2c_baudrate=400000 will speed up the display.
1976+
1977+
i2c_baudrate=1000000 seems to work even though it's not officially
1978+
supported by the hardware, and is faster still.
1979+
1980+
For more information refer to the device datasheet at:
1981+
https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
1982+
1983+
19531984
Name: superaudioboard
19541985
Info: Configures the SuperAudioBoard sound card
19551986
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)