[−][src]Struct ili9341::Ili9341
There are two method for drawing to the screen: draw_raw and draw_iter.
In both cases the expected pixel format is rgb565.
The hardware makes it efficient to draw rectangles on the screen.
What happens is the following:
- A drawing window is prepared (with the 2 opposite corner coordinates)
- The starting point for drawint is the top left corner of this window
- Every pair of bytes received is intepreted as a pixel value in rgb565
- As soon as a pixel is received, an internal counter is incremented, and the next word will fill the next pixel (the adjacent on the right, or the first of the next row if the row ended)
Implementations
impl<PinE, IFACE, RESET> Ili9341<IFACE, RESET> where
IFACE: WriteOnlyDataCommand,
RESET: OutputPin<Error = PinE>,
[src]
IFACE: WriteOnlyDataCommand,
RESET: OutputPin<Error = PinE>,
pub fn new<DELAY: DelayMs<u16>>(
interface: IFACE,
reset: RESET,
delay: &mut DELAY
) -> Result<Self, Error<PinE>>
[src]
interface: IFACE,
reset: RESET,
delay: &mut DELAY
) -> Result<Self, Error<PinE>>
pub fn configure_vertical_scroll(
&mut self,
fixed_top_lines: u16,
fixed_bottom_lines: u16
) -> Result<Scroller, Error<PinE>>
[src]
&mut self,
fixed_top_lines: u16,
fixed_bottom_lines: u16
) -> Result<Scroller, Error<PinE>>
Configures the screen for hardware-accelerated vertical scrolling.
pub fn scroll_vertically(
&mut self,
scroller: &mut Scroller,
num_lines: u16
) -> Result<(), Error<PinE>>
[src]
&mut self,
scroller: &mut Scroller,
num_lines: u16
) -> Result<(), Error<PinE>>
pub fn draw_iter<I: IntoIterator<Item = u16>>(
&mut self,
x0: u16,
y0: u16,
x1: u16,
y1: u16,
data: I
) -> Result<(), Error<PinE>>
[src]
&mut self,
x0: u16,
y0: u16,
x1: u16,
y1: u16,
data: I
) -> Result<(), Error<PinE>>
Draw a rectangle on the screen, represented by top-left corner (x0, y0) and bottom-right corner (x1, y1).
The border is included.
This method accepts an iterator of rgb565 pixel values.
The iterator is useful to avoid wasting memory by holding a buffer for the whole screen when it is not necessary.
pub fn draw_raw(
&mut self,
x0: u16,
y0: u16,
x1: u16,
y1: u16,
data: &[u16]
) -> Result<(), Error<PinE>>
[src]
&mut self,
x0: u16,
y0: u16,
x1: u16,
y1: u16,
data: &[u16]
) -> Result<(), Error<PinE>>
Draw a rectangle on the screen, represented by top-left corner (x0, y0) and bottom-right corner (x1, y1).
The border is included.
This method accepts a raw buffer of words that will be copied to the screen video memory.
The expected format is rgb565.
pub fn set_orientation(&mut self, mode: Orientation) -> Result<(), Error<PinE>>
[src]
Change the orientation of the screen
pub fn width(&self) -> usize
[src]
Get the current screen width. It can change based on the current orientation
pub fn height(&self) -> usize
[src]
Get the current screen heighth. It can change based on the current orientation
Trait Implementations
impl<PinE, IFACE, RESET> DrawTarget<Rgb565> for Ili9341<IFACE, RESET> where
IFACE: WriteOnlyDataCommand,
RESET: OutputPin<Error = PinE>,
PinE: Debug,
[src]
IFACE: WriteOnlyDataCommand,
RESET: OutputPin<Error = PinE>,
PinE: Debug,
type Error = Error<PinE>
Error type to return when a drawing operation fails. Read more
fn size(&self) -> Size
[src]
fn draw_pixel(&mut self, pixel: Pixel<Rgb565>) -> Result<(), Self::Error>
[src]
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 clear(&mut self, color: Rgb565) -> Result<(), Self::Error>
[src]
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error> where
T: IntoIterator<Item = Pixel<C>>,
[src]
T: IntoIterator<Item = Pixel<C>>,
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>
fn draw_image<'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
[src]
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
Auto Trait Implementations
impl<IFACE, RESET> Send for Ili9341<IFACE, RESET> where
IFACE: Send,
RESET: Send,
IFACE: Send,
RESET: Send,
impl<IFACE, RESET> Sync for Ili9341<IFACE, RESET> where
IFACE: Sync,
RESET: Sync,
IFACE: Sync,
RESET: Sync,
impl<IFACE, RESET> Unpin for Ili9341<IFACE, RESET> where
IFACE: Unpin,
RESET: Unpin,
IFACE: Unpin,
RESET: 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,
pub 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, 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.
pub 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>,