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>
impl<T: _esp_hal_spi_master_Instance + 'static, M: IsFullDuplex, RST: OutputPin<Error = Infallible>, DC: OutputPin<Error = Infallible>> Ili9341Display<T, M, RST, DC>
sourcepub fn create_on_spi(
spi: Spi<'static, T, M>,
reset: RST,
dc: DC,
delay: Delay
) -> Ili9341Display<T, M, RST, DC>
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>
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)
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§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>
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>
)
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>
)
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.