| dist | ||
| include/ssd1306 | ||
| scripts | ||
| .gitignore | ||
| CMakeLists.txt | ||
| README.md | ||
| ssd1306.c | ||
SSD1306 Driver
This is a simple driver for the SSD1306 OLED display. It uses a I2C connection drived by the following library (also from my authory) : I2C]
Currently it has support for the following MCU:
- Raspberry Pico (both 2040 and 2350)
How to use
Option A - Pre-Built Static Library
The easiest way to start using the driver is to link your application against one of the pre-built static libraries under dist/ (make sure to pick the one for your MCU). Additionally, you should add ssd1306.h (also under dist/ ) to your include path. The libraries were compiled with the default settings.
Option B - Build Yourself
If you want to toggle the settings you can do it by compiling the library yourself, and set the options via CMake (or the build system of your choice).
This option is a WIP to be able to support the options in the CMake
mkdir build && cd build
cmake -DI2C_CONTROLLER=pico ..
cmake --build .
Option C - Include in your project
Similar to B) but you can include the source code (both .c and .h files) in your code, and change options using #define before includeing ssd1306.h
Currently the following options are modifiable this way:
- I2C_CONTROLLER: The controller your are using
- Available options: pico
- SSD1306_I2C_ADDR (default 0x3C): The I2C address of your display
- SSD1306_DISPLAY_CONTRAST (default: 0xFF (max)): The contrast of the display, a value in the range 0-255
- SSD1306_COL_OFFSET (default 2): Some displays manufactors dont expose the entire display, this setting address that.
- SSD1306_FONT (default: small (0)): The font to use for ascii
- SSD1306_DISPLAY_MAX_X (default: 128): The width of your display
- SSD1306_DISPLAY_MAX_Y (default: 64): The height of your display
- SSD1306_SPACE_LEN (default 4): How many columns of separations between characters
- SSD1306_UPDATE_MODE (default: partial (0)): Should display update only what has changed, or in full.