examples: add 2.13in e-Paper V1 demo for RP2040-PiZero

Exercise all four SetRotation modes in the demo. Fix epd2in13.Size(),
which reported the padded logical buffer width instead of the true
panel width at rotation 90 and 270. This clipped the last few rows on
those rotations because the driver bounds check used the true width
while Size() reported the padded width.

Scale the dither ramp and solid block to the panel height instead of
fixed pixel offsets, so they fit inside the shorter 122 pixel dimension
at rotation 90 and 270.
This commit is contained in:
Dave Cheney
2026-09-10 11:22:59 +10:00
committed by Daniel Esteban
parent 4f6f6bc66f
commit 3b4cdece03
2 changed files with 180 additions and 2 deletions
+2 -2
View File
@@ -318,9 +318,9 @@ func (d *Device) ClearBuffer() {
// Size returns the current size of the display.
func (d *Device) Size() (w, h int16) {
if d.rotation == drivers.Rotation90 || d.rotation == drivers.Rotation270 {
return d.height, d.logicalWidth
return d.height, d.width
}
return d.logicalWidth, d.height
return d.width, d.height
}
// Rotation returns the current rotation of the device.