Skip to content

Add Seven Segment I/O peripheral with tests and example#455

Open
KuznetsovNick wants to merge 5 commits into
mortbopet:masterfrom
moevm:pr/io-7indicator
Open

Add Seven Segment I/O peripheral with tests and example#455
KuznetsovNick wants to merge 5 commits into
mortbopet:masterfrom
moevm:pr/io-7indicator

Conversation

@KuznetsovNick
Copy link
Copy Markdown

Adds a memory-mapped seven-segment display peripheral, available from
the I/O panel alongside the existing LED Matrix / Switches / D-Pad.

Behavior

The widget renders N digits, where N is configurable via the # Digits
parameter (1..16, default 4). Color theme is selectable via the Color
parameter. Each digit is driven by a single 8-bit segment mask written
from the program.

Memory map

One 32-bit register per digit, byte offset = digit_index * 4.
Only the low byte is used; bits map to segments as follows:

Bit 7 6 5 4 3 2 1 0
Seg DP G F E D C B A

Aligned 32-bit reads return the last value written. Misaligned or
out-of-range accesses return 0 / are ignored.

Example

examples/C/sevenSegmentRunner.c — slides "67" across the display.

Tests

test/tst_io_7indicator.cpp — covers the write/read round trip,
low-byte truncation, alignment handling, out-of-range access, reset,
and resizing via the # Digits parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants