This is a Linux port of the SSD1306 driver originally implemented for the ESP-IDF framework by wolffshots
here. The SSD1306 is a monochrome OLED display controller. This implementation is based on the linux i2c subsystem
(Still in progress)
- Basic initialization and configuration.
- Device file Operations
- Open
- Read
- Write
- ioctl
- Drawing primitives: lines, rectangles, circles.
- Text rendering.
- Screen rotation support.
- I2C communication protocol support.
- SPI communication protocol support.
- User space sample applications
- Open
- Write
- Read
- ioctl
The toolchain was built with crosstool-NG using the armv8-rpi3-linux-gnueabihf
sample config
The Linux Kernel I used is Raspberry Pi Foundations fork of the mainline kernel found here
Tested on Raspberrypi 3A+ and 3B+ models (with BCM2837B0 SOC)
To use this driver, follow these steps:
- Setup a build environment (get or build a toolchain)
- Build the kernel (mainline Linux kernel or Raspberry Pi's fork) and boot your board
- Clone the repository.
- Copy the device tree to the arch/arm(64)/boot/dt
- Compile the driver and device trees with Kbuild and transfer the built module and device tree binary to the target.
- Use the userspace application to interact with the device in
/dev/ssd1306X
The architecture independent part of the orginal driver ssd1306.c is largely untouched. The corresponding original sources files were renamed to linux_xxxx
. Mostly the function prototypes were modified to return values to the caller as it typical with linux driver functions and logging functions changed appropirately.
The bcm28xx* device tree are the upsteam Linux support files for the bcm SOC family while the bcm27xx* are downstream code by Rasberry Pi Foundations. See here
Here is a sample device tree modification for using the i2c1 controller. (also see the modfied .dts file on this repo. )
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
clock-frequency = <100000>;
//start
status = "okay";
ssd1306@3c{
compactible = "solomon,ssd1306";
reg = <0x3c>;
};
//end
};
This software is released under the MIT License. See the LICENSE
file for more information.