Status as of 2026-11-09. All code is in linux/. The LPC1114 firmware in the
repository root is unchanged.
Update 2026-11-10: the panel now runs on real hardware through i2c-dev
(radio-i2c --pattern geometry|gray over a USB I²C bridge at 400 kHz): 240×160,
2 bpp and pixel polarity confirmed. The control lines were remapped to the
actual board (see linux/README.md), and the review in
linux/s1d13700-recommendations.md was applied to the core and the DRM
driver. The DRM driver, keys and device tree overlay are still untested on
hardware.
The LPC1114 is replaced by software on the Linux board, with the S1D13700 LCD and the keys attached through two TCA9539 I²C expanders.
Works today, without hardware: the full UI runs in a desktop window against
the real MPD on radio.lo, with on-screen buttons and keyboard shortcuts. Every
frame takes the real path down to individual TCA9539 bytes, and a simulator of
the expander and LCD controller decodes those bytes to produce the picture.
Written and compiled, but never run: the DRM kernel driver, the DRM frontend, the i2c-dev frontend against a real bus, and the device tree overlay. No part of this has touched real hardware, so everything about the hardware itself is still unconfirmed (section 7).
| Topic | Original plan | Now | Reason |
|---|---|---|---|
| Keys | 4×4 matrix, gpio-matrix-keypad |
13 keys sensed directly, gpio-keys |
13 keys + backlight = 14 of U2's 16 pins; no scanning |
| UI toolkit | LVGL | Cairo + Pango on GLib | LVGL was not installed; Pango handles Polish text directly |
| Development | USB adapter first | Window + simulator first | Most of the logic needs no hardware |
| MPD | Local | Host is an option; default radio.lo in the window, localhost on the panel frontends |
Remote development |
| Kernel | DRM driver only | DRM driver and an i2c-dev frontend | The i2c-dev path needs no kernel changes, so it works on 4.19 |
The stock gpio-pca953x driver is used for U2 only. U1 needs one continuous
I²C write alternating both ports, which the GPIO API cannot express; going
through gpiod would cost roughly 2.5-3× more bus time per LCD byte. An I²C
address binds to one driver, which is another reason for a separate expander.
MPD (libmpdclient, idle events) ─┐
/dev/kmsg (optional) ────────────┤
keys (evdev or window buttons) ──┤
▼
app_core.c + ui_render.c (Cairo/Pango)
│ XRGB8888 frame + changed rectangle
┌───────────────────────┼─────────────────────────┐
▼ ▼ ▼
main_gtk.c main_i2c.c main_drm.c
│ │ dumb buffer + DIRTYFB
│ │ ▼
│ │ s1d13700_drm.c
▼ ▼ ▼
┌───────────────── s1d13700_core.c ──────────────────────┐
│ XRGB→2 bpp · byte diff against shadow · write planner │
│ · TCA9539 stream encoder │
└────────────────────────────────────────────────────────┘
│ │ │
s1d13700_sim.c /dev/i2c-N (I2C_RDWR) i2c_master_send()
The core has no OS dependency, so the code tested on the desktop is the code that drives the panel.
linux/driver/s1d13700_core.*)0x02, then
alternates P0 (data) and P1 (control). Each LCD cycle is
data, WR=0, data, WR=1. A0 changes get their own P0/P1 pair with WR# high,
because A0 needs setup time before the WR# edge and shares a port with it. A
cycle is never split across messages, so WR# is not left low when the bus is
released.FX=7 and HDOT=0 (required above 1 bpp), CM=1 (required
in graphics mode; the AVR code had 0), grayscale value 1 (the LPC's 3 is
reserved). VRAM is cleared before the display is turned on.CSRDIR down),
whichever is cheaper. Unchanged gaps up to 6 bytes (the cost of a seek) are
rewritten rather than skipped.linux/sim/)Models the TCA9539 register pairs and the S1D13700 indirect interface, seeing only the I²C bytes. It counts faults: A0 changing with a WR# edge, parameters with no command or too many of them, unknown commands, bad registers, messages ending between P0 and P1, inconsistent SYSTEM SET, and writes during reset. The window frontend exits with an error code if any occurred.
linux/app/)| File | Role |
|---|---|
app_core.c |
Render scheduling, changed-area detection, keys, backlight timeout, log batching |
ui_render.c |
Screen layout: title, state icon, track, time, progress, options, volume, link warning, log |
mpd_client.c |
Event-driven MPD connection; reconnects every 3 s |
log_kmsg.c |
Follows the kernel log |
main_gtk.c |
Window with simulated panel, buttons, shortcuts and a live traffic readout |
main_i2c.c |
Real panel through i2c-dev, plus --pattern geometry / gray for bring-up |
main_drm.c |
Real panel through the DRM driver |
platform_linux.c |
evdev keys, sysfs backlight, signal handling |
Behaviour kept from the firmware: 300 ms key lockout, 30 s backlight, the same command for each key, no title while stopped. New: event-driven updates instead of 2 s polling, proper Polish characters, a progress bar, volume display. Log redraws are batched to at most one per second.
Key mapping in the window: Z X C V B prev/play/pause/stop/next, arrows
(Up/Down = volume), Enter OK, Esc refresh, M menu, L list, Space pause.
OK, Menu, List, Left and Right wake the backlight only, as in the firmware.
linux/driver/s1d13700_drm.c)Atomic KMS driver modelled on the in-tree st7571-i2c, built against 6.18. Plane
updates convert damage into a pending frame; a worker sends it, merging anything
that arrives meanwhile. Messages are capped at 1025 bytes (about 23 ms) so other
devices on the bus get a turn, and the adapter's max_write_len is honoured.
Offers XRGB8888 and fbdev emulation, with counters in debugfs. Size, depth and
TC/R are module parameters.
linux/dts/radio-panel.dts)Binds U1 to the driver, U2 to gpio-pca953x, and defines radio-keys and
radio-backlight. Numeric constants are used so it works with
armbian-add-overlay. Wiring tables are in linux/README.md.
| Update (240×160, 2 bpp, 400 kHz) | I²C bytes | Bus time | Source |
|---|---|---|---|
| One 8×13 digit | 157 | 3.6 ms | test suite |
| Full frame | 38 462 (38 messages) | 866 ms | test suite |
| Stopped screen from blank | 2 779 | 63 ms | window, real MPD |
| Typical small update | 113-177 | 2.6-4.0 ms | window, fake MPD |
These are calculated from the bytes sent, assuming an ideal 400 kHz bus. Real timing will be slower.
| Check | Result |
|---|---|
| Panel tests: init values, invalid configs, no-change = no traffic, direction choice, gap merging, 2000 random update rounds at 1/2/4 bpp and message sizes 7/61/1025, error recovery, pixel conversion | Pass, also under ASan and UBSan |
| The simulator's fault detector fires on bad streams | Pass |
All frontends, the overlay and the module compile; module with W=1 |
No warnings shown |
| Window buttons against a fake MPD: Next, Up, Down, Pause, Prev, Stop, Play, Esc, Menu | The seven MPD commands sent correctly; Menu sends none |
Real MPD on radio.lo (0.21.4), read-only |
Connects and displays correctly; player state not changed |
| MPD pushing a change | Triggers a refresh (fake server) |
| Server lost, then back | Warning shown, reconnects automatically (fake server) |
radio-i2c on PIIX4, AMDGPU I²C and AUX buses |
All refused, no traffic |
The kernel module was built but never loaded. The window's keyboard shortcuts were not exercised automatically (no input injection tool here), and neither was real MPD with key presses, to avoid changing playback.
These can only be settled with hardware.
radio-keys device name. Assumed from the node name; --input overrides it./dev/kmsg on the target.| Stay on 4.19 | Upgrade to current | |
|---|---|---|
| Panel | radio-i2c |
radio-drm + driver, or radio-i2c |
| Kernel changes | Overlay only | Overlay + module |
| Standard graphics tools | No | Yes (DRM, fbdev emulation) |
The driver cannot build on 4.19: it depends on damage tracking, shmem and client helpers from much later kernels. There is no 4.19 tree here to measure the gap.
Recommendation: bring up on 4.19 with radio-i2c, which gets a working panel
with no kernel risk. Upgrade only if standard graphics tools turn out to be
wanted, since the application does not need DRM.
Allwinner I²C: the i2c-mv64xxx driver has no FIFO handling, so it takes
about one interrupt per byte, up to 44 000 per second during a long update. Short
updates make this brief, but a full frame lasts most of a second. Measure the CPU
cost on the board.
Phase 0: bring-up (needs an adapter or the SoC)
--pattern geometry: find the real size, fix defaults and the UI layout--pattern gray: confirm polarity and levels; tune --tcrPhase 1: keys and backlight
compatible, I²C bus and INT pin in the overlayevtest: all 13 keys, no bus traffic while idlePhase 2: application on the board
WatchdogSec (the firmware had a watchdog; the app has no sd_notify yet)Phase 3: DRM (only if upgrading)
modetest and radio-drmPhase 4: cutover
utils/Possible later improvements
SLEEP power save is not used; blanking is display-off only.--kmsg is given, and then shows the desktop's log rather than the radio's.gpio-matrix-keypad remains an option with no code changes to the app.radio.lo reports volume: n/a, and the old scripts used amixer set DAC directly. If MPD has no working mixer, the Up/Down keys will only log an error. The fix is either an MPD mixer configuration or an ALSA path on the board.compatible, bus and INT pin are placeholders.The development PC is an AMD BC-250. Its I2C_HEADER1 and possibly its PIIX4
SMBus ports reach the voltage regulators (ISL69247, ISL95712). Do not attach the
expanders there, and do not run i2cdetect scans on buses 6-10.
radio-i2c refuses those buses by name. Use a dedicated USB adapter such as an
MCP2221A; this needs CONFIG_HID_MCP2221 and CONFIG_GPIOLIB enabled.
drivers/gpu/drm/sitronix/st7571-i2c.c~/avr-svn/zdalny_termometr_odb/common/