embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
4.79k stars 650 forks source link

Add support for the stm32 LTDC display peripheral #3126

Open ninjasource opened 3 days ago

ninjasource commented 3 days ago

This PR adds support for the LTDC display peripheral typically found on high-end graphics oriented stm32 mcus. The included example demonstrates high frame-rate animation on an stm32h735g-dk whilst running another blinky embassy task. The implementation was inspired by how the LTDC is used in the stm32h7xx-hal so if anyone spots any glaring stm32h7-only stuff please let me know. I decided not to use the standardized embedded_display_controller library because it was too "blocking focused". Therefore, at the cost of duplicating a few small graphics primitives, this implementation is standalone.

NOTE: The PR requires a small change to the stm32-data library for which there is an open PR. Once this is in the stm32-metapac dependencies on embassy-stm32 should be updated. For convenience, I have linked a pre-built metapac as a temporary measure.

joelsa commented 2 days ago

This breaks the DSI example at https://github.com/embassy-rs/embassy/blob/main/examples/stm32f469/src/bin/dsi_bsp.rs, can you update the example to reflect the changes made?

I can then run it on the Nucleo-F469 to see if it works.

ninjasource commented 2 days ago

This breaks the DSI example at https://github.com/embassy-rs/embassy/blob/main/examples/stm32f469/src/bin/dsi_bsp.rs, can you update the example to reflect the changes made?

I can then run it on the Nucleo-F469 to see if it works.

Hi, no need to make changes (I already have) but please test on you board if you can, thanks. I have fixed the compilation error with the dsi_bsp and I am trying to figure out how to do the RCC stuff with the appropriate feature flags so there are still CI issues I need to solve.