stm32f7xx-hal
stm32f7xx-hal copied to clipboard
LTDC HAL modifies RCC clock settings directly
While I prepared PR #137 I noticed that DisplayContoller::new directly changes the RCC clock configuration. Any changes to the clock configuration at this point won't be reflected in the Clocks struct that is returned when CFGR::freeze is called.
While the changes are limited to PLLSAI, which isn't used by other peripherals at the moment, it would be better to handle all clock setup in rcc.rs.
DisplayController::new does select PLLSAI frequency to match the required pixel clock, which was probably the reason to combine LTDC and clock setup into a single function. But the same could be achieved by adding a pixel_clock(&self) -> Hertz getter to DisplayContig.
Good catch! I agree that it would be better to handle this in RCC.