|
|
|
@ -3,20 +3,15 @@ use hal::{ |
|
|
|
blocking::{delay::*, spi::Write}, |
|
|
|
blocking::{delay::*, spi::Write}, |
|
|
|
digital::*, |
|
|
|
digital::*, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
use color::Color; |
|
|
|
use color::Color; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// All commands need to have this trait which gives the address of the command
|
|
|
|
/// All commands need to have this trait which gives the address of the command
|
|
|
|
/// which needs to be send via SPI with activated CommandsPin (Data/Command Pin in CommandMode)
|
|
|
|
/// which needs to be send via SPI with activated CommandsPin (Data/Command Pin in CommandMode)
|
|
|
|
pub(crate) trait Command { |
|
|
|
pub(crate) trait Command { |
|
|
|
fn address(self) -> u8; |
|
|
|
fn address(self) -> u8; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Trait for using various Waveforms from different LUTs
|
|
|
|
// Trait for using various Waveforms from different LUTs
|
|
|
|
// E.g. for partial updates
|
|
|
|
// E.g. for partial updates
|
|
|
|
trait LUTSupport<ERR> { |
|
|
|
trait LUTSupport<ERR> { |
|
|
|
@ -25,7 +20,6 @@ trait LUTSupport<ERR> { |
|
|
|
fn set_lut_manual(&mut self, data: &[u8]) -> Result<(), ERR>; |
|
|
|
fn set_lut_manual(&mut self, data: &[u8]) -> Result<(), ERR>; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub(crate) trait InternalWiAdditions<SPI, CS, BUSY, DC, RST> |
|
|
|
pub(crate) trait InternalWiAdditions<SPI, CS, BUSY, DC, RST> |
|
|
|
where |
|
|
|
where |
|
|
|
SPI: Write<u8>, |
|
|
|
SPI: Write<u8>, |
|
|
|
@ -48,6 +42,9 @@ where |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// All the functions to interact with the EPDs
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// This trait includes all public functions to use the EPDS
|
|
|
|
pub trait WaveshareDisplay<SPI, CS, BUSY, DC, RST> |
|
|
|
pub trait WaveshareDisplay<SPI, CS, BUSY, DC, RST> |
|
|
|
where |
|
|
|
where |
|
|
|
SPI: Write<u8>, |
|
|
|
SPI: Write<u8>, |
|
|
|
@ -73,6 +70,7 @@ where |
|
|
|
/// and initialising which already contains the reset
|
|
|
|
/// and initialising which already contains the reset
|
|
|
|
fn sleep(&mut self, spi: &mut SPI) -> Result<(), SPI::Error>; |
|
|
|
fn sleep(&mut self, spi: &mut SPI) -> Result<(), SPI::Error>; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Wakes the device up from sleep
|
|
|
|
fn wake_up<DELAY: DelayMs<u8>>(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error>;
|
|
|
|
fn wake_up<DELAY: DelayMs<u8>>(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|