Code: Select all
// Enable the LTDC clock
#if defined(STM32F4)
RCC->DCKCFGR = (RCC->DCKCFGR & ~RCC_DCKCFGR_PLLSAIDIVR) | (1 << 16);
#elif defined(STM32F7)
RCC->DCKCFGR1 = (RCC->DCKCFGR1 & ~RCC_DCKCFGR1_PLLSAIDIVR) | (1 << 16);
#else
#error STM32LTDC driver not implemented for your platform
#endif
The reason why the driver directly accesses the LTDC registers are because the driver is meant to work on all underlying systems (BareBetal, ChibiOS/RT, ...) without relying on any special HAL. This is furthermore no problem as the user cannot use the peripheral for something else at the same time (this would eg. be a problem when working with an I2C or SPI peripheral), but the LTDC is fully dedicated to uGFX when enabled.
Inside the the ChibiOS/RT sources I see that CMSIS headers are being included, but with the following comment:
Code: Select all
/* Including the device CMSIS header. Note, we are not using the definitions
from this header because we need this file to be usable also from
assembler source files. We verify that the info matches instead.*/
#include "stm32f4xx.h"
I am not really sure what is happening here. I just want to be sure that the CMSIS macros for STM32F4, STM32F7 and so on will be available so that ChibiOS/RT users can use the LTDC driver without any additional modifications.
~ Tectu