From f17cae8e4935b10aa89b30359b895976891ccada Mon Sep 17 00:00:00 2001 From: Christoph Grabo Date: Sat, 11 Jan 2020 10:21:51 +0100 Subject: [PATCH] Add new optional extention trait --- src/traits.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/traits.rs b/src/traits.rs index 87142dc..9f83da5 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -174,3 +174,15 @@ where /// if the device is still busy fn is_busy(&self) -> bool; } +/// Tiny optional extension trait +pub trait WaveshareDisplayExt +where + SPI: Write, + CS: OutputPin, + BUSY: InputPin, + DC: OutputPin, + RST: OutputPin, +{ + // provide a combined update&display and save some time (skipping a busy check in between) + fn update_and_display_frame(&mut self, spi: &mut SPI, buffer: &[u8]) -> Result<(), SPI::Error>; +}