pub trait QuickRefresh<SPI, BUSY, DC, RST, DELAY>{
// Required methods
fn update_old_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error>;
fn update_new_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error>;
fn display_new_frame(
&mut self,
spi: &mut SPI,
_delay: &mut DELAY,
) -> Result<(), SPI::Error>;
fn update_and_display_new_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error>;
fn update_partial_old_frame(
&mut self,
spi: &mut SPI,
delay: &mut DELAY,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<(), SPI::Error>;
fn update_partial_new_frame(
&mut self,
spi: &mut SPI,
delay: &mut DELAY,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<(), SPI::Error>;
fn clear_partial_frame(
&mut self,
spi: &mut SPI,
delay: &mut DELAY,
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<(), SPI::Error>;
}Expand description
Allows quick refresh support for displays that support it; lets you send both old and new frame data to support this.
When using the quick refresh look-up table, the display must receive separate display buffer data marked as old, and new. This is used to determine which pixels need to change, and how they will change. This isn’t required when using full refreshes.
(todo: Example ommitted due to CI failures.) Example:
let (x, y, frame_width, frame_height) = (20, 40, 80,80);
let mut buffer = [DEFAULT_BACKGROUND_COLOR.get_byte_value(); 80 / 8 * 80];
let mut display = VarDisplay::new(frame_width, frame_height, &mut buffer,false).unwrap();
epd.update_partial_old_frame(&mut spi, &mut delay, display.buffer(), x, y, frame_width, frame_height)
.ok();
display.clear(Color::White).ok();
epd.update_partial_new_frame(&mut spi, &mut delay, display.buffer(), x, y, frame_width, frame_height)
.ok();Required Methods§
Sourcefn update_old_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error>
fn update_old_frame( &mut self, spi: &mut SPI, buffer: &[u8], delay: &mut DELAY, ) -> Result<(), SPI::Error>
Updates the old frame.
Sourcefn update_new_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error>
fn update_new_frame( &mut self, spi: &mut SPI, buffer: &[u8], delay: &mut DELAY, ) -> Result<(), SPI::Error>
Updates the new frame.
Sourcefn display_new_frame(
&mut self,
spi: &mut SPI,
_delay: &mut DELAY,
) -> Result<(), SPI::Error>
fn display_new_frame( &mut self, spi: &mut SPI, _delay: &mut DELAY, ) -> Result<(), SPI::Error>
Displays the new frame
Sourcefn update_and_display_new_frame(
&mut self,
spi: &mut SPI,
buffer: &[u8],
delay: &mut DELAY,
) -> Result<(), SPI::Error>
fn update_and_display_new_frame( &mut self, spi: &mut SPI, buffer: &[u8], delay: &mut DELAY, ) -> Result<(), SPI::Error>
Updates and displays the new frame.
Sourcefn update_partial_old_frame(
&mut self,
spi: &mut SPI,
delay: &mut DELAY,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<(), SPI::Error>
fn update_partial_old_frame( &mut self, spi: &mut SPI, delay: &mut DELAY, buffer: &[u8], x: u32, y: u32, width: u32, height: u32, ) -> Result<(), SPI::Error>
Updates the old frame for a portion of the display.
Sourcefn update_partial_new_frame(
&mut self,
spi: &mut SPI,
delay: &mut DELAY,
buffer: &[u8],
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<(), SPI::Error>
fn update_partial_new_frame( &mut self, spi: &mut SPI, delay: &mut DELAY, buffer: &[u8], x: u32, y: u32, width: u32, height: u32, ) -> Result<(), SPI::Error>
Updates the new frame for a portion of the display.
Sourcefn clear_partial_frame(
&mut self,
spi: &mut SPI,
delay: &mut DELAY,
x: u32,
y: u32,
width: u32,
height: u32,
) -> Result<(), SPI::Error>
fn clear_partial_frame( &mut self, spi: &mut SPI, delay: &mut DELAY, x: u32, y: u32, width: u32, height: u32, ) -> Result<(), SPI::Error>
Clears the partial frame buffer on the EPD with the declared background color
The background color can be changed with WaveshareDisplay::set_background_color
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".