|
@@ -1,13 +1,18 @@
|
|
|
# Radio front panel: Linux port report
|
|
# Radio front panel: Linux port report
|
|
|
|
|
|
|
|
-Status as of 2026-11-09. All code is in `linux/`. The LPC1114 firmware in the
|
|
|
|
|
-repository root is unchanged.
|
|
|
|
|
|
|
+This is the record of the port from the LPC1114 firmware, kept as it was
|
|
|
|
|
+written; only the paths were changed to the split repositories (this one,
|
|
|
|
|
+radio-ui, and s1d13700-tca for the panel core, simulator, driver and device
|
|
|
|
|
+tree). Current usage is in the READMEs.
|
|
|
|
|
+
|
|
|
|
|
+Status as of 2026-11-09. At the time all code was in `linux/` of
|
|
|
|
|
+the LPC1114 firmware repository.
|
|
|
|
|
|
|
|
**Update 2026-11-10:** the panel now runs on real hardware through i2c-dev
|
|
**Update 2026-11-10:** the panel now runs on real hardware through i2c-dev
|
|
|
(`radio-ui i2c --pattern geometry|gray` over a USB I²C bridge at 400 kHz): 240×160,
|
|
(`radio-ui 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
|
|
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
|
|
|
|
|
|
|
+actual board (see `README.md`), and the review in
|
|
|
|
|
+`s1d13700-tca/docs/s1d13700-recommendations.md` was applied to the core and the DRM
|
|
|
driver. The DRM driver, keys and device tree overlay are still untested on
|
|
driver. The DRM driver, keys and device tree overlay are still untested on
|
|
|
hardware.
|
|
hardware.
|
|
|
|
|
|
|
@@ -29,8 +34,8 @@ which led to three fixes:
|
|
|
device for the expander's P1.0 pin, driven from the flush worker, so the
|
|
device for the expander's P1.0 pin, driven from the flush worker, so the
|
|
|
frontend's default sysfs path works. Still compiled only.
|
|
frontend's default sysfs path works. Still compiled only.
|
|
|
|
|
|
|
|
-**Update 2026-11-11:** the application is now Python (`linux/radio/`, run as
|
|
|
|
|
-`linux/radio-ui sim|i2c|drm`), written for Python 3.7.3 (Debian buster, on the
|
|
|
|
|
|
|
+**Update 2026-11-11:** the application is now Python (`radio/`, run as
|
|
|
|
|
+`radio-ui sim|i2c|drm`), written for Python 3.7.3 (Debian buster, on the
|
|
|
target) through 3.14. The panel core stays in C, since the kernel driver shares
|
|
target) through 3.14. The panel core stays in C, since the kernel driver shares
|
|
|
it, and is loaded through ctypes from `build/libradiopanel.so` (`make lib`).
|
|
it, and is loaded through ctypes from `build/libradiopanel.so` (`make lib`).
|
|
|
The `sim` window's LCD area matched the C window pixel for pixel, apart from one
|
|
The `sim` window's LCD area matched the C window pixel for pixel, apart from one
|
|
@@ -119,7 +124,7 @@ that drives the panel.
|
|
|
|
|
|
|
|
## 4. Components
|
|
## 4. Components
|
|
|
|
|
|
|
|
-### Panel core (`linux/driver/s1d13700_core.*`)
|
|
|
|
|
|
|
+### Panel core (`s1d13700-tca/driver/s1d13700_core.*`)
|
|
|
|
|
|
|
|
- **Stream encoder.** One write message starts with command byte `0x02`, then
|
|
- **Stream encoder.** One write message starts with command byte `0x02`, then
|
|
|
alternates P0 (data) and P1 (control). Each LCD cycle is
|
|
alternates P0 (data) and P1 (control). Each LCD cycle is
|
|
@@ -139,7 +144,7 @@ that drives the panel.
|
|
|
rewritten rather than skipped.
|
|
rewritten rather than skipped.
|
|
|
- **Error handling.** A transport error makes the next update rewrite the frame.
|
|
- **Error handling.** A transport error makes the next update rewrite the frame.
|
|
|
|
|
|
|
|
-### Simulator (`linux/sim/`)
|
|
|
|
|
|
|
+### Simulator (`s1d13700-tca/sim/`)
|
|
|
|
|
|
|
|
Models the TCA9539 register pairs and the S1D13700 indirect interface, seeing only
|
|
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
|
|
the I²C bytes. It counts faults: A0 changing with a WR# edge, parameters with no
|
|
@@ -147,7 +152,7 @@ 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
|
|
between P0 and P1, inconsistent SYSTEM SET, and writes during reset. The window
|
|
|
frontend exits with an error code if any occurred.
|
|
frontend exits with an error code if any occurred.
|
|
|
|
|
|
|
|
-### Application (`linux/radio/`)
|
|
|
|
|
|
|
+### Application (`radio/`)
|
|
|
|
|
|
|
|
Python 3.7.3 to 3.14, with PyGObject (GLib, Pango, PangoCairo), pycairo and
|
|
Python 3.7.3 to 3.14, with PyGObject (GLib, Pango, PangoCairo), pycairo and
|
|
|
python3-gi-cairo; GTK 3 only for the window and the test mode, libdrm only for
|
|
python3-gi-cairo; GTK 3 only for the window and the test mode, libdrm only for
|
|
@@ -177,7 +182,7 @@ Key mapping in the window and the test mode's key window: `Z X C V B` prev/play/
|
|
|
multimedia keyboard.
|
|
multimedia keyboard.
|
|
|
OK, Menu, List, Left and Right wake the backlight only, as in the firmware.
|
|
OK, Menu, List, Left and Right wake the backlight only, as in the firmware.
|
|
|
|
|
|
|
|
-### DRM driver (`linux/driver/s1d13700_drm.c`)
|
|
|
|
|
|
|
+### DRM driver (`s1d13700-tca/driver/s1d13700_drm.c`)
|
|
|
|
|
|
|
|
Atomic KMS driver modelled on the in-tree `st7571-i2c`, built against 6.18. Plane
|
|
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
|
|
updates convert damage into a pending frame; a worker sends it, merging anything
|
|
@@ -187,11 +192,11 @@ Offers XRGB8888 and fbdev emulation, with counters in debugfs, and a
|
|
|
`radio-backlight` backlight device for P1.0. Size, depth and
|
|
`radio-backlight` backlight device for P1.0. Size, depth and
|
|
|
TC/R are module parameters.
|
|
TC/R are module parameters.
|
|
|
|
|
|
|
|
-### Device tree (`linux/dts/radio-panel.dts`)
|
|
|
|
|
|
|
+### Device tree (`s1d13700-tca/dts/radio-panel.dts`)
|
|
|
|
|
|
|
|
Binds U1 to the driver, U2 (0x76) to `gpio-pca953x`, and defines
|
|
Binds U1 to the driver, U2 (0x76) to `gpio-pca953x`, and defines
|
|
|
`radio-keys`; the backlight comes from the driver. Numeric constants are used so it works with
|
|
`radio-keys`; the backlight comes from the driver. Numeric constants are used so it works with
|
|
|
-`armbian-add-overlay`. Wiring tables are in `linux/README.md`.
|
|
|
|
|
|
|
+`armbian-add-overlay`. Wiring tables are in `README.md`.
|
|
|
|
|
|
|
|
## 5. Bus cost
|
|
## 5. Bus cost
|
|
|
|
|
|
|
@@ -331,7 +336,7 @@ cost on the board.
|
|
|
## 11. Open questions
|
|
## 11. Open questions
|
|
|
|
|
|
|
|
1. ~~**Is the keypad a physical matrix?**~~ Settled: rewired for direct sensing, active high with pull-downs, U2 at 0x76.
|
|
1. ~~**Is the keypad a physical matrix?**~~ Settled: rewired for direct sensing, active high with pull-downs, U2 at 0x76.
|
|
|
-2. **Volume.** `radio.lo` reports `volume: n/a`, and the old scripts used `amixer set DAC` directly. Without a working MPD mixer the Up/Down keys do nothing. The default hardware mixer looks for `PCM`, which the H3 codec lacks; `linux/README.md` gives the `mixer_control "DAC"` setting for `/etc/mpd.conf`; not yet confirmed on the board.
|
|
|
|
|
|
|
+2. **Volume.** `radio.lo` reports `volume: n/a`, and the old scripts used `amixer set DAC` directly. Without a working MPD mixer the Up/Down keys do nothing. The default hardware mixer looks for `PCM`, which the H3 codec lacks; `README.md` gives the `mixer_control "DAC"` setting for `/etc/mpd.conf`; not yet confirmed on the board.
|
|
|
3. **Which SoC exactly?** The overlay's `compatible`, bus and INT pin are placeholders.
|
|
3. **Which SoC exactly?** The overlay's `compatible`, bus and INT pin are placeholders.
|
|
|
4. **Are other devices on the chosen I²C bus?** A dedicated bus is preferable.
|
|
4. **Are other devices on the chosen I²C bus?** A dedicated bus is preferable.
|
|
|
|
|
|