examples: add 2.13in e-Paper V1 demo for RP2040-PiZero - #1
Closed
davecheney wants to merge 1 commit into
Closed
Conversation
Owner
Author
|
Closing. This was opened against the fork by mistake. Reopened upstream as tinygo-org#890. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a hardware bring-up demo for the Waveshare 2.13in e-Paper HAT V1 driven by a Waveshare RP2040-PiZero.
Why
There was no example that pairs the
waveshare-epd/epd2in13driver with a board that has a Raspberry Pi 40 pin header. Working out the pin mapping is the hard part, because Waveshare exchanges GPIO10 and GPIO11 on the RP2040-PiZero header so that RP2040 SPI1 SCK and TX align with the Raspberry Pi SCLK and MOSI positions. That swap is only visible in the schematic, and without it you would reasonably conclude that hardware SPI cannot reach the HAT and reach for a bit-bang implementation. The pin table in the file records the mapping and cites the schematic, so the next person does not have to derive it.What it does
The demo clears the panel, then draws a test pattern chosen so that a partial result localises the fault rather than just reporting failure:
It logs progress over USB serial and then enters deep sleep, since an e-paper panel holds its image without power.
Scope
The header comment is explicit about what this is verified against, because the driver is not interchangeable across panel revisions.
epd2in13sends the IL3820 init sequence and a 30 byte LUT. V2 and later use the SSD1680, which needs a different init sequence and a 153 byte LUT, so this demo will not drive them. The comment lists the panel revisions and boards as known working, untested, and not supported, and explains how to identify a panel from the ribbon cable date code.Verification
Flashed to real hardware with
tinygo flash -target=pico -monitor. The panel rendered the complete pattern, which confirms SPI1 clock and data, the CS, DC, RST and BUSY pins, the IL3820 init sequence, and the RAM write. Serial output was:gofmtis clean andtinygo build -target=picosucceeds.One caveat worth flagging for reviewers: only the RP2040-PiZero with a V1 panel is marked as tested. The suggestion in the comment to try
epd2in9v2for SSD1680 panels is a starting point rather than a verified path, since that package targets a 2.9in panel and would need Width and Height overrides. I did not have the hardware to confirm it.