[−][src]Struct st7789::ST7789
ST7789 driver to connect to TFT displays.
Methods
impl<DI, RST, PinE> ST7789<DI, RST> where
DI: WriteOnlyDataCommand<u8>,
RST: OutputPin<Error = PinE>,
[src]
DI: WriteOnlyDataCommand<u8>,
RST: OutputPin<Error = PinE>,
pub fn new(di: DI, rst: RST, size_x: u16, size_y: u16) -> Self
[src]
Creates a new ST7789 driver instance
Arguments
spi
- an SPI interface to use for talking to the displaydi
- a display interface for talking with the displaycsx
- the chip select pin documented in the datasheetdc
- data/clock pin switchrst
- display hard reset pinsize_x
- x axis resolution of the display in pixelssize_y
- y axis resolution of the display in pixels
pub fn init(
&mut self,
delay_source: &mut impl DelayUs<u32>
) -> Result<(), Error<PinE>>
[src]
&mut self,
delay_source: &mut impl DelayUs<u32>
) -> Result<(), Error<PinE>>
Runs commands to initialize the display
pub fn hard_reset(
&mut self,
delay_source: &mut impl DelayUs<u32>
) -> Result<(), Error<PinE>>
[src]
&mut self,
delay_source: &mut impl DelayUs<u32>
) -> Result<(), Error<PinE>>
Performs a hard reset using the RST pin sequence
pub fn set_orientation(
&mut self,
orientation: &Orientation
) -> Result<(), Error<PinE>>
[src]
&mut self,
orientation: &Orientation
) -> Result<(), Error<PinE>>
Sets display orientation
pub fn set_pixel(
&mut self,
x: u16,
y: u16,
color: u16
) -> Result<(), Error<PinE>>
[src]
&mut self,
x: u16,
y: u16,
color: u16
) -> Result<(), Error<PinE>>
Sets a pixel color at the given coords.
Arguments
x
- x coordinatey
- y coordinatecolor
- 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]
&mut self,
sx: u16,
sy: u16,
ex: u16,
ey: u16,
colors: T
) -> Result<(), Error<PinE>> where
T: IntoIterator<Item = u16>,
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
Trait Implementations
impl<DI, RST, PinE> DrawTarget<Rgb565> for ST7789<DI, RST> where
DI: WriteOnlyDataCommand<u8>,
RST: OutputPin<Error = PinE>,
[src]
DI: WriteOnlyDataCommand<u8>,
RST: OutputPin<Error = PinE>,
type Error = Error<PinE>
Error type to return when a drawing operation fails. Read more
fn draw_pixel(&mut self, pixel: Pixel<Rgb565>) -> Result<(), Self::Error>
[src]
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error> where
T: IntoIterator<Item = Pixel<Rgb565>>,
[src]
T: IntoIterator<Item = Pixel<Rgb565>>,
fn draw_rectangle(
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<Rgb565>>
) -> Result<(), Self::Error>
fn draw_image<'a, 'b, I>(
&mut self,
item: &'a Image<'b, I, Rgb565>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<Rgb565>,
I: ImageDimensions,
[src]
&mut self,
item: &'a Image<'b, I, Rgb565>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<Rgb565>,
I: ImageDimensions,
fn size(&self) -> Size
[src]
fn clear(&mut self, color: Rgb565) -> Result<(), Self::Error> where
Self: Sized,
[src]
Self: Sized,
fn draw_line(
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_triangle(
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_circle(
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
Auto Trait Implementations
impl<DI, RST> Send for ST7789<DI, RST> where
DI: Send,
RST: Send,
DI: Send,
RST: Send,
impl<DI, RST> Sync for ST7789<DI, RST> where
DI: Sync,
RST: Sync,
DI: Sync,
RST: Sync,
impl<DI, RST> Unpin for ST7789<DI, RST> where
DI: Unpin,
RST: Unpin,
DI: Unpin,
RST: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,