[][src]Struct uc8159::Display

pub struct Display<SPI, TIMER, RESET, BUSY, DC, ERR = Infallible> where
    SPI: Write<u8>,
    TIMER: DelayMs<u16>,
    RESET: OutputPin,
    BUSY: InputPin,
    DC: OutputPin,
    ERR: From<SPI::Error> + From<RESET::Error> + From<BUSY::Error> + From<DC::Error>, 
{ /* fields omitted */ }

An instance of a display which is governed by a particular uc8159 controller.

Implementations

impl<SPI, DELAY, RESET, BUSY, DC, ERR> Display<SPI, DELAY, RESET, BUSY, DC, ERR> where
    SPI: Write<u8>,
    DELAY: DelayMs<u16>,
    RESET: OutputPin,
    BUSY: InputPin,
    DC: OutputPin,
    ERR: From<SPI::Error> + From<RESET::Error> + From<BUSY::Error> + From<DC::Error>, 
[src]

pub fn new(
    spi: SPI,
    delay: DELAY,
    reset: RESET,
    busy: BUSY,
    dc: DC,
    config: Config
) -> Self
[src]

Creates a new display instance.

The provided spi bus will be used for most of the communication. The delay instance is used when waiting for reset and drawing operations to complete. The reset pin can be provided to make sure the device is reset before each new draw command. The busy pin is used to poll to see when draw operations are complete. The dc pin is used to signal whether the sent spi signal is a command (low) or data (high).

pub fn width(&self) -> usize[src]

The width of the display.

pub fn height(&self) -> usize[src]

The height of the display.

pub fn fill(&mut self, color: Color)[src]

Fills the entire display using a single color.

This is a pretty fast operation compared to e.g. calling set_pixel.

pub fn copy_from(&mut self, color: &[Color])[src]

Copies data from another source in bulk.

The color data must contain exactly width() * height() elements and be in row-major order.

pub fn set_pixel(&mut self, x: usize, y: usize, color: Color)[src]

Sets a specific pixel color.

pub fn show(&mut self) -> Result<(), ERR>[src]

Displays the contents of the internal buffer to the screen.

This operation blocks until the contents are completely shown.

Trait Implementations

impl<SPI: Debug, TIMER: Debug, RESET: Debug, BUSY: Debug, DC: Debug, ERR: Debug> Debug for Display<SPI, TIMER, RESET, BUSY, DC, ERR> where
    SPI: Write<u8>,
    TIMER: DelayMs<u16>,
    RESET: OutputPin,
    BUSY: InputPin,
    DC: OutputPin,
    ERR: From<SPI::Error> + From<RESET::Error> + From<BUSY::Error> + From<DC::Error>, 
[src]

Auto Trait Implementations

impl<SPI, TIMER, RESET, BUSY, DC, ERR> RefUnwindSafe for Display<SPI, TIMER, RESET, BUSY, DC, ERR> where
    BUSY: RefUnwindSafe,
    DC: RefUnwindSafe,
    ERR: RefUnwindSafe,
    RESET: RefUnwindSafe,
    SPI: RefUnwindSafe,
    TIMER: RefUnwindSafe
[src]

impl<SPI, TIMER, RESET, BUSY, DC, ERR> Send for Display<SPI, TIMER, RESET, BUSY, DC, ERR> where
    BUSY: Send,
    DC: Send,
    ERR: Send,
    RESET: Send,
    SPI: Send,
    TIMER: Send
[src]

impl<SPI, TIMER, RESET, BUSY, DC, ERR> Sync for Display<SPI, TIMER, RESET, BUSY, DC, ERR> where
    BUSY: Sync,
    DC: Sync,
    ERR: Sync,
    RESET: Sync,
    SPI: Sync,
    TIMER: Sync
[src]

impl<SPI, TIMER, RESET, BUSY, DC, ERR> Unpin for Display<SPI, TIMER, RESET, BUSY, DC, ERR> where
    BUSY: Unpin,
    DC: Unpin,
    ERR: Unpin,
    RESET: Unpin,
    SPI: Unpin,
    TIMER: Unpin
[src]

impl<SPI, TIMER, RESET, BUSY, DC, ERR> UnwindSafe for Display<SPI, TIMER, RESET, BUSY, DC, ERR> where
    BUSY: UnwindSafe,
    DC: UnwindSafe,
    ERR: UnwindSafe,
    RESET: UnwindSafe,
    SPI: UnwindSafe,
    TIMER: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.