STM32 library for working with OLEDs based on SSD1306, SH1106 and SSD1309, supports I2C and 4-wire SPI.
Tested on STM32F1 and STM32F4 MCUs, with 10 random displays from eBay. Also this code is known to work with afiskon/fpga-ssd1306-to-vga.
examples directory and
ssd1306/ssd1306.h for more details.