mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-04 06:16:42 +00:00
Finished 2in9 support, now it needs to be tested
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user