pub struct Ltdc<'d, T: Instance> { /* private fields */ }
Expand description
LTDC driver.
Implementations§
Source§impl<'d, T: Instance> Ltdc<'d, T>
impl<'d, T: Instance> Ltdc<'d, T>
Sourcepub fn new(peri: impl Peripheral<P = T> + 'd) -> Self
pub fn new(peri: impl Peripheral<P = T> + 'd) -> Self
Note: Full-Duplex modes are not supported at this time
Sourcepub fn new_with_pins(
peri: impl Peripheral<P = T> + 'd,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
clk: impl Peripheral<P = impl ClkPin<T>> + 'd,
hsync: impl Peripheral<P = impl HsyncPin<T>> + 'd,
vsync: impl Peripheral<P = impl VsyncPin<T>> + 'd,
b0: impl Peripheral<P = impl B0Pin<T>> + 'd,
b1: impl Peripheral<P = impl B1Pin<T>> + 'd,
b2: impl Peripheral<P = impl B2Pin<T>> + 'd,
b3: impl Peripheral<P = impl B3Pin<T>> + 'd,
b4: impl Peripheral<P = impl B4Pin<T>> + 'd,
b5: impl Peripheral<P = impl B5Pin<T>> + 'd,
b6: impl Peripheral<P = impl B6Pin<T>> + 'd,
b7: impl Peripheral<P = impl B7Pin<T>> + 'd,
g0: impl Peripheral<P = impl G0Pin<T>> + 'd,
g1: impl Peripheral<P = impl G1Pin<T>> + 'd,
g2: impl Peripheral<P = impl G2Pin<T>> + 'd,
g3: impl Peripheral<P = impl G3Pin<T>> + 'd,
g4: impl Peripheral<P = impl G4Pin<T>> + 'd,
g5: impl Peripheral<P = impl G5Pin<T>> + 'd,
g6: impl Peripheral<P = impl G6Pin<T>> + 'd,
g7: impl Peripheral<P = impl G7Pin<T>> + 'd,
r0: impl Peripheral<P = impl R0Pin<T>> + 'd,
r1: impl Peripheral<P = impl R1Pin<T>> + 'd,
r2: impl Peripheral<P = impl R2Pin<T>> + 'd,
r3: impl Peripheral<P = impl R3Pin<T>> + 'd,
r4: impl Peripheral<P = impl R4Pin<T>> + 'd,
r5: impl Peripheral<P = impl R5Pin<T>> + 'd,
r6: impl Peripheral<P = impl R6Pin<T>> + 'd,
r7: impl Peripheral<P = impl R7Pin<T>> + 'd,
) -> Self
pub fn new_with_pins( peri: impl Peripheral<P = T> + 'd, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, clk: impl Peripheral<P = impl ClkPin<T>> + 'd, hsync: impl Peripheral<P = impl HsyncPin<T>> + 'd, vsync: impl Peripheral<P = impl VsyncPin<T>> + 'd, b0: impl Peripheral<P = impl B0Pin<T>> + 'd, b1: impl Peripheral<P = impl B1Pin<T>> + 'd, b2: impl Peripheral<P = impl B2Pin<T>> + 'd, b3: impl Peripheral<P = impl B3Pin<T>> + 'd, b4: impl Peripheral<P = impl B4Pin<T>> + 'd, b5: impl Peripheral<P = impl B5Pin<T>> + 'd, b6: impl Peripheral<P = impl B6Pin<T>> + 'd, b7: impl Peripheral<P = impl B7Pin<T>> + 'd, g0: impl Peripheral<P = impl G0Pin<T>> + 'd, g1: impl Peripheral<P = impl G1Pin<T>> + 'd, g2: impl Peripheral<P = impl G2Pin<T>> + 'd, g3: impl Peripheral<P = impl G3Pin<T>> + 'd, g4: impl Peripheral<P = impl G4Pin<T>> + 'd, g5: impl Peripheral<P = impl G5Pin<T>> + 'd, g6: impl Peripheral<P = impl G6Pin<T>> + 'd, g7: impl Peripheral<P = impl G7Pin<T>> + 'd, r0: impl Peripheral<P = impl R0Pin<T>> + 'd, r1: impl Peripheral<P = impl R1Pin<T>> + 'd, r2: impl Peripheral<P = impl R2Pin<T>> + 'd, r3: impl Peripheral<P = impl R3Pin<T>> + 'd, r4: impl Peripheral<P = impl R4Pin<T>> + 'd, r5: impl Peripheral<P = impl R5Pin<T>> + 'd, r6: impl Peripheral<P = impl R6Pin<T>> + 'd, r7: impl Peripheral<P = impl R7Pin<T>> + 'd, ) -> Self
Create a new LTDC driver. 8 pins per color channel for blue, green and red
Sourcepub fn init(&mut self, config: &LtdcConfiguration)
pub fn init(&mut self, config: &LtdcConfiguration)
Initialise and enable the display
Sourcepub fn enable(&mut self)
pub fn enable(&mut self)
Set the enable bit in the control register and assert that it has been enabled
This does need to be called if init has already been called
Sourcepub fn disable(&mut self)
pub fn disable(&mut self)
Unset the enable bit in the control register and assert that it has been disabled
Sourcepub fn init_layer(
&mut self,
layer_config: &LtdcLayerConfig,
clut: Option<&[RgbColor]>,
)
pub fn init_layer( &mut self, layer_config: &LtdcLayerConfig, clut: Option<&[RgbColor]>, )
Initialise and enable the layer
clut - a 256 length color look-up table applies to L8, AL44 and AL88 pixel format and will default to greyscale if None
supplied and these pixel formats are used
Sourcepub async fn set_buffer(
&mut self,
layer: LtdcLayer,
frame_buffer_addr: *const (),
) -> Result<(), Error>
pub async fn set_buffer( &mut self, layer: LtdcLayer, frame_buffer_addr: *const (), ) -> Result<(), Error>
Set the current buffer. The async function will return when buffer has been completely copied to the LCD screen frame_buffer_addr is a pointer to memory that should not move (best to make it static)