embassy-stm32

Crates

git

Versions

stm32l4s7ai

Flavors

embassy_stm32::ltdc

Struct Ltdc

source
pub struct Ltdc<'d, T: Instance> { /* private fields */ }
Expand description

LTDC driver.

Implementations§

source§

impl<'d, T: Instance> Ltdc<'d, T>

source

pub fn new(peri: impl Peripheral<P = T> + 'd) -> Self

Note: Full-Duplex modes are not supported at this time

source

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

source

pub fn init(&mut self, config: &LtdcConfiguration)

Initialise and enable the display

source

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

source

pub fn disable(&mut self)

Unset the enable bit in the control register and assert that it has been disabled

source

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

source

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)

Trait Implementations§

source§

impl<'d, T: Instance> Drop for Ltdc<'d, T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'d, T> Freeze for Ltdc<'d, T>
where T: Freeze,

§

impl<'d, T> RefUnwindSafe for Ltdc<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> Send for Ltdc<'d, T>

§

impl<'d, T> Sync for Ltdc<'d, T>
where T: Sync,

§

impl<'d, T> Unpin for Ltdc<'d, T>
where T: Unpin,

§

impl<'d, T> !UnwindSafe for Ltdc<'d, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.