Struct esp_ward::display::ili9341::Ili9341Display

source ·
pub struct Ili9341Display<T: _esp_hal_spi_master_Instance + 'static, M: IsFullDuplex, RST: OutputPin<Error = Infallible>, DC: OutputPin<Error = Infallible>> {
    pub inner: Display<SPIInterfaceNoCS<Spi<'static, T, M>, DC>, ILI9341Rgb565, RST>,
}
Expand description

The Ili9341Display struct represents an ILI9341 display connected via SPI.

It encapsulates the lower-level details of communicating with the display and provides a high-level interface for drawing and text rendering.

Fields§

§inner: Display<SPIInterfaceNoCS<Spi<'static, T, M>, DC>, ILI9341Rgb565, RST>

The inner display instance from the mipidsi crate configured for ILI9341 and RGB565 color mode.

Implementations§

source§

impl<T: _esp_hal_spi_master_Instance + 'static, M: IsFullDuplex, RST: OutputPin<Error = Infallible>, DC: OutputPin<Error = Infallible>> Ili9341Display<T, M, RST, DC>

source

pub fn create_on_spi( spi: Spi<'static, T, M>, reset: RST, dc: DC, delay: Delay ) -> Ili9341Display<T, M, RST, DC>

Constructs a new Ili9341Display.

Initializes the display over SPI, resets it, and prepares it for drawing operations.

§Arguments
  • spi - The SPI interface used to communicate with the display.
  • reset - The pin used to reset the display.
  • dc - The data/command control pin.
  • delay - The delay provider to use for timing-sensitive operations.
§Returns

An initialized Ili9341Display object ready for use.

Trait Implementations§

source§

impl<T: _esp_hal_spi_master_Instance + 'static, M: IsFullDuplex, RST: OutputPin<Error = Infallible>, DC: OutputPin<Error = Infallible>> Display for Ili9341Display<T, M, RST, DC>

source§

fn set_pixel(&mut self, x: usize, y: usize)

Sets a single pixel on the display

§Arguments
  • x - The x coordinate of the pixel.
  • y - The y coordinate of the pixel.
source§

fn write_str(&mut self, s: &str)

Writes a string to the center segment of the display using a mid-sized default font style.

§Arguments
  • s - The string to be written on the display.
source§

fn reset(&mut self)

Resets the display, filling it with a white color.

This can be used to clear the display before drawing new items.

source§

impl<T: _esp_hal_spi_master_Instance + 'static, M: IsFullDuplex, RST: OutputPin<Error = Infallible>, DC: OutputPin<Error = Infallible>> EGDisplay for Ili9341Display<T, M, RST, DC>

source§

fn write_to_segment( &mut self, segment: DisplaySegment, text: &str, font: MonoTextStyle<'_, Rgb565> )

Writes a string to a specified display segment using the provided font style (you can use default DEFAULT_STYLE_SMALL/MID/LARGE).

§Arguments
  • segment - The segment of the display where the text will be written.
  • text - The string to write to the display.
  • font - The font style to use for rendering the text.
source§

fn write_segment_name( &mut self, segment: DisplaySegment, name: &str, font: MonoTextStyle<'_, Rgb565> )

Writes a section name to a specified display segment using the provided font style (you can use default DEFAULT_STYLE_SMALL/MID/LARGE). This is typically used for labeling sections of the display, such as headers or titles.

§Arguments
  • segment - The segment of the display where the section name will be written.
  • name - The name to write to the display.
  • font - The font style to use for rendering the name.

Auto Trait Implementations§

§

impl<T, M, RST, DC> Freeze for Ili9341Display<T, M, RST, DC>
where RST: Freeze, DC: Freeze, T: Freeze,

§

impl<T, M, RST, DC> RefUnwindSafe for Ili9341Display<T, M, RST, DC>
where RST: RefUnwindSafe, DC: RefUnwindSafe, T: RefUnwindSafe, M: RefUnwindSafe,

§

impl<T, M, RST, DC> Send for Ili9341Display<T, M, RST, DC>
where RST: Send, DC: Send, T: Send, M: Send,

§

impl<T, M, RST, DC> Sync for Ili9341Display<T, M, RST, DC>
where RST: Sync, DC: Sync, T: Sync, M: Sync,

§

impl<T, M, RST, DC> Unpin for Ili9341Display<T, M, RST, DC>
where RST: Unpin, DC: Unpin, T: Unpin, M: Unpin,

§

impl<T, M, RST, DC> !UnwindSafe for Ili9341Display<T, M, RST, DC>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.