pub struct Builder<DI, MODEL, RST>{ /* private fields */ }
Expand description
Builder for Display instances.
Exposes all possible display options.
§Examples
use lcd_async::{Builder, options::ColorOrder, models::ILI9342CRgb565};
let mut display = Builder::new(ILI9342CRgb565, di)
.reset_pin(rst)
.color_order(ColorOrder::Bgr)
.display_size(320, 240)
.init(&mut delay).await.unwrap();
Implementations§
Source§impl<DI, MODEL> Builder<DI, MODEL, NoResetPin>
impl<DI, MODEL> Builder<DI, MODEL, NoResetPin>
Source§impl<DI, MODEL, RST> Builder<DI, MODEL, RST>
impl<DI, MODEL, RST> Builder<DI, MODEL, RST>
Sourcepub fn invert_colors(self, color_inversion: ColorInversion) -> Self
pub fn invert_colors(self, color_inversion: ColorInversion) -> Self
Sets the invert color flag
Sourcepub fn color_order(self, color_order: ColorOrder) -> Self
pub fn color_order(self, color_order: ColorOrder) -> Self
Sets the ColorOrder
Sourcepub fn orientation(self, orientation: Orientation) -> Self
pub fn orientation(self, orientation: Orientation) -> Self
Sets the Orientation
Sourcepub fn refresh_order(self, refresh_order: RefreshOrder) -> Self
pub fn refresh_order(self, refresh_order: RefreshOrder) -> Self
Sets refresh order
Sourcepub fn display_size(self, width: u16, height: u16) -> Self
pub fn display_size(self, width: u16, height: u16) -> Self
Sets the display size.
Sourcepub fn display_offset(self, x: u16, y: u16) -> Self
pub fn display_offset(self, x: u16, y: u16) -> Self
Sets the display offset
Sourcepub fn reset_pin<RST2: OutputPin>(self, rst: RST2) -> Builder<DI, MODEL, RST2>
pub fn reset_pin<RST2: OutputPin>(self, rst: RST2) -> Builder<DI, MODEL, RST2>
Sets the reset pin.
§WARNING
The reset pin needs to be in high state in order for the display to operate. If it wasn’t provided the user needs to ensure this is the case.
Sourcepub async fn init(
self,
delay_source: &mut impl DelayNs,
) -> Result<Display<DI, MODEL, RST>, InitError<DI::Error, RST::Error>>
pub async fn init( self, delay_source: &mut impl DelayNs, ) -> Result<Display<DI, MODEL, RST>, InitError<DI::Error, RST::Error>>
Consumes the builder to create a new Display with an optional reset OutputPin.
Blocks using the provided DelayNs delay_source
to perform the display initialization.
The display will be awake ready to use, no need to call Display::wake after init.
Returns InitError if the area defined by the display_size
and display_offset
settings is (partially) outside the framebuffer.
Auto Trait Implementations§
impl<DI, MODEL, RST> Freeze for Builder<DI, MODEL, RST>
impl<DI, MODEL, RST> RefUnwindSafe for Builder<DI, MODEL, RST>
impl<DI, MODEL, RST> Send for Builder<DI, MODEL, RST>
impl<DI, MODEL, RST> Sync for Builder<DI, MODEL, RST>
impl<DI, MODEL, RST> Unpin for Builder<DI, MODEL, RST>
impl<DI, MODEL, RST> UnwindSafe for Builder<DI, MODEL, RST>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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> 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.