pub trait Epd<HW>where
HW: EpdHw,{
type Command;
type Buffer;
// Required methods
async fn init(&mut self, lut: &[u8]) -> Result<(), HW::Error>;
async fn clear(&mut self) -> Result<(), HW::Error>;
async fn reset(&mut self) -> Result<(), HW::Error>;
async fn sleep(&mut self) -> Result<(), HW::Error>;
async fn wake(&mut self) -> Result<(), HW::Error>;
async fn display_buffer(
&mut self,
buffer: &Self::Buffer,
) -> Result<(), HW::Error>;
async fn set_window(&mut self, shape: Rectangle) -> Result<(), HW::Error>;
async fn set_cursor(
&mut self,
position: Point,
) -> Result<(), <HW as EpdHw>::Error>;
async fn write_image(&mut self, image: &[u8]) -> Result<(), HW::Error>;
async fn update_display(&mut self) -> Result<(), HW::Error>;
async fn send(
&mut self,
command: Self::Command,
data: &[u8],
) -> Result<(), HW::Error>;
async fn wait_if_busy(&mut self) -> Result<(), HW::Error>;
}Required Associated Types§
Required Methods§
Sourceasync fn init(&mut self, lut: &[u8]) -> Result<(), HW::Error>
async fn init(&mut self, lut: &[u8]) -> Result<(), HW::Error>
Initialise the display. This must be called before any other operations.
Sourceasync fn clear(&mut self) -> Result<(), HW::Error>
async fn clear(&mut self) -> Result<(), HW::Error>
Clear the display. This may or may not clear internal RAM.
Sourceasync fn reset(&mut self) -> Result<(), HW::Error>
async fn reset(&mut self) -> Result<(), HW::Error>
Hardware reset the display. The display must be reinitialised after calling this.
Sourceasync fn wake(&mut self) -> Result<(), HW::Error>
async fn wake(&mut self) -> Result<(), HW::Error>
Wakes and re-initialises the display if it’s asleep.
Sourceasync fn display_buffer(
&mut self,
buffer: &Self::Buffer,
) -> Result<(), HW::Error>
async fn display_buffer( &mut self, buffer: &Self::Buffer, ) -> Result<(), HW::Error>
Writes the buffers data to the display and displays it.
Sourceasync fn set_window(&mut self, shape: Rectangle) -> Result<(), HW::Error>
async fn set_window(&mut self, shape: Rectangle) -> Result<(), HW::Error>
Sets the window to write to during a call to [write_image]. This can enable partial writes to a subsection of the display.
Sourceasync fn set_cursor(
&mut self,
position: Point,
) -> Result<(), <HW as EpdHw>::Error>
async fn set_cursor( &mut self, position: Point, ) -> Result<(), <HW as EpdHw>::Error>
Sets the cursor position for where the next byte of image data will be written.
Sourceasync fn write_image(&mut self, image: &[u8]) -> Result<(), HW::Error>
async fn write_image(&mut self, image: &[u8]) -> Result<(), HW::Error>
Writes raw image data, starting at the current cursor position and auto-incrementing x then y within the current window.
Sourceasync fn update_display(&mut self) -> Result<(), HW::Error>
async fn update_display(&mut self) -> Result<(), HW::Error>
Updates (refreshes) the display to match the latest data that has been written to RAM.
Sourceasync fn send(
&mut self,
command: Self::Command,
data: &[u8],
) -> Result<(), HW::Error>
async fn send( &mut self, command: Self::Command, data: &[u8], ) -> Result<(), HW::Error>
Send the following command and data to the display. Waits until the display is no longer busy before sending.
Sourceasync fn wait_if_busy(&mut self) -> Result<(), HW::Error>
async fn wait_if_busy(&mut self) -> Result<(), HW::Error>
Waits for the current operation to complete if the display is busy. Note that this will wait forever if the display is asleep.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.