pub struct DisplayDriver<B: DisplayBus, P: Panel<B>> {
pub bus: B,
pub panel: P,
}Expand description
The high-level driver that orchestrates drawing operations.
This struct acts as the “glue” between the logical Panel implementation (which knows the command set)
and the DisplayBus (which handles the physical transport). It exposes user-friendly methods
for drawing pixels, filling rectangles, and managing the display state.
Fields§
§bus: BThe underlying bus interface used for communication.
panel: PThe panel.
Implementations§
Source§impl<B: DisplayBus, P: Panel<B>> DisplayDriver<B, P>
impl<B: DisplayBus, P: Panel<B>> DisplayDriver<B, P>
Sourcepub fn builder(bus: B, panel: P) -> DisplayDriverBuilder<B, P>
pub fn builder(bus: B, panel: P) -> DisplayDriverBuilder<B, P>
Sourcepub fn new(bus: B, panel: P) -> Self
pub fn new(bus: B, panel: P) -> Self
Creates a new display driver directly (without builder).
Use builder for a fluent initialization API.
Sourcepub async fn init(
&mut self,
delay: &mut impl DelayNs,
) -> Result<(), DisplayError<B::Error>>
pub async fn init( &mut self, delay: &mut impl DelayNs, ) -> Result<(), DisplayError<B::Error>>
Initializes the display.
Sourcepub async fn set_window(
&mut self,
area: Area,
) -> Result<(), DisplayError<B::Error>>
pub async fn set_window( &mut self, area: Area, ) -> Result<(), DisplayError<B::Error>>
Sets the window.
Use write_pixels or write_frame if you just want to draw a buffer.
Use fill_solid_xxx if you just want to fill an Area.
Sourcepub async fn set_color_format(
&mut self,
color_format: ColorFormat,
) -> Result<(), DisplayError<B::Error>>
pub async fn set_color_format( &mut self, color_format: ColorFormat, ) -> Result<(), DisplayError<B::Error>>
Sets the pixel color format.
Sourcepub async fn set_orientation(
&mut self,
orientation: Orientation,
) -> Result<(), DisplayError<B::Error>>
pub async fn set_orientation( &mut self, orientation: Orientation, ) -> Result<(), DisplayError<B::Error>>
Sets the display orientation.
Sourcepub async fn write_pixels(
&mut self,
area: Area,
frame_control: FrameControl,
buffer: &[u8],
) -> Result<(), DisplayError<B::Error>>
pub async fn write_pixels( &mut self, area: Area, frame_control: FrameControl, buffer: &[u8], ) -> Result<(), DisplayError<B::Error>>
Writes pixels to the specified area.
Sourcepub async fn write_frame(
&mut self,
buffer: &[u8],
) -> Result<(), DisplayError<B::Error>>
pub async fn write_frame( &mut self, buffer: &[u8], ) -> Result<(), DisplayError<B::Error>>
Writes the entire buffer to the display.
Source§impl<B: DisplayBus, P: Panel<B> + PanelSetBrightness<B>> DisplayDriver<B, P>
impl<B: DisplayBus, P: Panel<B> + PanelSetBrightness<B>> DisplayDriver<B, P>
Sourcepub async fn set_brightness(
&mut self,
brightness: u8,
) -> Result<(), DisplayError<B::Error>>
pub async fn set_brightness( &mut self, brightness: u8, ) -> Result<(), DisplayError<B::Error>>
Sets the display brightness (if supported by the panel).
Source§impl<B: DisplayBus + BusHardwareFill, P: Panel<B>> DisplayDriver<B, P>
impl<B: DisplayBus + BusHardwareFill, P: Panel<B>> DisplayDriver<B, P>
Sourcepub async fn fill_solid_via_bus(
&mut self,
color: SolidColor,
area: Area,
) -> Result<(), DisplayError<B::Error>>
pub async fn fill_solid_via_bus( &mut self, color: SolidColor, area: Area, ) -> Result<(), DisplayError<B::Error>>
Fills the area with a solid color using bus auto-fill.
Sourcepub async fn fill_screen_via_bus(
&mut self,
color: SolidColor,
) -> Result<(), DisplayError<B::Error>>
pub async fn fill_screen_via_bus( &mut self, color: SolidColor, ) -> Result<(), DisplayError<B::Error>>
Fills the entire screen with a solid color using bus auto-fill.
Source§impl<B, P> DisplayDriver<B, P>
impl<B, P> DisplayDriver<B, P>
Sourcepub async fn fill_solid_batch<const N: usize>(
&mut self,
color: SolidColor,
area: Area,
) -> Result<(), DisplayError<B::Error>>
pub async fn fill_solid_batch<const N: usize>( &mut self, color: SolidColor, area: Area, ) -> Result<(), DisplayError<B::Error>>
Fills the area with a solid color.
Sourcepub async fn fill_screen_batch<const N: usize>(
&mut self,
color: SolidColor,
) -> Result<(), DisplayError<B::Error>>
pub async fn fill_screen_batch<const N: usize>( &mut self, color: SolidColor, ) -> Result<(), DisplayError<B::Error>>
Fills the entire screen with a solid color.