Trait DisplayInterface

Source
pub trait DisplayInterface {
    // Required methods
    fn send_command(&mut self, command: u8) -> Result<(), DisplayError>;
    fn send_data(&mut self, data: &[u8]) -> Result<(), DisplayError>;
    fn send_data_from_iter<'a, I>(
        &mut self,
        iter: I,
    ) -> Result<(), DisplayError>
       where I: IntoIterator<Item = &'a u8>;
    fn busy_wait(&self);
    fn reset<D>(&mut self, delay: &mut D, initial_delay: u32, duration: u32)
       where D: DelayUs<u32>;

    // Provided method
    fn send_command_data(
        &mut self,
        command: u8,
        data: &[u8],
    ) -> Result<(), DisplayError> { ... }
}
Expand description

Trait implemented by displays to provide implemenation of core functionality.

Required Methods§

Source

fn send_command(&mut self, command: u8) -> Result<(), DisplayError>

Send a command to the controller.

Source

fn send_data(&mut self, data: &[u8]) -> Result<(), DisplayError>

Send data for a command.

Source

fn send_data_from_iter<'a, I>(&mut self, iter: I) -> Result<(), DisplayError>
where I: IntoIterator<Item = &'a u8>,

Send data via iter

Source

fn busy_wait(&self)

Wait for the controller to indicate it is not busy.

Source

fn reset<D>(&mut self, delay: &mut D, initial_delay: u32, duration: u32)
where D: DelayUs<u32>,

Hard reset

Provided Methods§

Source

fn send_command_data( &mut self, command: u8, data: &[u8], ) -> Result<(), DisplayError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<SPI, CS, DC, RST, BUSY> DisplayInterface for EPDInterface<SPI, CS, DC, RST, BUSY>
where SPI: Write<u8>, DC: OutputPin, CS: OutputPin, RST: OutputPin, BUSY: InputPin,

Source§

impl<SPI, DC, RST, BUSY> DisplayInterface for EPDInterfaceNoCS<SPI, DC, RST, BUSY>
where SPI: Write<u8>, DC: OutputPin, RST: OutputPin, BUSY: InputPin,