SSD1306, I2C, STM32 HAL
- MCU : STM32F411CEU6 (WeAct Black Pill V3.0)
- IDE : STM32CubeIDE
- SSD1306 Module : Geekcreit® 0.96 Inch 4Pin White IIC I2C OLED Display Module 128x64
- Enable Charge Pump
- RESET pin remains HIGH
- Use I2C interface
- Write string on the screen
- SSD1306 commands are defined as functions
- I2C1
/* SSD1306 Interface */
#define SSD1306_I2C (&hi2c1)
stm32f411_fw_ssd1306/Core/Src/main.c
#include "ssd1306.h"
int main(void)
{
ssd1306_init();
ssd1306_write_string(font6x8, "ABC");
ssd1306_enter();
ssd1306_write_string(font7x10, "ABC");
ssd1306_enter();
ssd1306_write_string(font11x18, "ABC");
ssd1306_enter();
ssd1306_write_string(font16x26, "ABC");
ssd1306_enter();
ssd1306_update_screen();
}