pub struct Dma2d<'d, T: Instance> { /* private fields */ }Expand description
DMA2D Peripheral
Implementations§
Source§impl<'d, T: Instance> Dma2d<'d, T>
impl<'d, T: Instance> Dma2d<'d, T>
Sourcepub fn new(
_peri: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Self
pub fn new( _peri: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self
Create a Dma2d peripheral
Sourcepub fn set_buffer(&self, kind: BufferKind, buffer: &Buffer2D)
pub fn set_buffer(&self, kind: BufferKind, buffer: &Buffer2D)
Configure a Buffer2D
Sourcepub fn set_region(&mut self, kind: BufferKind, region: &Region2D)
pub fn set_region(&mut self, kind: BufferKind, region: &Region2D)
Configure a Region2D
Sourcepub fn set_color_config(&mut self, kind: BufferKind, config: &ColorConfig)
pub fn set_color_config(&mut self, kind: BufferKind, config: &ColorConfig)
Set the color configuration for a buffer
Sourcepub async fn fill(&mut self, dest: &Region2D, color: u32) -> Result<(), Error>
pub async fn fill(&mut self, dest: &Region2D, color: u32) -> Result<(), Error>
Fill the output buffer with a color into an output region
Sourcepub async fn copy(&self, fg: &Buffer2D, output: &Buffer2D) -> Result<(), Error>
pub async fn copy(&self, fg: &Buffer2D, output: &Buffer2D) -> Result<(), Error>
Copy a source foreground buffer to a destination output buffer
Sourcepub async fn blit(
&mut self,
fg: &Region2D,
dest: &Region2D,
fg_color: Option<u32>,
bg_color: Option<u32>,
) -> Result<(), Error>
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.