diff --git a/examples/embedded_linux/src/main.rs b/examples/embedded_linux/src/main.rs index de2cab4..68c9fa1 100644 --- a/examples/embedded_linux/src/main.rs +++ b/examples/embedded_linux/src/main.rs @@ -111,7 +111,7 @@ fn main() { 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_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); @@ -125,6 +125,28 @@ fn main() { 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.sleep().expect("sleeping error"); diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index 1752420..33ccb7f 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -211,6 +211,9 @@ where /// Transmit partial data to the SRAM of the EPD, /// the final parameter dtm chooses between the 2 /// internal buffers + /// + /// Normally it should be dtm2, so use false + /// /// 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> { if buffer.len() as u16 != w / 8 * l {