pub struct Builder<DI, MODEL>where
DI: WriteOnlyDataCommand,
MODEL: Model,{ /* private fields */ }
Expand description
Constructor helper for creating Display instances Exposes all possible display options
Implementations§
source§impl<DI, MODEL> Builder<DI, MODEL>where
DI: WriteOnlyDataCommand,
MODEL: Model,
impl<DI, MODEL> Builder<DI, MODEL>where
DI: WriteOnlyDataCommand,
MODEL: Model,
sourcepub fn with_model(di: DI, model: MODEL) -> Self
pub fn with_model(di: DI, model: MODEL) -> Self
Constructs a new builder for given Model using the model’s
default_options
sourcepub fn with_invert_colors(self, invert_colors: bool) -> Self
pub fn with_invert_colors(self, invert_colors: bool) -> Self
Sets the invert color flag
sourcepub fn with_color_order(self, color_order: ColorOrder) -> Self
pub fn with_color_order(self, color_order: ColorOrder) -> Self
Sets the ColorOrder
sourcepub fn with_orientation(self, orientation: Orientation) -> Self
pub fn with_orientation(self, orientation: Orientation) -> Self
Sets the Orientation
sourcepub fn with_invert_vertical_refresh(self, invert: bool) -> Self
pub fn with_invert_vertical_refresh(self, invert: bool) -> Self
Inverts vertical refresh
sourcepub fn with_invert_horizontal_refresh(self, invert: bool) -> Self
pub fn with_invert_horizontal_refresh(self, invert: bool) -> Self
Inverts horizontal refresh
sourcepub fn with_display_size(self, width: u16, height: u16) -> Self
pub fn with_display_size(self, width: u16, height: u16) -> Self
Sets the display size
sourcepub fn with_framebuffer_size(self, width: u16, height: u16) -> Self
pub fn with_framebuffer_size(self, width: u16, height: u16) -> Self
Sets the framebuffer size
sourcepub fn with_window_offset_handler(
self,
window_offset_handler: fn(_: &ModelOptions) -> (u16, u16)
) -> Self
pub fn with_window_offset_handler(
self,
window_offset_handler: fn(_: &ModelOptions) -> (u16, u16)
) -> Self
Sets the window offset handler
sourcepub fn init<RST>(
self,
delay_source: &mut impl DelayUs<u32>,
rst: Option<RST>
) -> Result<Display<DI, MODEL, RST>, InitError<RST::Error>>where
RST: OutputPin,
pub fn init<RST>(
self,
delay_source: &mut impl DelayUs<u32>,
rst: Option<RST>
) -> Result<Display<DI, MODEL, RST>, InitError<RST::Error>>where
RST: OutputPin,
Consumes the builder to create a new Display with an optional reset OutputPin.
Blocks using the provided DelayUs delay_source
to perform the display initialization.
WARNING
The reset pin needs to be in high state in order for the display to operate. If it wasn’t provided the user needs to ensure this is the case.
source§impl<DI> Builder<DI, ILI9341Rgb565>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ILI9341Rgb565>where
DI: WriteOnlyDataCommand,
sourcepub fn ili9341_rgb565(di: DI) -> Self
pub fn ili9341_rgb565(di: DI) -> Self
Creates a new [Display] instance with [ILI9341] as the Model with the default framebuffer size and display size of 240x320 WARNING Rgb565 only works on non-SPI setups with the ILI9341!
Arguments
di
- a DisplayInterface for talking with the display
source§impl<DI> Builder<DI, ILI9341Rgb666>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ILI9341Rgb666>where
DI: WriteOnlyDataCommand,
sourcepub fn ili9341_rgb666(di: DI) -> Self
pub fn ili9341_rgb666(di: DI) -> Self
Creates a new [Display] instance with [ILI9341] as the Model with the default framebuffer size and display size of 320x240
Arguments
di
- a DisplayInterface for talking with the display
source§impl<DI> Builder<DI, ILI9342CRgb565>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ILI9342CRgb565>where
DI: WriteOnlyDataCommand,
sourcepub fn ili9342c_rgb565(di: DI) -> Self
pub fn ili9342c_rgb565(di: DI) -> Self
Creates a new [Display] instance with [ILI9342C] as the Model with the default framebuffer size and display size of 320x240 WARNING Rgb565 only works on non-SPI setups with the ILI9342C!
Arguments
di
- a DisplayInterface for talking with the display
source§impl<DI> Builder<DI, ILI9342CRgb666>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ILI9342CRgb666>where
DI: WriteOnlyDataCommand,
sourcepub fn ili9342c_rgb666(di: DI) -> Self
pub fn ili9342c_rgb666(di: DI) -> Self
Creates a new [Display] instance with [ILI9342C] as the Model with the default framebuffer size and display size of 320x240
Arguments
di
- a DisplayInterface for talking with the display
source§impl<DI> Builder<DI, ILI9486Rgb565>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ILI9486Rgb565>where
DI: WriteOnlyDataCommand,
sourcepub fn ili9486_rgb565(di: DI) -> Self
pub fn ili9486_rgb565(di: DI) -> Self
Creates a new [Display] instance with [ILI9486] as the Model with the default framebuffer size and display size of 320x480 WARNING Rgb565 only works on non-SPI setups with the ILI9486!
Arguments
di
- a DisplayInterface for talking with the display
source§impl<DI> Builder<DI, ILI9486Rgb666>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ILI9486Rgb666>where
DI: WriteOnlyDataCommand,
sourcepub fn ili9486_rgb666(di: DI) -> Self
pub fn ili9486_rgb666(di: DI) -> Self
Creates a new [Display] instance with [ILI9486] as the Model with the default framebuffer size and display size of 320x480
Arguments
di
- a DisplayInterface for talking with the display
source§impl<DI> Builder<DI, ST7735s>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ST7735s>where
DI: WriteOnlyDataCommand,
sourcepub fn st7735s(di: DI) -> Self
pub fn st7735s(di: DI) -> Self
Creates a new [Display] instance with ST7735s as the Model with a hard reset Pin with the default framebuffer size of 132x162 and display size of 80x160
Arguments
di
- a DisplayInterface for talking with the displayoptions
- the [DisplayOptions] for this display/model
source§impl<DI> Builder<DI, ST7789>where
DI: WriteOnlyDataCommand,
impl<DI> Builder<DI, ST7789>where
DI: WriteOnlyDataCommand,
sourcepub fn st7789(di: DI) -> Self
pub fn st7789(di: DI) -> Self
Creates a new [Display] instance with ST7789 as the super::Model with general variant using display framebuffer size of 240x320
Arguments
di
- a DisplayInterface for talking with the display
sourcepub fn st7789_pico1(di: DI) -> Self
pub fn st7789_pico1(di: DI) -> Self
Creates a new [Display] instance with ST7789 as the super::Model with pico1 variant using display and framebuffer size of 135x240 and a clipping offset
Arguments
di
- a DisplayInterface for talking with the display