Skip to content

Add example spi/ssd1309_spi - #731

Merged
kilograham merged 6 commits into
raspberrypi:developfrom
mjcross:spi_ssd1309
Jun 17, 2026
Merged

kilograham merged 6 commits into
raspberrypi:developfrom
mjcross:spi_ssd1309

Conversation

@mjcross

@mjcross mjcross commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

Add an example of how to attach one of the widely available small OLED displays based on the SSD1309 controller via SPI, complementing the existing SSD1306 example that uses i2c. In fact the two controllers have the same command set so the example should work on either (but I don't have an SSD1306 to test).
For many applications the SPI interface might be a better bet, as it runs a lot faster (10Mbit/sec).

@mjcross

mjcross commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

Incidentally I've also created a similar version that uses a frame buffer updated via DMA direct to the SPI peripheral; but I'll submit that as a separate PR. This version is much easier to understand.

Comment thread spi/ssd1309_spi/ssd1309_spi.c Resolved
Comment thread spi/ssd1309_spi/ssd1309_spi.c Resolved
Comment thread spi/ssd1309_spi/ssd1309_spi.c Resolved
Comment thread spi/ssd1309_spi/ssd1309_spi.c Resolved
Comment thread spi/ssd1309_spi/ssd1309_spi.c Resolved
Comment thread spi/ssd1309_spi/ssd1309_spi.c Resolved
Comment thread spi/ssd1309_spi/README.adoc Resolved
@peterharperuk peterharperuk self-assigned this Dec 30, 2025
Comment thread spi/ssd1309_spi/ssd1309_font.h Resolved
@lurch

lurch commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

Thank you for the high-quality example 👍
Sorry if I went a bit overboard on the number of comments.

@mjcross

mjcross commented Dec 30, 2025

Copy link
Copy Markdown
Contributor Author

Thank you for the high-quality example 👍 Sorry if I went a bit overboard on the number of comments.

You're more than welcome! I wanted to use one of these displays in a current project, and writing it up as an example encourages me to do a better job. Your comments are really helpful and always on point :-)

I'll be interested to see what you think of the DMA frame-buffer version, which should be ready in the next day or two. First time I've dipped my toe into using DMA and it's a really well designed API 👍

Comment thread spi/ssd1309_spi_dma/CMakeLists.txt Resolved
@peterharperuk peterharperuk added this to the 2.2.1 milestone Jun 5, 2026
peterharperuk
peterharperuk previously approved these changes Jun 5, 2026
@kilograham
kilograham merged commit a3f3f46 into raspberrypi:develop Jun 17, 2026
3 checks passed
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.

4 participants