Struct microbit::display::nonblocking::Display[][src]

pub struct Display<T> where
    T: Instance
{ /* fields omitted */ }
Expand description

Non-blocking interface to the on board 5x5 LED display

Implementations

Create and initialise the display driver

DisplayPins can be used from Board::display_pins or the display_pins! macro can be used is manually.

Release the timer and pins

Update the LED display and timer state

Call this in an interrupt handler for the timer you’re using. This method takes care of updating the LED display and clearing the timer’s event registers

This must be called from within a critical section.

Show a new image

This must be called from within a critical section.

Example

display.show(&GreyscaleImage::new(&[
    [0, 7, 0, 7, 0],
    [7, 0, 7, 0, 7],
    [7, 0, 0, 0, 7],
    [0, 7, 0, 7, 0],
    [0, 0, 7, 0, 0],
]));

Clear the display

This must be called from within a critical section.

Show a new frame

This is similar to show but accepts a MicrobitFrame instead. This may be useful if performance is a concern as calling set on the frame can be done outside the critical section.

This must be called from within a critical section.

Example

FRAME = MicrobitFrame::default();
FRAME.set(&GreyscaleImage::new(&[
    [0, 7, 0, 7, 0],
    [7, 0, 7, 0, 7],
    [7, 0, 0, 0, 7],
    [0, 7, 0, 7, 0],
    [0, 0, 7, 0, 0],
]));

// only this needs to be in a critical section
display.show_frame(&FRAME);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Casts the value.

Should always be Self

Casts the value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.