Skip to content

feat: add 102x64 resolution variant #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};

Expand Down
19 changes: 19 additions & 0 deletions src/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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; <Self as DisplaySize>::WIDTH as usize *
<Self as DisplaySize>::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;
Expand Down