format
This commit is contained in:
parent
a376cadecc
commit
b5073bec89
|
@ -3,14 +3,14 @@ use linux_embedded_hal::spidev::SpiModeFlags;
|
|||
use linux_embedded_hal::spidev::SpidevOptions;
|
||||
use linux_embedded_hal::{CdevPin, Delay, SpidevDevice};
|
||||
|
||||
use linux_embedded_hal::gpio_cdev::{Chip, LineRequestFlags};
|
||||
use anyhow::Result;
|
||||
use linux_embedded_hal::gpio_cdev::{Chip, LineRequestFlags};
|
||||
|
||||
pub struct Wrapper {
|
||||
spi: SpidevDevice,
|
||||
gpiochip: Chip,
|
||||
delay: Delay,
|
||||
panel: Epd7in3f<SpidevDevice, CdevPin, CdevPin, CdevPin, Delay>
|
||||
panel: Epd7in3f<SpidevDevice, CdevPin, CdevPin, CdevPin, Delay>,
|
||||
}
|
||||
|
||||
impl Wrapper {
|
||||
|
@ -46,11 +46,12 @@ impl Wrapper {
|
|||
spi,
|
||||
gpiochip,
|
||||
delay,
|
||||
panel
|
||||
panel,
|
||||
})
|
||||
}
|
||||
pub fn display(&mut self, buf: &[u8]) -> Result<()>{
|
||||
self.panel.update_and_display_frame(&mut self.spi, buf, &mut self.delay)?;
|
||||
pub fn display(&mut self, buf: &[u8]) -> Result<()> {
|
||||
self.panel
|
||||
.update_and_display_frame(&mut self.spi, buf, &mut self.delay)?;
|
||||
self.panel.sleep(&mut self.spi, &mut self.delay)?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -60,4 +61,3 @@ impl Wrapper {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use image::RgbImage;
|
||||
|
||||
use image::Rgb as imgRgb;
|
||||
use palette::color_difference::{Ciede2000, EuclideanDistance};
|
||||
use palette::{cast::FromComponents, IntoColor, Lab, Oklch, Srgb};
|
||||
use palette::color_difference::Ciede2000;
|
||||
use palette::{cast::FromComponents, IntoColor, Lab, Srgb};
|
||||
|
||||
/// Palette used on the display; pixels can be one of these colors.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue