Skip to content

SSD1306 is a single-chip CMOS OLED/PLED driver

License

Notifications You must be signed in to change notification settings

ximtech/SSD1306

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSD1306

STM32 Low Layer(LL) library. Monochrome OLEDs based on SSD1306 driver. Uses I2C

SSD1306 128x64

image

SSD1306 128x32

image

SSD1306 96x16

image

Features

  • Popular display support
  • Display scroll
  • printf function support
  • Draw function support

Add as CPM project dependency

How to add CPM to the project, check the link

CPMAddPackage(
        NAME SSD1306
        GITHUB_REPOSITORY ximtech/SSD1306
        GIT_TAG origin/main)

Project configuration

  1. Start project with STM32CubeMX:
  2. Select: Project Manager -> Advanced Settings -> I2C -> LL
  3. Generate Code
  4. 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
  1. Then Build -> Clean -> Rebuild Project

Wiring

  • image

Usage

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