Struct eink_waveshare_rs::EPD4in2 [−][src]
pub struct EPD4in2<SPI, CS, BUSY, DC, RST, D> { /* fields omitted */ }
EPD4in2 driver
Trait Implementations
impl<SPI, CS, BUSY, DC, RST, Delay, ERR> WaveshareInterface<SPI, CS, BUSY, DC, RST, Delay, ERR> for EPD4in2<SPI, CS, BUSY, DC, RST, Delay> where
SPI: Write<u8, Error = ERR>,
CS: OutputPin,
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
Delay: DelayUs<u16> + DelayMs<u16>,
[src]
impl<SPI, CS, BUSY, DC, RST, Delay, ERR> WaveshareInterface<SPI, CS, BUSY, DC, RST, Delay, ERR> for EPD4in2<SPI, CS, BUSY, DC, RST, Delay> where
SPI: Write<u8, Error = ERR>,
CS: OutputPin,
BUSY: InputPin,
DC: OutputPin,
RST: OutputPin,
Delay: DelayUs<u16> + DelayMs<u16>,
fn new(
spi: SPI,
cs: CS,
busy: BUSY,
dc: DC,
rst: RST,
delay: Delay
) -> Result<Self, ERR>
[src]
fn new(
spi: SPI,
cs: CS,
busy: BUSY,
dc: DC,
rst: RST,
delay: Delay
) -> Result<Self, ERR>
Creates a new driver from a SPI peripheral, CS Pin, Busy InputPin, DC
This already initialises the device. That means init() isn't needed directly afterwards
Example
//buffer = some image data; let mut epd4in2 = EPD4in2::new(spi, cs, busy, dc, rst, delay); epd4in2.display_and_transfer_frame(buffer, None); epd4in2.sleep();
fn wake_up(&mut self) -> Result<(), ERR>
[src]
fn wake_up(&mut self) -> Result<(), ERR>
fn sleep(&mut self) -> Result<(), ERR>
[src]
fn sleep(&mut self) -> Result<(), ERR>
Let the device enter deep-sleep mode to save power. Read more
fn update_frame(&mut self, buffer: &[u8]) -> Result<(), ERR>
[src]
fn update_frame(&mut self, buffer: &[u8]) -> Result<(), ERR>
Transmit a full frame to the SRAM of the DPD
fn update_partial_frame(
&mut self,
buffer: &[u8],
x: u16,
y: u16,
width: u16,
height: u16
) -> Result<(), ERR>
[src]
fn update_partial_frame(
&mut self,
buffer: &[u8],
x: u16,
y: u16,
width: u16,
height: u16
) -> Result<(), ERR>
Transmits partial data to the SRAM of the EPD Read more
fn display_frame(&mut self) -> Result<(), ERR>
[src]
fn display_frame(&mut self) -> Result<(), ERR>
Displays the frame data from SRAM
fn clear_frame(&mut self) -> Result<(), ERR>
[src]
fn clear_frame(&mut self) -> Result<(), ERR>
Clears the frame from the buffer with the declared background color The background color can be changed with [set_background_color
] Read more
fn set_background_color(&mut self, color: Color)
[src]
fn set_background_color(&mut self, color: Color)
Sets the backgroundcolor for various commands like WaveshareInterface::clear_frame()
fn background_color(&self) -> &Color
[src]
fn background_color(&self) -> &Color
Get current background color
fn get_width(&self) -> u16
[src]
fn get_width(&self) -> u16
Get the width of the display
fn get_height(&self) -> u16
[src]
fn get_height(&self) -> u16
Get the height of the display
fn delay_ms(&mut self, delay: u16)
[src]
fn delay_ms(&mut self, delay: u16)
Abstraction of setting the delay for simpler calls Read more
fn update_and_display_frame(&mut self, buffer: &[u8]) -> Result<(), ERR>
[src]
fn update_and_display_frame(&mut self, buffer: &[u8]) -> Result<(), ERR>
Loads a full image on the EPD and displays it
fn update_and_display_partial_frame(
&mut self,
buffer: &[u8],
x: u16,
y: u16,
width: u16,
height: u16
) -> Result<(), ERR>
[src]
fn update_and_display_partial_frame(
&mut self,
buffer: &[u8],
x: u16,
y: u16,
width: u16,
height: u16
) -> Result<(), ERR>
Loads a partial image on the EPD and displays it