Struct st7735_lcd::ST7735
source · pub struct ST7735<SPI, DC, RST>{ /* private fields */ }
Expand description
ST7735 driver to connect to TFT displays.
Implementations§
source§impl<SPI, DC, RST> ST7735<SPI, DC, RST>
impl<SPI, DC, RST> ST7735<SPI, DC, RST>
sourcepub fn new(
spi: SPI,
dc: DC,
rst: RST,
rgb: bool,
inverted: bool,
width: u32,
height: u32
) -> Self
pub fn new( spi: SPI, dc: DC, rst: RST, rgb: bool, inverted: bool, width: u32, height: u32 ) -> Self
Creates a new driver instance that uses hardware SPI.
sourcepub fn init<DELAY>(&mut self, delay: &mut DELAY) -> Result<(), ()>where
DELAY: DelayNs,
pub fn init<DELAY>(&mut self, delay: &mut DELAY) -> Result<(), ()>where
DELAY: DelayNs,
Runs commands to initialize the display.
pub fn hard_reset<DELAY>(&mut self, delay: &mut DELAY) -> Result<(), ()>where
DELAY: DelayNs,
pub fn set_orientation(&mut self, orientation: &Orientation) -> Result<(), ()>
sourcepub fn set_offset(&mut self, dx: u16, dy: u16)
pub fn set_offset(&mut self, dx: u16, dy: u16)
Sets the global offset of the displayed image
sourcepub fn set_address_window(
&mut self,
sx: u16,
sy: u16,
ex: u16,
ey: u16
) -> Result<(), ()>
pub fn set_address_window( &mut self, sx: u16, sy: u16, ex: u16, ey: u16 ) -> Result<(), ()>
Sets the address window for the display.
sourcepub fn set_pixel(&mut self, x: u16, y: u16, color: u16) -> Result<(), ()>
pub fn set_pixel(&mut self, x: u16, y: u16, color: u16) -> Result<(), ()>
Sets a pixel color at the given coords.
sourcepub fn write_pixels<P: IntoIterator<Item = u16>>(
&mut self,
colors: P
) -> Result<(), ()>
pub fn write_pixels<P: IntoIterator<Item = u16>>( &mut self, colors: P ) -> Result<(), ()>
Writes pixel colors sequentially into the current drawing window
pub fn write_pixels_buffered<P: IntoIterator<Item = u16>>( &mut self, colors: P ) -> Result<(), ()>
sourcepub fn set_pixels<P: IntoIterator<Item = u16>>(
&mut self,
sx: u16,
sy: u16,
ex: u16,
ey: u16,
colors: P
) -> Result<(), ()>
pub fn set_pixels<P: IntoIterator<Item = u16>>( &mut self, sx: u16, sy: u16, ex: u16, ey: u16, colors: P ) -> Result<(), ()>
Sets pixel colors at the given drawing window
pub fn set_pixels_buffered<P: IntoIterator<Item = u16>>( &mut self, sx: u16, sy: u16, ex: u16, ey: u16, colors: P ) -> Result<(), ()>
Trait Implementations§
source§impl<SPI, DC, RST> DrawTarget for ST7735<SPI, DC, RST>
impl<SPI, DC, RST> DrawTarget for ST7735<SPI, DC, RST>
source§fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>
fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>
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<SPI, DC, RST> Freeze for ST7735<SPI, DC, RST>
impl<SPI, DC, RST> RefUnwindSafe for ST7735<SPI, DC, RST>
impl<SPI, DC, RST> Send for ST7735<SPI, DC, RST>
impl<SPI, DC, RST> Sync for ST7735<SPI, DC, RST>
impl<SPI, DC, RST> Unpin for ST7735<SPI, DC, RST>
impl<SPI, DC, RST> UnwindSafe for ST7735<SPI, DC, 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> 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.