pub struct DisplayDriver<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32, C> { /* private fields */ }Expand description
The main driver struct that manages the communication with the display.
You probably want to use one of the display-specific type aliases instead.
Implementations§
Source§impl<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32, C> DisplayDriver<DI, BSY, RST, DELAY, WIDTH, VISIBLE_WIDTH, HEIGHT, C>
impl<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32, C> DisplayDriver<DI, BSY, RST, DELAY, WIDTH, VISIBLE_WIDTH, HEIGHT, C>
Sourcepub fn new(interface: DI, busy: BSY, reset: RST, delay: DELAY) -> Self
pub fn new(interface: DI, busy: BSY, reset: RST, delay: DELAY) -> Self
Create a new display driver.
Use Self::init to initialize the display.
Sourcepub fn write_bw_buffer(&mut self, buffer: &[u8]) -> Result<()>
pub fn write_bw_buffer(&mut self, buffer: &[u8]) -> Result<()>
Write to the B/W buffer.
Sourcepub fn write_red_buffer(&mut self, buffer: &[u8]) -> Result<()>
pub fn write_red_buffer(&mut self, buffer: &[u8]) -> Result<()>
Write to the red buffer.
On B/W displays this buffer is used for fast refreshes.
Sourcepub fn write_partial_bw_buffer(
&mut self,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<()>
pub fn write_partial_bw_buffer( &mut self, buffer: &[u8], x: u32, y: u32, width: u32, height: u32, ) -> Result<()>
Write to the B/W buffer at the given position.
x, and width must be multiples of 8.
Sourcepub fn write_partial_red_buffer(
&mut self,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<()>
pub fn write_partial_red_buffer( &mut self, buffer: &[u8], x: u32, y: u32, width: u32, height: u32, ) -> Result<()>
Write to the red buffer at the given position.
x, and width must be multiples of 8.
On B/W displays this buffer is used for fast refreshes.
Sourcepub fn clear_bw_buffer(&mut self) -> Result<()>
pub fn clear_bw_buffer(&mut self) -> Result<()>
Make the whole black and white frame on the display driver white.
Sourcepub fn clear_red_buffer(&mut self) -> Result<()>
pub fn clear_red_buffer(&mut self) -> Result<()>
Make the whole red frame on the display driver white.
On B/W displays this buffer is used for fast refreshes.
Sourcepub fn full_refresh(&mut self) -> Result<()>
pub fn full_refresh(&mut self) -> Result<()>
Start a full refresh of the display.
Sourcepub fn sleep(&mut self) -> Result<()>
pub fn sleep(&mut self) -> Result<()>
Put the device into deep-sleep mode.
You will need to call Self::wake_up before you can draw to the screen again.
Source§impl<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32> DisplayDriver<DI, BSY, RST, DELAY, WIDTH, VISIBLE_WIDTH, HEIGHT, Color>
Functions available only for B/W displays
impl<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32> DisplayDriver<DI, BSY, RST, DELAY, WIDTH, VISIBLE_WIDTH, HEIGHT, Color>
Functions available only for B/W displays
Sourcepub fn fast_refresh(&mut self) -> Result<()>
pub fn fast_refresh(&mut self) -> Result<()>
Start a fast refresh of the display using the current in-screen buffers.
If the display hasn’t done a Self::full_refresh yet, it will do that first.
Sourcepub fn full_update_from_buffer(&mut self, buffer: &[u8]) -> Result<()>
pub fn full_update_from_buffer(&mut self, buffer: &[u8]) -> Result<()>
Update the screen with the provided full frame buffer using a full refresh.
Sourcepub fn fast_update_from_buffer(&mut self, buffer: &[u8]) -> Result<()>
pub fn fast_update_from_buffer(&mut self, buffer: &[u8]) -> Result<()>
Update the screen with the provided full frame buffer using a fast refresh.
Sourcepub fn fast_partial_update_from_buffer(
&mut self,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<()>
pub fn fast_partial_update_from_buffer( &mut self, buffer: &[u8], x: u32, y: u32, width: u32, height: u32, ) -> Result<()>
Update the screen with the provided partial frame buffer at the given position using a fast refresh.
x, and width must be multiples of 8.
Sourcepub fn full_update<const BUFFER_SIZE: usize>(
&mut self,
display: &Display<WIDTH, HEIGHT, BUFFER_SIZE, Color>,
) -> Result<()>
Available on crate feature graphics only.
pub fn full_update<const BUFFER_SIZE: usize>( &mut self, display: &Display<WIDTH, HEIGHT, BUFFER_SIZE, Color>, ) -> Result<()>
graphics only.Update the screen with the provided Display using a full refresh.
Sourcepub fn fast_update<const BUFFER_SIZE: usize>(
&mut self,
display: &Display<WIDTH, HEIGHT, BUFFER_SIZE, Color>,
) -> Result<()>
Available on crate feature graphics only.
pub fn fast_update<const BUFFER_SIZE: usize>( &mut self, display: &Display<WIDTH, HEIGHT, BUFFER_SIZE, Color>, ) -> Result<()>
graphics only.Update the screen with the provided Display using a fast refresh.
Sourcepub fn fast_partial_update<const W: u32, const H: u32, const BUFFER_SIZE: usize>(
&mut self,
display: &Display<W, H, BUFFER_SIZE, Color>,
x: u32,
y: u32,
) -> Result<()>
Available on crate feature graphics only.
pub fn fast_partial_update<const W: u32, const H: u32, const BUFFER_SIZE: usize>( &mut self, display: &Display<W, H, BUFFER_SIZE, Color>, x: u32, y: u32, ) -> Result<()>
graphics only.Update the screen with the provided partial Display at the given position using a fast refresh.
x and the display width W must be multiples of 8.
Source§impl<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32> DisplayDriver<DI, BSY, RST, DELAY, WIDTH, VISIBLE_WIDTH, HEIGHT, TriColor>
Functions available only for tri-color displays
impl<DI, BSY, RST, DELAY, const WIDTH: u32, const VISIBLE_WIDTH: u32, const HEIGHT: u32> DisplayDriver<DI, BSY, RST, DELAY, WIDTH, VISIBLE_WIDTH, HEIGHT, TriColor>
Functions available only for tri-color displays