Adafruit ILI9341 SPI for stm32duino
Posted: Sat Jan 30, 2021 8:39 am
This is an (yet another) implementation of Adafruit ILI9341 SPI lcd library for STM32duino official STM core and libmaple (roger's and steve's mainly F4) core.
I've attempted a 'multi-core' (STM official, steve's libmaple (F4) (also in roger's core F4), and roger's (F1) libmaple) implementation
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino
I attempted to use hardware features (SPI - that is 'standard', using SPI.h and SPI.cpp 'arduinoish' interfaces, and i used features in the 'dialect'
to gain access to DMA etc). And the other thing I've attempted is to use bit banding to toggle the CS and DC (data / command) pins.
the results of using SPI, DMA and bit banding is an almost doubled performance on Steve's libmaple F4 (and Roger's for F4)
on stm32f401ccu blackpill as compared to Adafruit original with hardware SPI and SPI_HAS_TRANSACTION define.
and as usual this won't be complete without a youtube video
https://youtu.be/7Ey1U36YtY0
the use of bit banding apparently means that this won't work on Cortex M0 mcus (stm32f0xx) and only works in Cortex M3 (stm32f1xx), Cortex M4 (stm32f4xx) and above.
currently only tested on:
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino
I've attempted a 'multi-core' (STM official, steve's libmaple (F4) (also in roger's core F4), and roger's (F1) libmaple) implementation
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino
I attempted to use hardware features (SPI - that is 'standard', using SPI.h and SPI.cpp 'arduinoish' interfaces, and i used features in the 'dialect'
to gain access to DMA etc). And the other thing I've attempted is to use bit banding to toggle the CS and DC (data / command) pins.
the results of using SPI, DMA and bit banding is an almost doubled performance on Steve's libmaple F4 (and Roger's for F4)
on stm32f401ccu blackpill as compared to Adafruit original with hardware SPI and SPI_HAS_TRANSACTION define.
Code: Select all
Benchmark (microseconds) Adafruit this
stm32f401ccu stm32f401ccu
libmaple libmaple
Screen fill 476799 154057
Text 41574 28803
Lines 352653 172626
Horiz/Vert Lines 41711 15210
Rectangles (outline) 26464 10875
Rectangles (filled) 990327 321102
Circles (filled) 138760 91825
Circles (outline) 156673 105738
Triangles (outline) 79426 46922
Triangles (filled) 339544 152668
sum 2643931 1099826

https://youtu.be/7Ey1U36YtY0
the use of bit banding apparently means that this won't work on Cortex M0 mcus (stm32f0xx) and only works in Cortex M3 (stm32f1xx), Cortex M4 (stm32f4xx) and above.
currently only tested on:
more details in the repository readmelibmaple (rogers's, steve's) stm32f401ccu 84mhz blackpill
libmaple (rogers's, steve's) stm32f103c{8,b} 72mhz maple mini clone
STM official stm32f401ccu 84mhz blackpill
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino