From 16b75bbad0d421dc3a30477b86d10985c9ee23b9 Mon Sep 17 00:00:00 2001 From: Frank Loesche Date: Sun, 5 Jul 2026 19:49:22 -0400 Subject: [PATCH] =?UTF-8?q?docs(g6=5F03):=20trial-params=20(0x08)=20re-lay?= =?UTF-8?q?out=20=E2=80=94=20gain=20int16=20+=20duration=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the 0x08 payload table for the canonical re-layout (init_pos/gain swap, gain widened to int16, new duration field) and delete the "Known, intentional divergences" row for 0x08; the gain-width/runtime gap it tracked as open is now closed. --- docs/development/g6_03-controller.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/development/g6_03-controller.md b/docs/development/g6_03-controller.md index 952b663..9ac8fe8 100644 --- a/docs/development/g6_03-controller.md +++ b/docs/development/g6_03-controller.md @@ -270,7 +270,6 @@ G6 collapses G4's two wires (host→Host.exe and Host.exe→controller) into one | Opcode | G4 | G6 | Note | |---|---|---|---| | `0x01` | DISPLAY_RESET (reset FPGA display) | SYSTEM_RESET (reboot MCU) | Deliberate repurpose; a G4 client's display-reset triggers a full reboot + link drop. | -| `0x08` | trial-params: `gain` int16 + trailing `runtime` | trial-params: `gain` int8, no runtime, `rate` int16 | Same intent, different payload layout; G4 12-byte frame misparses. Reconciliation open. | | `0x32` | stream-frame with `aox/aoy` header bytes (also dual-used as setAO) | stream-frame, 3-byte header, no `aox/aoy` | Different header; G4 `setAO`-via-`0x32` overload absent (G6 uses `0xA0`). | ### Per-command wire formats @@ -336,7 +335,7 @@ Recognized only to produce an explicit rejection. Grayscale mode is inferred fro Selects the display mode (2/3/4), opens the named SD pattern, and arms the refresh timer. -**Command:** `[len, 0x08, mode, pat_id_lo, pat_id_hi, rate_lo, rate_hi, gain, init_lo, init_hi, …]` +**Command:** `[len, 0x08, mode, pat_id_lo, pat_id_hi, rate_lo, rate_hi, init_lo, init_hi, gain_lo, gain_hi, dur_lo, dur_hi]` Payload bytes after the command byte: @@ -345,11 +344,11 @@ Payload bytes after the command byte: | 0 | `mode` | uint8 | 2 = Open Loop, 3 = Show Frame, 4 = Closed Loop | | 1–2 | `pattern_id` | uint16 LE | 1-based SD pattern index | | 3–4 | `frame_rate` | int16 LE | Hz — frame-advance rate for Mode 2. Negative values play in reverse. Sign is ignored in Modes 3 and 4. | -| 5 | `gain` | int8 | Mode 4 velocity scale: actual gain = `gain / 10` fps/V (e.g. `−20` → −2.0 fps/V) | -| 6–7 | `init_pos` | uint16 LE | Initial frame index (0-based) | -| 8+ | reserved | — | Legacy G4 fields; accepted and ignored | +| 5–6 | `init_pos` | uint16 LE | Initial frame index (0-based) | +| 7–8 | `gain` | int16 LE | Mode 4 velocity scale: actual gain = `gain / 10` fps/V (e.g. `−20` → −2.0 fps/V) | +| 9–10 | `duration` | uint16 LE | Controller-run trial length, in 10 ms ticks. `0` = no auto-stop; the controller reverts to ALL_OFF on its own when the duration elapses. | -Minimum payload: 8 bytes (offsets 0–7). Full G4-legacy form sends 12 param bytes (`length = 0x0D`). +Frame length is always `0x0C` (12 = cmd + 11 param bytes); all 11 param bytes are required. **Response (success):** `[0x02, 0x00, 0x08]`