-3

How does one make an i2c ssd1306 a framebuffer?

4
  • Could you explain what you mean? Do you mean you want the device you have to be the main Pi screen? Lots of small (e.g. 128x64) screens incorporate the SSD1306 driver chip. Typically they would use the parallel or SPI interface for speed rather than the much slower I2C.
    – joan
    Dec 18 '15 at 8:54
  • @joan ye I want it to be the main screen. Mine does not have an option for parallel or SPI, only i2c Dec 18 '15 at 8:55
  • I've just looked through /boot/overlays/README and there only seems to be support for SPI based screens. Have a look at github.com/notro/fbtft to see if any similar I2C devices were supported.
    – joan
    Dec 18 '15 at 9:35
  • Well it might be possible to create a low-level bit-banging interface with a pair of PC(A/F)8574(A) ICs but unlike smaller resolution (up to 4x20 characters composed of say 6x8 blocks) LC "Character" displays this device (datasheet) needs an 8-bit Data bus which is why I think you will need two I2C I/O expander ICs and some new code - and I think it would be very slow - only for largely "static" displays. I do not know whether there is kernel support for this as a frame-buffer device...
    – SlySven
    Dec 20 '15 at 16:22
3

A device tree overlay which allows the use of an ssd1306 via i2c was merged into the Raspberry Pi OS (Raspbian) kernel in early 2019 (https://github.com/raspberrypi/firmware/issues/1098).

To use this, you could add dtoverlay=ssd1306 to /boot/config.txt.

If you want to use the ssd1306 as your primary console, then you can prevent the Pi GPU being used as the console by adding fbcon=map:1 to the kernel commandline in /boot/cmdline.txt.

If you do this, you might want to recompile the kernel to include the MINI_4x6 font (the default 8x8 font will only give you an 8 row, 16 column character display on a 128x64 screen, whereas the 4x6 font should give you a spacious 10 row, 32 column character display).

0

There is already built-in support for the SSD1306 OLED module in the Linux Kernel CONFIG_FB_SSD1307. For the Raspberry PI for example with the Yocto build setup you could use the meta-rpi-ssd1306 available here https://github.com/mickey-happygolucky/meta-rpi-ssd1306

Not the answer you're looking for? Browse other questions tagged or ask your own question.