Finished 2in9 support, now it needs to be tested

This commit is contained in:
Christoph Groß
2018-07-20 13:25:30 +02:00
parent 5e03c3c39a
commit 1f2c68d16d
7 changed files with 162 additions and 367 deletions
+19
View File
@@ -70,6 +70,25 @@ where
})
}
/// Basic function for sending a single u8 of data over spi
///
/// Enables direct interaction with the device with the help of [Esend_command()](ConnectionInterface::send_command())
///
/// Should rarely be needed!
/// //TODO: make public?
pub(crate) fn send_data_x_times(&mut self, val: u8, repetitions: u16) -> Result<(), E> {
// high for data
self.dc.set_high();
// Transfer data (u8) over spi
self.with_cs(|epd| {
for _ in 0..repetitions {
epd.spi.write(&[val])?;
}
Ok(())
})
}
/// Basic function for sending an array of u8-values of data over spi
///
/// Enables direct interaction with the device with the help of [send_command()](EPD4in2::send_command())
+2 -2
View File
@@ -47,10 +47,10 @@ pub trait WaveshareInterface<SPI, CS, BUSY, DC, RST, D, E>
D: DelayUs<u16> + DelayMs<u16>,
{
/// Get the width of the display
fn get_width(&self) -> u32;
fn get_width(&self) -> u16;
/// Get the height of the display
fn get_height(&self) -> u32;
fn get_height(&self) -> u16;
/// Creates a new driver from a SPI peripheral, CS Pin, Busy InputPin, DC
///