diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dd276b0..8b072e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ SSD1306 monochrome OLED display. ### Added - Implement `embedded_graphics::draw_target::DrawTarget::fill_contiguous` to more improve performance when filling contiguous regions. +- Added `DisplaySize102x64` ## [0.10.0] - 2025-03-22 ### Changed diff --git a/src/prelude.rs b/src/prelude.rs index bf5266a6..8d779f1e 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -9,8 +9,8 @@ pub use super::{ mode::DisplayConfig, rotation::DisplayRotation, size::{ - DisplaySize, DisplaySize128x32, DisplaySize128x64, DisplaySize64x32, DisplaySize64x48, - DisplaySize72x40, DisplaySize96x16, + DisplaySize, DisplaySize102x64, DisplaySize128x32, DisplaySize128x64, DisplaySize64x32, + DisplaySize64x48, DisplaySize72x40, DisplaySize96x16, }, }; diff --git a/src/size.rs b/src/size.rs index 62bca180..c94da3d8 100644 --- a/src/size.rs +++ b/src/size.rs @@ -88,6 +88,25 @@ impl DisplaySize for DisplaySize128x64 { } } +/// Size information for the common 102x64 variants +#[derive(Debug, Copy, Clone)] +pub struct DisplaySize102x64; +#[maybe_async_cfg::maybe(sync(keep_self), async(feature = "async", keep_self))] +impl DisplaySize for DisplaySize102x64 { + const WIDTH: u8 = 102; + const HEIGHT: u8 = 64; + const OFFSETX: u8 = 13; + type Buffer = [u8; ::WIDTH as usize * + ::HEIGHT as usize / 8]; + + async fn configure( + &self, + iface: &mut impl WriteOnlyDataCommand, + ) -> Result<(), DisplayError> { + Command::ComPinConfig(true, false).send(iface).await + } +} + /// Size information for the common 128x32 variants #[derive(Debug, Copy, Clone)] pub struct DisplaySize128x32;