afiskon / stm32-ssd1306

STM32 library for working with OLEDs based on SSD1306, SH1106, SH1107 and SSD1309, supports I2C and SPI
https://eax.me/stm32-ssd1306/
MIT License
771 stars 213 forks source link

STM32WL + Init + DMA support #77

Closed lamaatje closed 8 months ago

lamaatje commented 8 months ago

Note that the init changed quite a bit, the original version did not work for my hardware version and diverted so much from the datasheets suggested sequence that I was not able to find a small delta that would work for my display. Btw I can make a small Youtube video on setting up DMA with cubeMx if you want.

afiskon commented 8 months ago

This patch shouldn't change ssd1306_Init(). Please submit a separate PR if you see any problems with _Init().

Apparently you implemented I2C DMA, however this library supports both I2C and SPI. In order to contribute DMA support you will have to implement both, I'm afraid.

A YouTube demo would be much appreciated, thank you.

lamaatje commented 8 months ago

as indicated ssd1306_Init() is:

  1. not maintainable
  2. definitely not working with 64x32 and very likely also not working with other odd formats

In case of issues with the proposed change finding an issue is relatively easy. With the current implementation it is like finding a needle in a haystack as I experienced myself. I took me more then 6 hours to get the 64x32 display working. ssd1306_Init() is a mess and completely diverging from the init in the datasheet.

I2C DMA is nicely implemented with an optional compile switch and there is no dependency with a SPI implementation.

If the pull request is not acceptable for you I will maintain a separate fork or alternative implementation. Without DMA support the applicability of the library for "real" application is limited unless you want to burn CPU cycles with your 32-bit microcontroller.

afiskon commented 8 months ago

as indicated ssd1306_Init() is: [...]

Maybe so, but ssd1306_Init() has nothing to do with DMA. Please submit a separate pull request.

If the pull request is not acceptable for you I will maintain a separate fork or alternative implementation

Yes, I'm not going to maintain DMA without SPI support and accompanying examples. Please create a fork then.