Struct SPIInterface

Source
pub struct SPIInterface<SPI, DC> { /* private fields */ }
Expand description

SPI display interface.

This combines the SPI peripheral and a data/command pin

Implementations§

Source§

impl<SPI, DC> SPIInterface<SPI, DC>

Source

pub fn new(spi: SPI, dc: DC) -> Self

Create new SPI interface for communication with a display driver

Source

pub fn release(self) -> (SPI, DC)

Consume the display interface and return the underlying peripheral driver and GPIO pins used by it

Trait Implementations§

Source§

impl<SPI, DC> AsyncWriteOnlyDataCommand for SPIInterface<SPI, DC>
where SPI: SpiDevice, DC: OutputPin,

Source§

async fn send_commands( &mut self, cmds: DataFormat<'_>, ) -> Result<(), DisplayError>

Send a batch of commands to display
Source§

async fn send_data(&mut self, buf: DataFormat<'_>) -> Result<(), DisplayError>

Send pixel data to display
Source§

impl<SPI, DC> WriteOnlyDataCommand for SPIInterface<SPI, DC>
where SPI: SpiDevice, DC: OutputPin,

Source§

fn send_commands(&mut self, cmds: DataFormat<'_>) -> Result<(), DisplayError>

Send a batch of commands to display
Source§

fn send_data(&mut self, buf: DataFormat<'_>) -> Result<(), DisplayError>

Send pixel data to display

Auto Trait Implementations§

§

impl<SPI, DC> Freeze for SPIInterface<SPI, DC>
where SPI: Freeze, DC: Freeze,

§

impl<SPI, DC> RefUnwindSafe for SPIInterface<SPI, DC>
where SPI: RefUnwindSafe, DC: RefUnwindSafe,

§

impl<SPI, DC> Send for SPIInterface<SPI, DC>
where SPI: Send, DC: Send,

§

impl<SPI, DC> Sync for SPIInterface<SPI, DC>
where SPI: Sync, DC: Sync,

§

impl<SPI, DC> Unpin for SPIInterface<SPI, DC>
where SPI: Unpin, DC: Unpin,

§

impl<SPI, DC> UnwindSafe for SPIInterface<SPI, DC>
where SPI: UnwindSafe, DC: UnwindSafe,

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.