Rename red to chromatic, rename epd2in9b to epd2in9bc

This commit is contained in:
Michael Beaumont
2020-03-27 19:09:12 +01:00
parent 7a5472f73a
commit b5e647b0d0
7 changed files with 83 additions and 56 deletions
+14 -2
View File
@@ -101,8 +101,13 @@ where
&mut self,
spi: &mut SPI,
black: &[u8],
red: &[u8],
chromatic: &[u8],
) -> Result<(), SPI::Error> {
self.update_achromatic_frame(spi, black)?;
self.update_chromatic_frame(spi, chromatic)
}
fn update_achromatic_frame(&mut self, spi: &mut SPI, black: &[u8]) -> Result<(), SPI::Error> {
self.wait_until_idle();
self.send_resolution(spi)?;
@@ -113,10 +118,17 @@ where
let expanded = expand_bits(*b);
self.interface.data(spi, &expanded)?;
}
Ok(())
}
fn update_chromatic_frame(
&mut self,
spi: &mut SPI,
chromatic: &[u8],
) -> Result<(), SPI::Error> {
self.interface
.cmd(spi, Command::DATA_START_TRANSMISSION_2)?;
self.interface.data(spi, red)?;
self.interface.data(spi, chromatic)?;
Ok(())
}
}