feat(firmware): host-programmable per-pixel LED matrix framebuffer - #623
Open
hongquanli wants to merge 1 commit into
Open
feat(firmware): host-programmable per-pixel LED matrix framebuffer#623hongquanli wants to merge 1 commit into
hongquanli wants to merge 1 commit into
Conversation
Add a programmable LED-matrix source so the host can drive each of the 128 LEDs individually. This moves all pattern logic (rings, DPC, custom apertures) to the host — new patterns no longer require a firmware reflash. - ILLUMINATION_SOURCE_LED_ARRAY_PROGRAMMABLE (10): displays a host-painted framebuffer (led_matrix_user), kept separate from the live matrix so it survives the clear_matrix() strobe-off between acquisition frames. - SET_ILLUMINATION_LED_MATRIX_PIXEL (45): write one LED into the framebuffer (no show). CLEAR_ILLUMINATION_LED_MATRIX (46): zero the framebuffer. - Pixel scaling and R/G channel order match the built-in full/half patterns, so a host-painted color renders identically to the same built-in color. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Make the LED matrix host-programmable per-pixel, so patterns (rings, DPC, custom apertures) are computed on the host instead of hard-coded in firmware. New patterns no longer require a firmware reflash.
Changes
ILLUMINATION_SOURCE_LED_ARRAY_PROGRAMMABLE(10) — displays a host-painted 128-LED framebuffer (led_matrix_user). It's kept separate from the livematrixso it survives theclear_matrix()that strobe-off does between acquisition frames; turning the source on copies the framebuffer into the live matrix and shows it.SET_ILLUMINATION_LED_MATRIX_PIXEL(45) — write one LED into the framebuffer (no show).CLEAR_ILLUMINATION_LED_MATRIX(46) — zero the framebuffer./255*MAX_INTENSITYscaling and R/G channel order match the built-in full/half patterns, so a host-painted color renders identically to the same built-in color.Testing
pio run -e teensy41builds clean; flashed to a Teensy 4.1 and exercised via the host (see companion host PR): painting a 128-LED annulus frame and displaying it in live view and acquisition.Companion PR
Host support (protocol + Phase Contrast configurator) is in a separate host-only PR that depends on this firmware being flashed.