DisplayController

Struct DisplayController 

Source
pub struct DisplayController<T: 'static + SupportedWord> { /* private fields */ }

Implementations§

Source§

impl<T: 'static + SupportedWord> DisplayController<T>

Source

pub fn new( ltdc: LTDC, dma2d: DMA2D, _pins: Option<LtdcPins>, pixel_format: PixelFormat, config: DisplayConfig, hse: Option<Hertz>, ) -> DisplayController<T>

Create and configure the DisplayController

Source

pub fn config_layer( &mut self, layer: Layer, buffer: &'static mut [T], pixel_format: PixelFormat, )

Configure the layer

Note : the choice is made (for the sake of simplicity) to make the layer as big as the screen

Color Keying and CLUT are not yet supported

Source

pub fn enable_layer(&self, layer: Layer)

Enable the layer

Source

pub fn draw_pixel(&mut self, layer: Layer, x: usize, y: usize, color: T)

Draw a pixel at position (x,y) on the given layer

Source

pub unsafe fn draw_rectangle( &mut self, layer: Layer, top_left: (usize, usize), bottom_right: (usize, usize), color: u32, )

Draw hardware accelerated rectangle

§Safety

TODO: use safer DMA transfers

Source

pub fn reload(&self)

Reload display controller immediatly

Auto Trait Implementations§

§

impl<T> Freeze for DisplayController<T>

§

impl<T> !RefUnwindSafe for DisplayController<T>

§

impl<T> Send for DisplayController<T>
where T: Send,

§

impl<T> !Sync for DisplayController<T>

§

impl<T> Unpin for DisplayController<T>

§

impl<T> !UnwindSafe for DisplayController<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.