[][src]Struct st7789::ST7789

pub struct ST7789<DI, RST> where
    DI: WriteOnlyDataCommand,
    RST: OutputPin
{ /* fields omitted */ }

ST7789 driver to connect to TFT displays.

Implementations

impl<DI, RST, PinE> ST7789<DI, RST> where
    DI: WriteOnlyDataCommand,
    RST: OutputPin<Error = PinE>, 
[src]

pub fn new(di: DI, rst: RST, size_x: u16, size_y: u16) -> Self[src]

Creates a new ST7789 driver instance

Arguments

  • di - a display interface for talking with the display
  • rst - display hard reset pin
  • size_x - x axis resolution of the display in pixels
  • size_y - y axis resolution of the display in pixels

pub fn init(
    &mut self,
    delay_source: &mut impl DelayUs<u32>
) -> Result<(), Error<PinE>>
[src]

Runs commands to initialize the display

Arguments

  • delay_source - mutable reference to a delay provider

pub fn hard_reset(
    &mut self,
    delay_source: &mut impl DelayUs<u32>
) -> Result<(), Error<PinE>>
[src]

Performs a hard reset using the RST pin sequence

Arguments

  • delay_source - mutable reference to a delay provider

pub fn orientation(&self) -> Orientation[src]

Returns currently set orientation

pub fn set_orientation(
    &mut self,
    orientation: Orientation
) -> Result<(), Error<PinE>>
[src]

Sets display orientation

pub fn set_pixel(
    &mut self,
    x: u16,
    y: u16,
    color: u16
) -> Result<(), Error<PinE>>
[src]

Sets a pixel color at the given coords.

Arguments

  • x - x coordinate
  • y - y coordinate
  • color - the Rgb565 color value

pub fn set_pixels<T>(
    &mut self,
    sx: u16,
    sy: u16,
    ex: u16,
    ey: u16,
    colors: T
) -> Result<(), Error<PinE>> where
    T: IntoIterator<Item = u16>, 
[src]

Sets pixel colors in given rectangle bounds.

Arguments

  • sx - x coordinate start
  • sy - y coordinate start
  • ex - x coordinate end
  • ey - y coordinate end
  • colors - anything that can provide IntoIterator<Item = u16> to iterate over pixel data

pub fn set_scroll_offset(&mut self, offset: u16) -> Result<(), Error<PinE>>[src]

Sets scroll offset "shifting" the displayed picture

Arguments

  • offset - scroll offset in pixels

pub fn release(self) -> (DI, RST)[src]

Release resources allocated to this driver back. This returns the display interface and the RST pin deconstructing the driver.

Trait Implementations

impl<DI, RST, PinE> DrawTarget<Rgb565> for ST7789<DI, RST> where
    DI: WriteOnlyDataCommand,
    RST: OutputPin<Error = PinE>, 
[src]

type Error = Error<PinE>

Error type to return when a drawing operation fails. Read more

Auto Trait Implementations

impl<DI, RST> Send for ST7789<DI, RST> where
    DI: Send,
    RST: Send

impl<DI, RST> Sync for ST7789<DI, RST> where
    DI: Sync,
    RST: Sync

impl<DI, RST> Unpin for ST7789<DI, RST> where
    DI: Unpin,
    RST: Unpin

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> Same<T> for T

type Output = T

Should always be Self

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.