embassy-stm32

Crates

git

Versions

stm32u599zi

Flavors

Dma2d

Struct Dma2d 

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

DMA2D Peripheral

Implementations§

Source§

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

Source

pub fn new(_peri: Peri<'d, T>) -> Self

Create a Dma2d peripheral

Source

pub fn set_buffer(&mut self, kind: BufferKind, buffer: Buffer2D)

Configure a Buffer2D

Source

pub fn set_region(&mut self, kind: BufferKind, region: &Region2D)

Configure a Region2D

Source

pub fn set_color_config(&mut self, kind: BufferKind, config: &ColorConfig)

Set the color configuration for a buffer

Source

pub async fn fill(&mut self, dest: &Region2D, color: u32) -> Result<(), Error>

Fill the output buffer with a color into an output region

Source

pub async fn blit( &mut self, fg: &Region2D, dest: &Region2D, fg_color: Option<u32>, bg_color: Option<u32>, ) -> Result<(), Error>

Blit a source to a destination region using a fixed background color and alpha blending.

Pixel format conversion is applied to convert between input and output buffer color configurations which must be set before calling blit using Dma2d::set_color_config on both [BufferKind::Foreground'] and [BufferKind::Output`]

If the input buffer is A8, a fixed color may be provided in fg_color which will set the foreground RGB channels from the FGCOLR register.

If None is provided as bg_color, the background defaults to black.

Auto Trait Implementations§

§

impl<'d, T> Freeze for Dma2d<'d, T>

§

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

§

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

§

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

§

impl<'d, T> Unpin for Dma2d<'d, T>

§

impl<'d, T> !UnwindSafe for Dma2d<'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.