pub struct Builder { /* private fields */ }
Expand description
Builder struct. Driver options and interface are set using its methods.
See the module level documentation for more details.
Implementations§
source§impl Builder
impl Builder
sourcepub fn with_size(self, display_size: DisplaySize) -> Self
pub fn with_size(self, display_size: DisplaySize) -> Self
Set the size of the display. Supported sizes are defined by DisplaySize.
sourcepub fn with_i2c_addr(self, i2c_addr: u8) -> Self
pub fn with_i2c_addr(self, i2c_addr: u8) -> Self
Set the I2C address to use. Defaults to 0x3C which is the most common address. The other address specified in the datasheet is 0x3D. Ignored when using SPI interface.
sourcepub fn with_rotation(self, rotation: DisplayRotation) -> Self
pub fn with_rotation(self, rotation: DisplayRotation) -> Self
Set the rotation of the display to one of four values. Defaults to no rotation.
sourcepub fn connect_i2c<I2C, CommE>(
self,
i2c: I2C
) -> DisplayMode<RawMode<I2cInterface<I2C>>>where
I2C: Write<Error = CommE>,
pub fn connect_i2c<I2C, CommE>( self, i2c: I2C ) -> DisplayMode<RawMode<I2cInterface<I2C>>>where I2C: Write<Error = CommE>,
Finish the builder and use I2C to communicate with the display
sourcepub fn connect_spi<SPI, DC, CS, CommE, PinE>(
self,
spi: SPI,
dc: DC,
cs: CS
) -> DisplayMode<RawMode<SpiInterface<SPI, DC, CS>>>where
SPI: Transfer<u8, Error = CommE> + Write<u8, Error = CommE>,
DC: OutputPin<Error = PinE>,
CS: OutputPin<Error = PinE>,
pub fn connect_spi<SPI, DC, CS, CommE, PinE>( self, spi: SPI, dc: DC, cs: CS ) -> DisplayMode<RawMode<SpiInterface<SPI, DC, CS>>>where SPI: Transfer<u8, Error = CommE> + Write<u8, Error = CommE>, DC: OutputPin<Error = PinE>, CS: OutputPin<Error = PinE>,
Finish the builder and use SPI to communicate with the display
If the Chip Select (CS) pin is not required, NoOutputPin
can be used as a dummy argument
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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.