fix(epd2in7b): correct V1 white and black LUT mapping#262
Open
tkj666 wants to merge 1 commit into
Open
Conversation
The V1 tri-color panel uses the LUT_BB data for register 0x23 and LUT_WB for register 0x24, matching Waveshare's reference driver. Loading them by their transition-style names swaps the final white and black drive waveforms and leaves the display inverted after refresh.
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.
Summary
LUT_BBinto register0x23andLUT_WBinto register0x24Epd2in7b::newinitialization sequence at the SPI/DC boundaryProblem
The existing V1 driver assigns the two arrays according to their transition-style names. In B/W/Red mode, however, Waveshare's reference implementation intentionally loads them in the opposite-looking order. The current assignment swaps the final white and black drive waveforms, so a correct image can appear during the refresh phases and then settle with inverted black/white colors.
Reference: https://raw.githubusercontent.com/waveshareteam/e-Paper/master/RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in7b.c
The framebuffer-byte complement remains unchanged because it already matches the reference driver.
Verification
cargo test --lib— 55 passedcargo check --libRUSTDOCFLAGS=-Dwarnings cargo doc --no-depscargo clippy --lib --tests -- -D warnings -A clippy::new_ret_no_self -A clippy::doc_overindented_list_itemscargo fmt --all -- --check