added fast partial update to embedded_linux example
parent
c9578109cf
commit
d4abd54b56
|
|
@ -111,7 +111,7 @@ fn main() {
|
||||||
graphics.draw_line(&mut buffer, 0,0,400,300, &Color::Black);
|
graphics.draw_line(&mut buffer, 0,0,400,300, &Color::Black);
|
||||||
|
|
||||||
graphics.draw_filled_rectangle(&mut buffer, 200,200, 230, 230, &Color::Black);
|
graphics.draw_filled_rectangle(&mut buffer, 200,200, 230, 230, &Color::Black);
|
||||||
graphics.draw_line(&mut buffer, 200,200,200,230, &Color::White);
|
graphics.draw_line(&mut buffer, 202,202,218,228, &Color::White);
|
||||||
|
|
||||||
graphics.draw_circle(&mut buffer, 200, 150, 130, &Color::Black);
|
graphics.draw_circle(&mut buffer, 200, 150, 130, &Color::Black);
|
||||||
|
|
||||||
|
|
@ -125,6 +125,28 @@ fn main() {
|
||||||
|
|
||||||
epd4in2.delay_ms(3000);
|
epd4in2.delay_ms(3000);
|
||||||
|
|
||||||
|
epd4in2.clear_frame(None).expect("clear frame error");
|
||||||
|
|
||||||
|
let mut small_buffer = [0xff; 128];
|
||||||
|
let circle_graphics = Graphics::new(32,32);
|
||||||
|
graphics.draw_circle(&mut small_buffer, 16,16, 10, &Color::Black);
|
||||||
|
|
||||||
|
epd4in2.set_partial_window(&small_buffer, 16,16, 32,32, 2, false);
|
||||||
|
epd4in2.display_frame_quick();
|
||||||
|
|
||||||
|
epd4in2.set_partial_window(&small_buffer, 128,64, 32,32, 2, false);
|
||||||
|
epd4in2.display_frame_quick();
|
||||||
|
|
||||||
|
epd4in2.set_partial_window(&small_buffer, 320,24, 32,32, 2, false);
|
||||||
|
epd4in2.display_frame_quick();
|
||||||
|
|
||||||
|
epd4in2.set_partial_window(&small_buffer, 160,240, 32,32, 2, false);
|
||||||
|
epd4in2.display_frame_quick();
|
||||||
|
|
||||||
|
epd4in2.delay_ms(3000);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
epd4in2.clear_frame(None).expect("clear frame error");
|
epd4in2.clear_frame(None).expect("clear frame error");
|
||||||
|
|
||||||
epd4in2.sleep().expect("sleeping error");
|
epd4in2.sleep().expect("sleeping error");
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,9 @@ where
|
||||||
/// Transmit partial data to the SRAM of the EPD,
|
/// Transmit partial data to the SRAM of the EPD,
|
||||||
/// the final parameter dtm chooses between the 2
|
/// the final parameter dtm chooses between the 2
|
||||||
/// internal buffers
|
/// internal buffers
|
||||||
|
///
|
||||||
|
/// Normally it should be dtm2, so use false
|
||||||
|
///
|
||||||
/// BUFFER needs to be of size: w / 8 * l !
|
/// BUFFER needs to be of size: w / 8 * l !
|
||||||
pub fn set_partial_window(&mut self, buffer: &[u8], x: u16, y: u16, w: u16, l: u16, is_dtm1: bool) -> Result<(), E> {
|
pub fn set_partial_window(&mut self, buffer: &[u8], x: u16, y: u16, w: u16, l: u16, is_dtm1: bool) -> Result<(), E> {
|
||||||
if buffer.len() as u16 != w / 8 * l {
|
if buffer.len() as u16 != w / 8 * l {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue