Explorar el Código

6400-manual-gui-contract

Prod2U hace 3 meses
padre
commit
5b658ca0e3
Se han modificado 2 ficheros con 39 adiciones y 1 borrados
  1. 38 0
      generated/6400/manual-uart-contract.json
  2. 1 1
      tools/6400_hex_gui.py

+ 38 - 0
generated/6400/manual-uart-contract.json

@@ -0,0 +1,38 @@
+{
+  "schema": "prod2u-6400-manual-uart-v1",
+  "contract_sha256": "fedcf9f1d62bb04b55db586bdf1f32a7eda2e6d4673ce96252dde928ce25f463",
+  "product": "6400-front-rear",
+  "board": "FCB V1.1",
+  "wire": {
+    "host_uart": {"baud": 921600, "format": "8N1"},
+    "commands": {
+      "SET_ALL": {"type": 1, "payload_length": 32},
+      "GET_SNAPSHOT": {"type": 2, "payload_length": 0},
+      "RESERVED_UNSUPPORTED": {"type": 3, "payload_length": 0},
+      "REMOVED_UNSUPPORTED": {"type": 4, "payload_length": 0}
+    },
+    "responses": {
+      "ACK_NACK": {"type": 6, "payload_length": 4, "status": {"OK": 0, "UNSUPPORTED": 1, "BAD_LENGTH": 2, "BAD_VALUE": 3, "SAFETY_LOCKED": 4}},
+      "SNAPSHOT_DATA": {"type": 130}
+    }
+  },
+  "fan_control": {"pwm": {"ptc_hz": 500, "fan_hz": 500}},
+  "snapshot": {
+    "payload_length": 201,
+    "fields": [
+      {"name": "mode", "offset": 0, "size": 1},
+      {"name": "fault_flags", "offset": 1, "size": 2},
+      {"name": "watchdog_active", "offset": 3, "size": 1},
+      {"name": "watchdog_remaining", "offset": 4, "size": 1},
+      {"name": "manual_mode", "offset": 7, "size": 1},
+      {"name": "bmc_valid", "offset": 8, "size": 1},
+      {"name": "bmc_stale", "offset": 9, "size": 1},
+      {"name": "ct_valid", "offset": 10, "size": 1},
+      {"name": "ct_stale", "offset": 11, "size": 1},
+      {"name": "hard_protect", "offset": 12, "size": 1},
+      {"name": "bmc_epoch", "offset": 13, "size": 2},
+      {"name": "ct_epoch", "offset": 15, "size": 2},
+      {"name": "control_epoch", "offset": 17, "size": 2}
+    ]
+  }
+}

+ 1 - 1
tools/6400_hex_gui.py

@@ -16,7 +16,7 @@ def asset(name: str) -> Path:
     return direct if direct.exists() else base / "generated" / "6400" / name
     return direct if direct.exists() else base / "generated" / "6400" / name
 
 
 
 
-CONTRACT = json.loads(asset("host-contract.json").read_text(encoding="utf-8"))
+CONTRACT = json.loads(asset("manual-uart-contract.json").read_text(encoding="utf-8"))
 GOLDEN = json.loads(asset("golden-vectors.json").read_text(encoding="utf-8"))
 GOLDEN = json.loads(asset("golden-vectors.json").read_text(encoding="utf-8"))
 METADATA = json.loads(asset("gui-build-metadata.json").read_text(encoding="utf-8")) if asset("gui-build-metadata.json").exists() else {
 METADATA = json.loads(asset("gui-build-metadata.json").read_text(encoding="utf-8")) if asset("gui-build-metadata.json").exists() else {
     "profile": "source", "commit": "WORKTREE", "bitstream_sha256": "NOT_BUILT"
     "profile": "source", "commit": "WORKTREE", "bitstream_sha256": "NOT_BUILT"