STM32 Low Layer(LL) library. Monochrome OLEDs based on SSD1306 driver. Uses I2C
- Popular display support
- Display scroll
- printf function support
- Draw function support
How to add CPM to the project, check the link
CPMAddPackage(
NAME SSD1306
GITHUB_REPOSITORY ximtech/SSD1306
GIT_TAG origin/main)
- Start project with STM32CubeMX:
- Select: Project Manager -> Advanced Settings -> I2C -> LL
- Generate Code
- Add sources to project:
add_subdirectory(${STM32_CORE_SOURCE_DIR}/I2C/Polling) # add I2C dependency
include_directories(${includes}
${SSD1306_DIRECTORY}) # matrix display source directories
file(GLOB_RECURSE SOURCES ${sources}
${SSD1306_SOURCES}) # matrix display source files
- Then Build -> Clean -> Rebuild Project
In SSD1306.h
default defines. Override them in main.h
if needed
// Display resolution
#define SSD1306_RESOLUTION_WIDTH 128
#define SSD1306_RESOLUTION_HEIGHT 32
#define SSD1306_I2C_TIMEOUT_MS 100
#define SD1306_DEVICE_ADDRESS 0x78 // Notice: SSD1306 128x32 can only have one I2C address
// Font define section. Uncomment/comment for font enable or disable
#define SSD1306_FONT_DEFAULT 1
- Usage example: link