Six months ago, II stumbled on a project by Stefan Wagner that exploits a nice feature of the OLED controller; once it's properly configured, you can write 8 bits row (called PAGE0 to PAGE7) simultaneously for every column (SEG0 to SEG127).
The brilliant solution of Stefan was to use a very compact 5x8 pixel font. In this way, you can write characters on the display with just five 1 byte length write. The controller is smart enough to auto increment the next location (column) without re-sending the address.
Sending characters to the display in this manner is fast, compact, and reliable; you can even use low-speed I2C and have an excellent display update rate. If you use the display to show scalar values like those in the pictures, you just need to write the new values instead of updating the entire video memory.
The driver was designed to run on the ATtiny family, and the original character magnification was quite crude; I believe the original author was more focused on the overall footprint of the driver.
In any case, the project was a great starting point; I rearranged the source code to be easily integrated into the STM32 Cube IDE to use it with the STM32 CPU family. The driver uses the standard HAL I2C write function.
I also improved the character generation; now, the driver can draw four different character sizes: a tiny 5x8, if you need to display a lot of info, a 10x16, which is very readable but still compact, and 15x24 and a 20x32, ideal for clock application.
You can expand the character set with custom symbols to draw some basic graphics like the old MS-DOS era...
The driver includes additional functions to control the contrast and switch the display on-off. You can quickly flip the screen by changing the SSD1306_INIT_LEN to 20
I kept the project with its original license: Creative Commons Attribution-ShareAlike 3.0
An entire demo project using the STM board NUCLEO F401RE is available here on GitHub.