//! LTDC use core::marker::PhantomData; use crate::rcc::{self, RccPeripheral}; use crate::{peripherals, Peripheral}; /// LTDC driver. pub struct Ltdc<'d, T: Instance> { _peri: PhantomData<&'d mut T>, } impl<'d, T: Instance> Ltdc<'d, T> { /// Note: Full-Duplex modes are not supported at this time pub fn new( _peri: impl Peripheral
+ 'd, /* clk: impl Peripheral
> + 'd, hsync: impl Peripheral
> + 'd, vsync: impl Peripheral
> + 'd, b0: impl Peripheral
> + 'd, b1: impl Peripheral
> + 'd, b2: impl Peripheral
> + 'd, b3: impl Peripheral
> + 'd, b4: impl Peripheral
> + 'd, b5: impl Peripheral
> + 'd, b6: impl Peripheral
> + 'd, b7: impl Peripheral
> + 'd, g0: impl Peripheral
> + 'd, g1: impl Peripheral
> + 'd, g2: impl Peripheral
> + 'd, g3: impl Peripheral
> + 'd, g4: impl Peripheral
> + 'd, g5: impl Peripheral
> + 'd, g6: impl Peripheral
> + 'd, g7: impl Peripheral
> + 'd, r0: impl Peripheral
> + 'd, r1: impl Peripheral
> + 'd, r2: impl Peripheral
> + 'd, r3: impl Peripheral
> + 'd, r4: impl Peripheral
> + 'd, r5: impl Peripheral
> + 'd, r6: impl Peripheral
> + 'd, r7: impl Peripheral
> + 'd,
*/
) -> Self {
//into_ref!(clk);
critical_section::with(|_cs| {
// RM says the pllsaidivr should only be changed when pllsai is off. But this could have other unintended side effects. So let's just give it a try like this.
// According to the debugger, this bit gets set, anyway.
#[cfg(stm32f7)]
stm32_metapac::RCC
.dckcfgr1()
.modify(|w| w.set_pllsaidivr(stm32_metapac::rcc::vals::Pllsaidivr::DIV2));
// It is set to RCC_PLLSAIDIVR_2 in ST's BSP example for the STM32469I-DISCO.
#[cfg(not(any(stm32f7, stm32u5)))]
stm32_metapac::RCC
.dckcfgr()
.modify(|w| w.set_pllsaidivr(stm32_metapac::rcc::vals::Pllsaidivr::DIV2));
});
rcc::enable_and_reset::