pub struct Display<DI, MODEL, RST>where
DI: WriteOnlyDataCommand,
MODEL: Model,
RST: OutputPin,{ /* private fields */ }
Expand description
Display driver to connect to TFT displays.
Implementations§
source§impl<DI, M, RST> Display<DI, M, RST>where
DI: WriteOnlyDataCommand,
M: Model,
RST: OutputPin,
impl<DI, M, RST> Display<DI, M, RST>where
DI: WriteOnlyDataCommand,
M: Model,
RST: OutputPin,
sourcepub fn orientation(&self) -> Orientation
pub fn orientation(&self) -> Orientation
Returns currently set Orientation
sourcepub fn set_orientation(&mut self, orientation: Orientation) -> Result<(), Error>
pub fn set_orientation(&mut self, orientation: Orientation) -> Result<(), Error>
Sets display Orientation
sourcepub fn set_pixels<T>(
&mut self,
sx: u16,
sy: u16,
ex: u16,
ey: u16,
colors: T
) -> Result<(), Error>where
T: IntoIterator<Item = M::ColorFormat>,
pub fn set_pixels<T>(
&mut self,
sx: u16,
sy: u16,
ex: u16,
ey: u16,
colors: T
) -> Result<(), Error>where
T: IntoIterator<Item = M::ColorFormat>,
Sets pixel colors in given rectangle bounds.
Arguments
sx
- x coordinate startsy
- y coordinate startex
- x coordinate endey
- y coordinate endcolors
- anything that can provideIntoIterator<Item = u16>
to iterate over pixel data
sourcepub fn set_scroll_region(
&mut self,
tfa: u16,
vsa: u16,
bfa: u16
) -> Result<(), Error>
pub fn set_scroll_region(
&mut self,
tfa: u16,
vsa: u16,
bfa: u16
) -> Result<(), Error>
Sets scroll region
Arguments
tfa
- Top fixed areavsa
- Vertical scrolling areabfa
- Bottom fixed area
sourcepub fn release(self) -> (DI, M, Option<RST>)
pub fn release(self) -> (DI, M, Option<RST>)
Release resources allocated to this driver back. This returns the display interface, reset pin and and the model deconstructing the driver.
sourcepub fn set_tearing_effect(
&mut self,
tearing_effect: TearingEffect
) -> Result<(), Error>
pub fn set_tearing_effect(
&mut self,
tearing_effect: TearingEffect
) -> Result<(), Error>
Configures the tearing effect output.
Trait Implementations§
source§impl<DI, M, RST> DrawTarget for Display<DI, M, RST>where
DI: WriteOnlyDataCommand,
M: Model,
RST: OutputPin,
impl<DI, M, RST> DrawTarget for Display<DI, M, RST>where
DI: WriteOnlyDataCommand,
M: Model,
RST: OutputPin,
§type Error = DisplayError
type Error = DisplayError
Error type to return when a drawing operation fails. Read more
§type Color = <M as Model>::ColorFormat
type Color = <M as Model>::ColorFormat
The pixel color type the targetted display supports.
source§fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error>where
T: IntoIterator<Item = Pixel<Self::Color>>,
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error>where
T: IntoIterator<Item = Pixel<Self::Color>>,
Draw individual pixels to the display without a defined order. Read more
source§fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I
) -> Result<(), Self::Error>where
I: IntoIterator<Item = Self::Color>,
fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I
) -> Result<(), Self::Error>where
I: IntoIterator<Item = Self::Color>,
Fill a given area with an iterator providing a contiguous stream of pixel colors. Read more
Auto Trait Implementations§
impl<DI, MODEL, RST> RefUnwindSafe for Display<DI, MODEL, RST>where
DI: RefUnwindSafe,
MODEL: RefUnwindSafe,
RST: RefUnwindSafe,
impl<DI, MODEL, RST> Send for Display<DI, MODEL, RST>where
DI: Send,
MODEL: Send,
RST: Send,
impl<DI, MODEL, RST> Sync for Display<DI, MODEL, RST>where
DI: Sync,
MODEL: Sync,
RST: Sync,
impl<DI, MODEL, RST> Unpin for Display<DI, MODEL, RST>where
DI: Unpin,
MODEL: Unpin,
RST: Unpin,
impl<DI, MODEL, RST> UnwindSafe for Display<DI, MODEL, RST>where
DI: UnwindSafe,
MODEL: UnwindSafe,
RST: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> Dimensions for Twhere
T: OriginDimensions,
impl<T> Dimensions for Twhere
T: OriginDimensions,
source§fn bounding_box(&self) -> Rectangle
fn bounding_box(&self) -> Rectangle
Returns the bounding box.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.