Просмотр исходного кода

contract: migrate prod2u door-temp product contract

Codex Resource Selftest 4 месяцев назад
Родитель
Сommit
a894d84db1

+ 21 - 27
ACCEPTANCE_MATRIX.md

@@ -1,32 +1,26 @@
-# Acceptance Matrix
+# Phase 1 Acceptance Matrix
 
-| Area | Required evidence | Status at start | Final status |
+| Area | Contract evidence | Status before focused run | Phase 1 result |
 |---|---|---:|---:|
-| Configuration/schema | pytest validates polarity, defaults, 20 Hz calculation and deterministic generation | not_run | pass |
-| Generated RTL | generated macros contain slot 174, defaults, and polarity | not_run | pass |
-| PWM scheduler | Icarus covers defaults, polarity, target loading, slot/channel/phase invariants | not_run | pass |
-| UART byte timing | Icarus 8N1, 217 clocks/bit, LSB-first and stop-bit behavior | not_run | pass |
-| Frame/TX integration | real `frame_tx -> uart_tx_byte -> tx_o` decodes exactly 33 bytes with no extra A5 | not_run | pass |
-| Top-level simulation | Icarus/Verilator/cocotb where available; no hardware access | not_run | pass (cocotb receipt; wrapper cleanup issue recorded) |
-| Protocol regression | new frame types, CRC, exact temperature response; no legacy protocol changes | not_run | pass |
-| Package contract | `fw.bit`, manifest, package-info, receipts and hashes agree | not_run | pass (temporary package selftest) |
-| Formal | applicable properties pass; unavailable tool is blocked/not_run | not_run | fail |
-| TD | independent primary/confirmation build, resources, timing, CDC, IO and non-empty bitstream | not_run | pass |
-| Physical hardware | explicitly excluded from this run | not_applicable | not_applicable |
+| Project configuration | `project.json` has ordered 8 PTC and 4 FAN objects, mappings, limits, UART, I2C, motor and watchdog fields | not_run | pass |
+| Schema | Every configuration section is closed and count/list drift is rejected | not_run | pass |
+| Protocol model | CRC, legal duty range, legal motor values, frame sizes and golden vectors | not_run | pass |
+| Generator | Deterministic five artifacts, active interface metadata and generated ADC | not_run | pass |
+| Active ADC | Exactly 24 ordered assignments with no inactive board loads | not_run | pass |
+| RTL and simulation | Phase 2 ownership | not_run | not_run |
+| Formal | Phase 2 ownership | not_run | not_run |
+| TD and bitstream | Phase 2 ownership | not_run | not_run |
+| Physical hardware | Outside this task boundary | not_applicable | not_applicable |
 
-## Hard gates
+## Frozen gates
 
-- PWM target: `25,000,000 / (174 * 28 * 256) = 20.044386289 Hz`, error below 1%.
-- FAN: FPGA active-low, connector Pin7 active-high, default `0x1A`.
-- PTC: FPGA active-high, default `0x00`.
-- UART: `frame_tx.byte_ready = !uart_tx_busy`; `uart_tx_done` is not a ready signal.
-- Temperature response: exactly 33 bytes, starting `A5 5A 82 1B`, valid CRC, no 34th byte.
-- Bitstream: non-empty, only if TD actually succeeds.
+- Clock: 25 MHz; UART: 115200 8N1, 217 clocks per bit.
+- Frame header: `A5 5A`; CRC-16/CCITT-FALSE covers type, length and payload, with little-endian wire order.
+- Types: `0x01 SET_ALL`, `0x02 GET_TEMPERATURE`, `0x82 TEMPERATURE_DATA`.
+- SET_ALL: 14-byte payload, 0..100 duty values, motor values 0/1/2, heartbeat bytes `00 00`, no response.
+- Temperature: 27 values and one 33-byte response frame.
+- PWM: protocol width 8, internal width 7, max 100, 100 phases, 1042 clocks per slot, actual frequency 19.993602047 Hz.
+- Boot targets: PTC=0/FAN=10. Watchdog: 10 s, target PTC=0/FAN=20, 500 us tick, 12500 clocks, 20000 ticks.
+- Active interface count: 24 unique assignments in the generated order.
 
-## Evidence labels
-
-`pass` means the command ran and produced the required evidence. `blocked` means an applicable environment/tool prerequisite prevented execution. `not_run` means the layer was not attempted. Neither `blocked` nor `not_run` may be promoted to `pass`. The cocotb result is currently a receipt-level pass with a separate wrapper-process cleanup issue, not a physical-hardware claim.
-
-Formal failure evidence: `simple_frame_contract` returned `ERROR 16 0` because Yosys found undriven formal inputs that became X/Z bits; `simple_motor_temperature_contract` did not complete before the worker was stopped. This is retained as a failed validation layer, not downgraded to pass.
-
-TD evidence: both independent builds passed for the final production commit candidate, with LUT 984, FF 475, Packed Slice 500, BRAM 0, DSP 0, setup slack 28.767 ns, hold slack 0.038 ns, and a non-empty bitstream. The final package remains `UNVERIFIED` because formal is failed.
+Focused validation must remain limited to the Python contract tests. No claim about RTL, formal, TD, package, bitstream or physical hardware is made by this matrix.

+ 18 - 19
AGENTS.md

@@ -2,37 +2,36 @@
 
 This repository is the active `dev` branch for the Prod2U multi-project UART refactor.
 
-## [DYNAMIC-NATIVE-MA]
+## Authority
+
+- `projects/<project_id>/project.json` is the only machine configuration source.
+- `projects/prod2u-door-temp/requirements.zh-CN.md` records the project requirements.
+- `docs/prod2u-door-temp-protocol.zh-CN.md` records the host-facing frame contract.
+- Generated files and the active ADC are derived outputs; do not hand-edit them independently.
+- Phase 1 covers the door-temperature project contract only. Production RTL, TD/top, hardware, and RTL/TD behavior tests remain outside this worktree ownership; Python contract tests are in scope.
+
+## Coordination
 
-- Tasks marked `[DYNAMIC-NATIVE-MA]` must use the current client's native multi-agent/subagent tools.
 - Root builds a dependency graph before delegation and only runs independent, clearly bounded work in parallel.
 - Normal concurrency is 2-4 agents; 6 is the hard upper bound.
-- Prefer parallel read-heavy exploration, test review, and log triage.
-- Write-heavy work uses independent worktrees or mutually exclusive owned paths.
-- Two write agents must never modify the same file concurrently.
-- Test agents do not modify production RTL; reviewers are read-only.
+- Tasks marked `[DYNAMIC-NATIVE-MA]` use the current client's native coordination tools.
 - Root owns interface freezes, integration, conflict resolution, and final candidate selection.
+- Each temporary worktree or owned path has one coordinator-assigned owner.
+- Test agents do not modify production RTL. The coordinator does not modify tests owned by the test engineer.
 - The Harness must not start Codex, call model APIs, or create agent threads.
-- Background build/test processes are ordinary processes, not subagents.
 
 ## Phase boundaries
 
-- Phase 0 establishes native coordination, Git isolation, ownership validation, and minimal evidence only.
 - Phase 0 must not implement product functionality or modify RTL, project configuration, protocol, pins, TD, or product contracts.
-- Phase 1 must review every nested `AGENTS.md` before product work and replace historical rules that conflict with the accepted Phase 1 product contract.
-- Historical v1 product prohibitions are not a permanent blocker for a later accepted Phase 1 contract; Phase 0 remains strictly non-product.
+- Phase 0 established coordination, Git isolation, ownership validation, and minimal evidence.
+- Phase 1 freezes the 25 MHz / 115200 8N1 contract, project mappings, schema, generator, protocol reference model, generated artifacts, and active ADC.
+- Phase 2 owns production RTL, simulations, TD scripts, bitstreams, and broader verification.
+- Phase 1 must review every nested `AGENTS.md` and replace rules that conflict with the accepted product contract; this run audited them and kept non-conflicting rules unchanged.
+- Physical hardware access, programming, drivers, global PATH changes, and external model services are prohibited.
 
 ## Safety and evidence
 
-- Do not call ChatGPT Adviser or create Adviser artifacts.
-- Do not access COM/JTAG, program hardware, install drivers, or modify global PATH.
 - Keep source, offline simulation, formal, TD, package, and physical-hardware evidence separate.
 - Blocked, dry-run, fixture, and partial evidence is not a pass.
-- Preserve unrelated dirty work and ignored generated evidence.
-
-## Ownership and delivery
-
-- Each temporary worktree or owned path has one coordinator-assigned owner.
-- Only Root integrates commits into `dev` and modifies production tops.
+- Preserve unrelated dirty changes and ignored generated evidence.
 - Every run uses one 32-character lowercase hexadecimal `run_id`.
-- Phase 0 changed paths are restricted to the approved allowlist and every final worktree must be clean.

Разница между файлами не показана из-за своего большого размера
+ 0 - 2684
CPLD_多项目_UART协议_项目适配_Codex并行Harness_详细设计_v1.0.md


+ 13 - 15
README.zh-CN.md

@@ -1,27 +1,25 @@
-# Prod2U Door Temp CPLD
+# Prod2U 门控温度 CPLD
 
-本仓库只实现 `prod2u-door-temp` 新架构:25 MHz、115200 8N1、无流控,统一帧为 `A5 5A type length payload CRC16_LE`。
+本仓库当前冻结 `prod2u-door-temp` Phase 1 合同:25 MHz 主时钟、115200 8N1、无流控,统一帧为 `A5 5A type length payload CRC16_LE`。CRC-16/CCITT-FALSE 覆盖类型、长度和 payload,线路按低字节在前发送。
 
 正式类型只有:
 
-- `0x01 SET_ALL`:24 路 PTC、4 路 FAN、进风门方向、出风门方向;无回复。
-- `0x02 GET_TEMPERATURE`:无 payload;完成 27 项读取后只回复一个 `0x82` 温度帧。
+- `0x01 SET_ALL`:8 路 PTC、4 路 FAN、X/Y 两个马达命令,共 14 字节 payload;成功后无回复。
+- `0x02 GET_TEMPERATURE`:空 payload;完成 27 项 CT7428 读取后只回复一帧温度数据。
 - `0x82 TEMPERATURE_DATA`:27 字节 payload,总帧长 33 字节。
 
-两台马达严格串行,先进风门后出风门,每台固定 450 步;无限位、ACK、ERROR、BUSY、JOG、STOP、watchdog、replay 或旧协议兼容。
+PTC 和 FAN 的占空值为十进制 0..100。马达字段合法值为 `00`、`01`、`02`;两个 `00` 表示心跳保持。X/Y 均为 exhaust 角色,执行 450 步,步频 1000 step/s,半周期 500 us,方向建立时间约 1 ms,共用低有效使能。
 
-权威协议和项目事实见 `CPLD_多项目_UART协议_项目适配_Codex并行Harness_详细设计_v1.0.md`、`projects/prod2u-door-temp/project.json` 和 `docs/prod2u-door-temp-protocol.zh-CN.md`。
+项目配置中的 PTC 顺序为 `G16,F16,N1,M1,R16,P16,P9,T9`,FAN 顺序为 `B1,C4,B5,A14`。PWM 使用 8 位协议值、7 位内部值、100 相位和 1042 个时钟槽,实际频率为约 19.993602047 Hz。启动目标为 PTC=0、FAN=10;看门狗超时为 10 s,目标为 PTC=0、FAN=20,500 us tick 对应 12500 个时钟、20000 个 tick。
 
-## Offline verification
+本 Phase 1 不提供旧协议兼容,也不新增其他帧类型、确认帧、忙状态帧、队列或分页行为。项目事实以 `project.json` 为准,协议说明见 `docs/prod2u-door-temp-protocol.zh-CN.md`。
 
-```powershell
-python tools\prod2u_p4_harness.py hdl-sim --backend icarus --run --work-root <work-root>
-python tools\prod2u_p4_harness.py hdl-sim --backend verilator --run --work-root <work-root>
-python tools\prod2u_p4_harness.py formal --run --work-root <work-root>
-```
+## 离线验证边界
 
-目标只从 `config/prod2u_p4_verification_targets_v1.json` 读取。缺少工具或未完成的层必须标记 `blocked`/`not_run`,不得升级为通过。
+本任务只运行聚焦 Python 合同测试:
 
-## TD and hardware boundary
+```powershell
+python -m pytest -q -p no:cacheprovider tests/unit/test_protocol.py tests/unit/test_project_config.py tests/unit/test_project_generation.py tests/unit/test_phase1_contract.py
+```
 
-TD 入口是 `td/prod2u_p4_normal_v3.prj` 及同名脚本。构建只生成 bitstream 和 receipt,不打开 COM/JTAG、不烧录、不安装驱动、不修改全局 PATH,也不执行真实热闭环。
+RTL、形式验证、TD、封装和物理硬件不属于本 Phase 1 运行结果。缺少工具或未执行的层必须保持 `blocked` 或 `not_run`,不得升级为通过。

+ 22 - 14
docs/prod2u-door-temp-protocol.zh-CN.md

@@ -2,7 +2,7 @@
 
 ## 物理层
 
-UART 固定为 `115200 8N1`、无流控,主时钟 `25 MHz`,每 bit `217` 个时钟。当前引脚为 RX `N11`、TX `M10`。
+UART 固定为 `115200 8N1`、无流控,主时钟为 25 MHz,每 bit 为 217 个时钟。RX 为 `N11`,TX 为 `M10`;I2C SCL 为 `M8`,SDA 为 `N9`。
 
 ## 帧格式
 
@@ -10,21 +10,35 @@ UART 固定为 `115200 8N1`、无流控,主时钟 `25 MHz`,每 bit `217` 个
 A5 5A type payload_length payload crc16_low crc16_high
 ```
 
-CRC 为 CRC-16/CCITT-FALSE,初值 `0xFFFF`、多项式 `0x1021`,覆盖 `type`、长度和全部 payload,不覆盖帧头;线路顺序为低字节在前。
+CRC 为 CRC-16/CCITT-FALSE,初值 `0xFFFF`、多项式 `0x1021`,覆盖 type、length 和全部 payload,不覆盖帧头;线路顺序为低字节在前。
 
 正式类型只有:
 
 | 类型 | payload | 行为 |
 | --- | ---: | --- |
-| `01` SET_ALL | 30 字节 | 24 PTC、4 FAN、进风门方向、出风门方向;成功后无回复 |
+| `01` SET_ALL | 14 字节 | 8 PTC、4 FAN、X/Y 马达命令;成功后无回复 |
 | `02` GET_TEMPERATURE | 0 字节 | 完成 27 项读取后只回复一个 `82` 帧 |
-| `82` TEMPERATURE_DATA | 27 字节 | 温度响应 |
+| `82` TEMPERATURE_DATA | 27 字节 | 温度响应,总帧长 33 字节 |
 
-方向 `00` 表示向开方向,`01` 表示向关方向。每台门控马达固定执行 450 步,严格先进风门、后出风门;无任何限位逻辑。
+SET_ALL 的 payload 顺序为 8 个 PTC 值、4 个 FAN 值、X 命令、Y 命令。输出值合法范围是十进制 0..100。马达命令合法值是 0/1/2,其中两个 0 字节表示心跳保持。错误长度、CRC 错误、未知类型和忙时输入全部静默丢弃。
 
-## 温度
+## PTC/FAN 与 ADC
 
-I2C 使用 `M8/N9`,CT7428 地址按配置为 `0x49`、`0x48`、`0x4B`,每颗读取寄存器 `0..8`。单项 NACK、超时或其他错误写入 `FF` 并继续,27 项完成后发送固定 33 字节响应。
+PTC 有序球位为 `G16,F16,N1,M1,R16,P16,P9,T9`,分别来自四个 PTC 连接器的 Pin3、Pin1 选择。FAN 使用连接器 Pin7,顺序为 `CON25`、`CON8`、`CON24`、`CON26`,球位为 `B1,C4,B5,A14`。
+
+PTC 为 FPGA active-high,启动目标为 0。FAN 为 FPGA active-low,连接器 Pin7 为 active-high,启动目标为 10。活动 ADC 仅包含 24 个合同接口赋值:时钟、UART、I2C、8 个 PTC、4 个 FAN、马达使能、X/Y STEP/DIR 和两路原始限位输入。
+
+## PWM、马达和看门狗
+
+PWM 协议宽度为 8,内部宽度为 7,最大占空值为 100,相位数为 100,槽宽为 1042 个主时钟。12 个活动 PWM 通道下,周期为 1250400 个时钟,实际频率为 19.993602047 Hz,误差约 0.031989763%。
+
+X/Y 马达均为 exhaust 角色,共用低有效使能 `A10`。固定动作是 450 步、1000 step/s、500 us 半周期,方向建立时间约 1 ms。两路限位输入 `B9`、`A11` 为 active-high,但 `functional_use=false`。
+
+看门狗超时为 10 s,目标为 PTC=0、FAN=20。500 us tick 在 25 MHz 下为 12500 个时钟,20000 个 tick 为完整超时。
+
+## 温度读取
+
+CT7428 地址顺序为 `0x49`、`0x48`、`0x4B`,每颗读取寄存器 `0..8`,共 27 项。单项 NACK、超时或其他读取错误写入 `FF` 并继续,完成后发送一帧固定 33 字节响应。
 
 GET 请求黄金 HEX:
 
@@ -38,10 +52,4 @@ A5 5A 02 00 6D 7B
 A5 5A 82 1B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF A7 45
 ```
 
-非法帧、未知类型、错误长度、CRC 错误和忙时命令全部静默丢弃。没有 ACK、ERROR、BUSY、JOG、STOP、队列、replay、watchdog、分页或旧协议兼容。
-
-## PTC/FAN PWM board contract
-
-FAN PWM uses connector Pin7 on CON8/CON24/CON25/CON26 and FPGA balls C4/B5/B1/A14. Pin8 is FAN_INSTALL and is not PWM. The board inverts the FPGA-side FAN signal: FPGA high drives connector Pin7 low, so the FPGA implementation is active-low and connector Pin7 high is the logical fan run time. PTC is FPGA active-high.
-
-The default PTC target is `0x00`. The default FAN target is `0x1A`, which gives about `26/256 = 10.15625%` connector-high time. PTC and FAN share an 8-bit serial PWM scheduler. With a 25 MHz clock, 28 channels, and `PWM_SLOT_CLKS=174`, the actual frequency is about `20.044386289 Hz` with about `0.221931445%` error. Channel edges are not guaranteed to align. 20 Hz is a temporary debugging choice and does not guarantee a mechanical fan-speed result.
+本合同不提供旧协议兼容,不添加其他类型或响应帧。

+ 1 - 1
projects/AGENTS.md

@@ -1,5 +1,5 @@
 # Project Configuration Rules
 
 - Keep one `project.json` and one human requirements document per project.
-- Do not duplicate counts, pins, addresses, or protocol lengths in hand-written tools or tests.
+- Do not duplicate configurable counts, pins, addresses, or protocol lengths in hand-written tools or tests. A generator may mirror the frozen Phase 1 profile rows only as a fail-closed guard; project.json remains the sole machine source and all outputs still derive from it.
 - Validate configuration before generating RTL, TD, host contracts, and golden vectors.

+ 81 - 20
projects/prod2u-door-temp/project.json

@@ -15,38 +15,70 @@
     "stop_bits": 1,
     "flow_control": "none",
     "clks_per_bit": 217,
-    "inter_byte_timeout_ms": 10
+    "inter_byte_timeout_ms": 10,
+    "rx_ball": "N11",
+    "tx_ball": "M10"
   },
   "outputs": {
-    "ptc_count": 24,
+    "ptc_count": 8,
     "fan_count": 4,
+    "ptc_channels": [
+      {"index": 0, "name": "ptc1", "signal": "ptc_pwm_out[0]", "board_signal": "HEAT2", "ball": "G16", "connector": "CON18", "connector_pin": 3, "polarity": "active_high"},
+      {"index": 1, "name": "ptc2", "signal": "ptc_pwm_out[1]", "board_signal": "HEAT1", "ball": "F16", "connector": "CON18", "connector_pin": 1, "polarity": "active_high"},
+      {"index": 2, "name": "ptc3", "signal": "ptc_pwm_out[2]", "board_signal": "HEAT8", "ball": "N1", "connector": "CON27", "connector_pin": 3, "polarity": "active_high"},
+      {"index": 3, "name": "ptc4", "signal": "ptc_pwm_out[3]", "board_signal": "HEAT7", "ball": "M1", "connector": "CON27", "connector_pin": 1, "polarity": "active_high"},
+      {"index": 4, "name": "ptc5", "signal": "ptc_pwm_out[4]", "board_signal": "HEAT14", "ball": "R16", "connector": "CON28", "connector_pin": 3, "polarity": "active_high"},
+      {"index": 5, "name": "ptc6", "signal": "ptc_pwm_out[5]", "board_signal": "HEAT13", "ball": "P16", "connector": "CON28", "connector_pin": 1, "polarity": "active_high"},
+      {"index": 6, "name": "ptc7", "signal": "ptc_pwm_out[6]", "board_signal": "HEAT20", "ball": "P9", "connector": "CON29", "connector_pin": 3, "polarity": "active_high"},
+      {"index": 7, "name": "ptc8", "signal": "ptc_pwm_out[7]", "board_signal": "HEAT19", "ball": "T9", "connector": "CON29", "connector_pin": 1, "polarity": "active_high"}
+    ],
+    "fan_channels": [
+      {"index": 0, "name": "fan1", "signal": "fan_pwm_out[0]", "board_signal": "FAN_PWM3", "ball": "B1", "connector": "CON25", "connector_pin": 7, "polarity": "active_low"},
+      {"index": 1, "name": "fan2", "signal": "fan_pwm_out[1]", "board_signal": "FAN_PWM1", "ball": "C4", "connector": "CON8", "connector_pin": 7, "polarity": "active_low"},
+      {"index": 2, "name": "fan3", "signal": "fan_pwm_out[2]", "board_signal": "FAN_PWM2", "ball": "B5", "connector": "CON24", "connector_pin": 7, "polarity": "active_low"},
+      {"index": 3, "name": "fan4", "signal": "fan_pwm_out[3]", "board_signal": "FAN_PWM4", "ball": "A14", "connector": "CON26", "connector_pin": 7, "polarity": "active_low"}
+    ],
     "pwm_bits": 8,
+    "pwm_internal_width": 7,
+    "pwm_max_duty": 100,
+    "pwm_phase_count": 100,
+    "pwm_slot_clks": 1042,
     "pwm_frequency_hz": 20,
+    "pwm_actual_frequency_hz": 19.993602047,
     "ptc_polarity": "active_high",
     "fan_polarity": "active_low",
     "ptc_default": 0,
-    "fan_default": 26,
+    "fan_default": 10,
     "fan_connector_active_level": "high",
     "fan_board_inverts": true,
-    "solenoid_policy": "constant_safe_zero",
-    "z_policy": "constant_zero"
+    "boot_targets": {"ptc": 0, "fan": 10}
   },
   "motors": {
     "count": 2,
+    "order": ["x", "y"],
+    "role": "exhaust",
     "fixed_steps": 450,
-    "execution": "serial",
-    "order": ["inlet", "outlet"],
+    "execution": "overlap",
+    "busy_wait_ms": 600,
     "step_rate_hz": 1000,
     "step_half_cycles": 12500,
     "dir_setup_cycles": 25000,
-    "direction_values": [0, 1],
-    "direction_meaning": {"0": "open", "1": "close"},
-    "limits": "none",
+    "command_values": [0, 1, 2],
+    "heartbeat_value": 0,
     "mapping": {
-      "inlet": {"axis": "x", "step_ball": "C11", "dir_ball": "B12"},
-      "outlet": {"axis": "y", "step_ball": "D15", "dir_ball": "H14"}
+      "x": {"axis": "x", "role": "exhaust", "step_ball": "C11", "dir_ball": "B12"},
+      "y": {"axis": "y", "role": "exhaust", "step_ball": "D15", "dir_ball": "H14"}
     },
-    "enable_n": {"ball": "A10", "policy": "constant_low_enabled"}
+    "enable_n": {"ball": "A10", "active_level": "low", "policy": "shared_constant_low"}
+  },
+  "limits": {
+    "limit_count": 2,
+    "active_level": "high",
+    "functional_use": false,
+    "channels": [
+      {"name": "x_limit_raw", "ball": "B9"},
+      {"name": "y_limit_raw", "ball": "A11"}
+    ]
   },
   "temperature": {
     "value_count": 27,
@@ -54,6 +86,8 @@
     "registers": [0, 1, 2, 3, 4, 5, 6, 7, 8],
     "scl_ball": "M8",
     "sda_ball": "N9",
+    "bus": "i2c",
+    "device": "CT7428",
     "invalid_value": 255,
     "maximum_celsius": 150,
     "conversion": {
@@ -66,13 +100,17 @@
   "pins": {
     "host_uart_rx": "N11",
     "host_uart_tx": "M10",
-    "solenoid": "P5",
-    "z_step": "H12",
-    "z_dir": "F14",
-    "ls1": "B9",
-    "ls2": "A11",
-    "ptc_pwm": ["F16", "G16", "T4", "R5", "T6", "R7", "M1", "N1", "P1", "R1", "T2", "R3", "P16", "R16", "M16", "N16", "P8", "P7", "T9", "P9", "P10", "R10", "T13", "T12"],
-    "fan_pwm": ["C4", "B5", "B1", "A14"]
+    "temp_scl": "M8",
+    "temp_sda": "N9",
+    "ptc_pwm": ["G16", "F16", "N1", "M1", "R16", "P16", "P9", "T9"],
+    "fan_pwm": ["C4", "B5", "B1", "A14"],
+    "motor_en_n": "A10",
+    "x_step": "C11",
+    "x_dir": "B12",
+    "y_step": "D15",
+    "y_dir": "H14",
+    "x_limit_raw": "B9",
+    "y_limit_raw": "A11"
   },
   "resources": {
     "target_ram_blocks": 1,
@@ -99,10 +137,33 @@
       "set_all": 1,
       "get_temperature": 2,
       "temperature_data": 130
+    },
+    "set_all": {
+      "payload_length": 14,
+      "ptc_offset": 0,
+      "fan_offset": 8,
+      "motor_x_offset": 12,
+      "motor_y_offset": 13,
+      "duty_min": 0,
+      "duty_max": 100,
+      "motor_values": [0, 1, 2],
+      "heartbeat": [0, 0],
+      "response": "none"
+    },
+    "temperature_data": {
+      "payload_length": 27,
+      "frame_length": 33
     }
   },
   "timeouts": {
     "frame_inter_byte_ms": 10,
     "host_get_response_ms": 5000
+  },
+  "watchdog": {
+    "timeout_seconds": 10,
+    "tick_us": 500,
+    "tick_clks": 12500,
+    "timeout_ticks": 20000,
+    "target": {"ptc": 0, "fan": 20}
   }
 }

Разница между файлами не показана из-за своего большого размера
+ 41 - 4
projects/prod2u-door-temp/requirements.zh-CN.md


+ 817 - 76
schemas/project.schema.json

@@ -1,78 +1,819 @@
 {
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "type": "object",
-  "required": ["project_id", "profile", "device", "uart", "outputs", "motors", "temperature", "pins", "resources", "protocol", "timeouts"],
-  "properties": {
-    "project_id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
-    "profile": {"type": "string", "const": "prod2u-normal-multiproject-115200-v1"},
-    "device": {
-      "type": "object",
-      "required": ["family", "part", "clock_hz", "clock_ball"],
-      "properties": {
-        "family": {"type": "string", "const": "EF2"},
-        "part": {"type": "string", "const": "EF2L45BG256B"},
-        "clock_hz": {"type": "integer", "const": 25000000},
-        "clock_ball": {"type": "string", "const": "J1"}
-      },
-      "additionalProperties": false
-    },
-    "uart": {
-      "type": "object",
-      "required": ["baud", "data_bits", "parity", "stop_bits", "flow_control", "clks_per_bit", "inter_byte_timeout_ms"],
-      "properties": {
-        "baud": {"type": "integer", "const": 115200},
-        "data_bits": {"type": "integer", "const": 8},
-        "parity": {"type": "string", "const": "N"},
-        "stop_bits": {"type": "integer", "const": 1},
-        "flow_control": {"type": "string", "const": "none"},
-        "clks_per_bit": {"type": "integer", "const": 217},
-        "inter_byte_timeout_ms": {"type": "integer", "const": 10}
-      },
-      "additionalProperties": false
-    },
-    "outputs": {
-      "type": "object",
-      "required": ["ptc_count", "fan_count", "pwm_bits", "pwm_frequency_hz", "ptc_polarity", "fan_polarity", "ptc_default", "fan_default", "fan_connector_active_level", "fan_board_inverts", "solenoid_policy", "z_policy"],
-      "properties": {
-        "ptc_count": {"type": "integer", "const": 24},
-        "fan_count": {"type": "integer", "const": 4},
-        "pwm_bits": {"type": "integer", "const": 8},
-        "pwm_frequency_hz": {"type": "integer", "const": 20},
-        "ptc_polarity": {"type": "string", "const": "active_high"},
-        "fan_polarity": {"type": "string", "const": "active_low"},
-        "ptc_default": {"type": "integer", "const": 0},
-        "fan_default": {"type": "integer", "const": 26},
-        "fan_connector_active_level": {"type": "string", "const": "high"},
-        "fan_board_inverts": {"type": "boolean", "const": true},
-        "solenoid_policy": {"type": "string", "const": "constant_safe_zero"},
-        "z_policy": {"type": "string", "const": "constant_zero"}
-      },
-      "additionalProperties": false
-    },
-    "motors": {
-      "type": "object",
-      "required": ["count", "fixed_steps", "execution", "order", "step_rate_hz", "step_half_cycles", "dir_setup_cycles", "direction_values", "direction_meaning", "limits", "mapping", "enable_n"],
-      "properties": {
-        "count": {"type": "integer", "const": 2},
-        "fixed_steps": {"type": "integer", "const": 450},
-        "execution": {"type": "string", "const": "serial"},
-        "order": {"type": "array", "const": ["inlet", "outlet"]},
-        "step_rate_hz": {"type": "integer", "const": 1000},
-        "step_half_cycles": {"type": "integer", "const": 12500},
-        "dir_setup_cycles": {"type": "integer", "const": 25000},
-        "direction_values": {"type": "array", "const": [0, 1]},
-        "direction_meaning": {"type": "object"},
-        "limits": {"type": "string", "const": "none"},
-        "mapping": {"type": "object"},
-        "enable_n": {"type": "object"}
-      },
-      "additionalProperties": false
-    },
-    "temperature": {"type": "object"},
-    "pins": {"type": "object"},
-    "resources": {"type": "object"},
-    "protocol": {"type": "object"},
-    "timeouts": {"type": "object"}
-  },
-  "additionalProperties": false
+    "$schema":  "https://json-schema.org/draft/2020-12/schema",
+    "type":  "object",
+    "required":  [
+                     "project_id",
+                     "profile",
+                     "display_name",
+                     "device",
+                     "uart",
+                     "outputs",
+                     "motors",
+                     "limits",
+                     "temperature",
+                     "pins",
+                     "resources",
+                     "protocol",
+                     "timeouts",
+                     "watchdog"
+                 ],
+    "properties":  {
+                       "project_id":  {
+                                          "type":  "string",
+                                          "pattern":  "^[a-z0-9-]+$"
+                                      },
+                       "profile":  {
+                                       "type":  "string"
+                                   },
+                       "display_name":  {
+                                            "type":  "string",
+                                            "minLength":  1
+                                        },
+                       "device":  {
+                                      "type":  "object",
+                                      "required":  [
+                                                       "family",
+                                                       "part",
+                                                       "clock_hz",
+                                                       "clock_ball"
+                                                   ],
+                                      "properties":  {
+                                                         "family":  {
+                                                                        "type":  "string"
+                                                                    },
+                                                         "part":  {
+                                                                      "type":  "string"
+                                                                  },
+                                                         "clock_hz":  {
+                                                                          "type":  "integer"
+                                                                      },
+                                                         "clock_ball":  {
+                                                                            "type":  "string"
+                                                                        }
+                                                     },
+                                      "additionalProperties":  false
+                                  },
+                       "uart":  {
+                                    "type":  "object",
+                                    "required":  [
+                                                     "baud",
+                                                     "data_bits",
+                                                     "parity",
+                                                     "stop_bits",
+                                                     "flow_control",
+                                                     "clks_per_bit",
+                                                     "inter_byte_timeout_ms",
+                                                     "rx_ball",
+                                                     "tx_ball"
+                                                 ],
+                                    "properties":  {
+                                                       "baud":  {
+                                                                    "type":  "integer"
+                                                                },
+                                                       "data_bits":  {
+                                                                         "type":  "integer"
+                                                                     },
+                                                       "parity":  {
+                                                                      "type":  "string"
+                                                                  },
+                                                       "stop_bits":  {
+                                                                         "type":  "integer"
+                                                                     },
+                                                       "flow_control":  {
+                                                                            "type":  "string"
+                                                                        },
+                                                       "clks_per_bit":  {
+                                                                            "type":  "integer"
+                                                                        },
+                                                       "inter_byte_timeout_ms":  {
+                                                                                     "type":  "integer"
+                                                                                 },
+                                                       "rx_ball":  {
+                                                                       "type":  "string"
+                                                                   },
+                                                       "tx_ball":  {
+                                                                       "type":  "string"
+                                                                   }
+                                                   },
+                                    "additionalProperties":  false
+                                },
+                       "outputs":  {
+                                       "type":  "object",
+                                       "required":  [
+                                                        "ptc_count",
+                                                        "fan_count",
+                                                        "ptc_channels",
+                                                        "fan_channels",
+                                                        "pwm_bits",
+                                                        "pwm_internal_width",
+                                                        "pwm_max_duty",
+                                                        "pwm_phase_count",
+                                                        "pwm_slot_clks",
+                                                        "pwm_frequency_hz",
+                                                        "pwm_actual_frequency_hz",
+                                                        "ptc_polarity",
+                                                        "fan_polarity",
+                                                        "ptc_default",
+                                                        "fan_default",
+                                                        "fan_connector_active_level",
+                                                        "fan_board_inverts",
+                                                        "boot_targets"
+                                                    ],
+                                       "properties":  {
+                                                          "ptc_count":  {
+                                                                            "type":  "integer"
+                                                                        },
+                                                          "fan_count":  {
+                                                                            "type":  "integer"
+                                                                        },
+                                                          "ptc_channels":  {
+                                                                               "type":  "array",
+                                                                               "minItems":  8,
+                                                                               "maxItems":  8,
+                                                                               "items":  {
+                                                                                             "$ref":  "#/$defs/channel"
+                                                                                         }
+                                                                           },
+                                                          "fan_channels":  {
+                                                                               "type":  "array",
+                                                                               "minItems":  4,
+                                                                               "maxItems":  4,
+                                                                               "items":  {
+                                                                                             "$ref":  "#/$defs/channel"
+                                                                                         }
+                                                                           },
+                                                          "pwm_bits":  {
+                                                                           "type":  "integer"
+                                                                       },
+                                                          "pwm_internal_width":  {
+                                                                                     "type":  "integer"
+                                                                                 },
+                                                          "pwm_max_duty":  {
+                                                                               "type":  "integer"
+                                                                           },
+                                                          "pwm_phase_count":  {
+                                                                                  "type":  "integer"
+                                                                              },
+                                                          "pwm_slot_clks":  {
+                                                                                "type":  "integer"
+                                                                            },
+                                                          "pwm_frequency_hz":  {
+                                                                                   "type":  "integer"
+                                                                               },
+                                                          "pwm_actual_frequency_hz":  {
+                                                                                          "type":  "number"
+                                                                                      },
+                                                          "ptc_polarity":  {
+                                                                               "type":  "string"
+                                                                           },
+                                                          "fan_polarity":  {
+                                                                               "type":  "string"
+                                                                           },
+                                                          "ptc_default":  {
+                                                                              "type":  "integer"
+                                                                          },
+                                                          "fan_default":  {
+                                                                              "type":  "integer"
+                                                                          },
+                                                          "fan_connector_active_level":  {
+                                                                                             "type":  "string"
+                                                                                         },
+                                                          "fan_board_inverts":  {
+                                                                                    "type":  "boolean"
+                                                                                },
+                                                          "boot_targets":  {
+                                                                               "type":  "object",
+                                                                               "required":  [
+                                                                                                "ptc",
+                                                                                                "fan"
+                                                                                            ],
+                                                                               "properties":  {
+                                                                                                  "ptc":  {
+                                                                                                              "type":  "integer"
+                                                                                                          },
+                                                                                                  "fan":  {
+                                                                                                              "type":  "integer"
+                                                                                                          }
+                                                                                              },
+                                                                               "additionalProperties":  false
+                                                                           }
+                                                      },
+                                       "additionalProperties":  false
+                                   },
+                       "motors":  {
+                                      "type":  "object",
+                                      "required":  [
+                                                       "count",
+                                                       "order",
+                                                       "role",
+                                                       "fixed_steps",
+                                                       "execution",
+                                                       "busy_wait_ms",
+                                                       "step_rate_hz",
+                                                       "step_half_cycles",
+                                                       "dir_setup_cycles",
+                                                       "command_values",
+                                                       "heartbeat_value",
+                                                       "mapping",
+                                                       "enable_n"
+                                                   ],
+                                      "properties":  {
+                                                         "count":  {
+                                                                       "type":  "integer"
+                                                                   },
+                                                         "order":  {
+                                                                       "type":  "array"
+                                                                   },
+                                                         "role":  {
+                                                                      "type":  "string"
+                                                                  },
+                                                         "fixed_steps":  {
+                                                                             "type":  "integer"
+                                                                         },
+                                                         "execution":  {
+                                                                           "type":  "string"
+                                                                       },
+                                                         "busy_wait_ms":  {
+                                                                              "type":  "integer",
+                                                                              "minimum":  600
+                                                                          },
+                                                         "step_rate_hz":  {
+                                                                              "type":  "integer"
+                                                                          },
+                                                         "step_half_cycles":  {
+                                                                                  "type":  "integer"
+                                                                              },
+                                                         "dir_setup_cycles":  {
+                                                                                  "type":  "integer"
+                                                                              },
+                                                         "command_values":  {
+                                                                                "type":  "array"
+                                                                            },
+                                                         "heartbeat_value":  {
+                                                                                 "type":  "integer"
+                                                                             },
+                                                         "mapping":  {
+                                                                         "type":  "object",
+                                                                         "required":  [
+                                                                                          "x",
+                                                                                          "y"
+                                                                                      ],
+                                                                         "properties":  {
+                                                                                            "x":  {
+                                                                                                      "$ref":  "#/$defs/motor"
+                                                                                                  },
+                                                                                            "y":  {
+                                                                                                      "$ref":  "#/$defs/motor"
+                                                                                                  }
+                                                                                        },
+                                                                         "additionalProperties":  false
+                                                                     },
+                                                         "enable_n":  {
+                                                                          "type":  "object",
+                                                                          "required":  [
+                                                                                           "ball",
+                                                                                           "active_level",
+                                                                                           "policy"
+                                                                                       ],
+                                                                          "properties":  {
+                                                                                             "ball":  {
+                                                                                                          "type":  "string"
+                                                                                                      },
+                                                                                             "active_level":  {
+                                                                                                                  "type":  "string"
+                                                                                                              },
+                                                                                             "policy":  {
+                                                                                                            "type":  "string"
+                                                                                                        }
+                                                                                         },
+                                                                          "additionalProperties":  false
+                                                                      }
+                                                     },
+                                      "additionalProperties":  false
+                                  },
+                       "limits":  {
+                                      "type":  "object",
+                                      "required":  [
+                                                       "limit_count",
+                                                       "active_level",
+                                                       "functional_use",
+                                                       "channels"
+                                                   ],
+                                      "properties":  {
+                                                         "limit_count":  {
+                                                                             "type":  "integer"
+                                                                         },
+                                                         "active_level":  {
+                                                                              "type":  "string"
+                                                                          },
+                                                         "functional_use":  {
+                                                                                "type":  "boolean"
+                                                                            },
+                                                         "channels":  {
+                                                                          "type":  "array",
+                                                                          "minItems":  2,
+                                                                          "maxItems":  2,
+                                                                          "prefixItems":  [
+                                                                                              {
+                                                                                                  "$ref":  "#/$defs/x_limit"
+                                                                                              },
+                                                                                              {
+                                                                                                  "$ref":  "#/$defs/y_limit"
+                                                                                              }
+                                                                                          ],
+                                                                          "items":  false
+                                                                      }
+                                                     },
+                                      "additionalProperties":  false
+                                  },
+                       "temperature":  {
+                                           "type":  "object",
+                                           "required":  [
+                                                            "value_count",
+                                                            "device_addresses",
+                                                            "registers",
+                                                            "scl_ball",
+                                                            "sda_ball",
+                                                            "bus",
+                                                            "device",
+                                                            "invalid_value",
+                                                            "maximum_celsius",
+                                                            "conversion"
+                                                        ],
+                                           "properties":  {
+                                                              "value_count":  {
+                                                                                  "type":  "integer"
+                                                                              },
+                                                              "device_addresses":  {
+                                                                                       "type":  "array"
+                                                                                   },
+                                                              "registers":  {
+                                                                                "type":  "array"
+                                                                            },
+                                                              "scl_ball":  {
+                                                                               "type":  "string"
+                                                                           },
+                                                              "sda_ball":  {
+                                                                               "type":  "string"
+                                                                           },
+                                                              "bus":  {
+                                                                          "type":  "string"
+                                                                      },
+                                                              "device":  {
+                                                                             "type":  "string"
+                                                                         },
+                                                              "invalid_value":  {
+                                                                                    "type":  "integer"
+                                                                                },
+                                                              "maximum_celsius":  {
+                                                                                      "type":  "integer"
+                                                                                  },
+                                                              "conversion":  {
+                                                                                 "type":  "object",
+                                                                                 "required":  [
+                                                                                                  "profile",
+                                                                                                  "raw_shift",
+                                                                                                  "raw_width",
+                                                                                                  "reject_sign_bit"
+                                                                                              ],
+                                                                                 "properties":  {
+                                                                                                    "profile":  {
+                                                                                                                    "type":  "string"
+                                                                                                                },
+                                                                                                    "raw_shift":  {
+                                                                                                                      "type":  "integer"
+                                                                                                                  },
+                                                                                                    "raw_width":  {
+                                                                                                                      "type":  "integer"
+                                                                                                                  },
+                                                                                                    "reject_sign_bit":  {
+                                                                                                                            "type":  "boolean"
+                                                                                                                        }
+                                                                                                },
+                                                                                 "additionalProperties":  false
+                                                                             }
+                                                          },
+                                           "additionalProperties":  false
+                                       },
+                       "pins":  {
+                                    "type":  "object",
+                                    "required":  [
+                                                     "host_uart_rx",
+                                                     "host_uart_tx",
+                                                     "temp_scl",
+                                                     "temp_sda",
+                                                     "ptc_pwm",
+                                                     "fan_pwm",
+                                                     "motor_en_n",
+                                                     "x_step",
+                                                     "x_dir",
+                                                     "y_step",
+                                                     "y_dir",
+                                                     "x_limit_raw",
+                                                     "y_limit_raw"
+                                                 ],
+                                    "properties":  {
+                                                       "host_uart_rx":  {
+                                                                            "type":  "string"
+                                                                        },
+                                                       "host_uart_tx":  {
+                                                                            "type":  "string"
+                                                                        },
+                                                       "temp_scl":  {
+                                                                        "type":  "string"
+                                                                    },
+                                                       "temp_sda":  {
+                                                                        "type":  "string"
+                                                                    },
+                                                       "ptc_pwm":  {
+                                                                       "type":  "array",
+                                                                       "minItems":  8,
+                                                                       "maxItems":  8
+                                                                   },
+                                                       "fan_pwm":  {
+                                                                       "type":  "array",
+                                                                       "minItems":  4,
+                                                                       "maxItems":  4
+                                                                   },
+                                                       "motor_en_n":  {
+                                                                          "type":  "string"
+                                                                      },
+                                                       "x_step":  {
+                                                                      "type":  "string"
+                                                                  },
+                                                       "x_dir":  {
+                                                                     "type":  "string"
+                                                                 },
+                                                       "y_step":  {
+                                                                      "type":  "string"
+                                                                  },
+                                                       "y_dir":  {
+                                                                     "type":  "string"
+                                                                 },
+                                                       "x_limit_raw":  {
+                                                                           "type":  "string"
+                                                                       },
+                                                       "y_limit_raw":  {
+                                                                           "type":  "string"
+                                                                       }
+                                                   },
+                                    "additionalProperties":  false
+                                },
+                       "resources":  {
+                                         "type":  "object",
+                                         "required":  [
+                                                          "target_ram_blocks",
+                                                          "request_ram_blocks",
+                                                          "temperature_ram_blocks",
+                                                          "dsp",
+                                                          "shared_pwm_comparators",
+                                                          "shared_motor_executors",
+                                                          "shared_i2c_readers"
+                                                      ],
+                                         "properties":  {
+                                                            "target_ram_blocks":  {
+                                                                                      "type":  "integer"
+                                                                                  },
+                                                            "request_ram_blocks":  {
+                                                                                       "type":  "integer"
+                                                                                   },
+                                                            "temperature_ram_blocks":  {
+                                                                                           "type":  "integer"
+                                                                                       },
+                                                            "dsp":  {
+                                                                        "type":  "integer"
+                                                                    },
+                                                            "shared_pwm_comparators":  {
+                                                                                           "type":  "integer"
+                                                                                       },
+                                                            "shared_motor_executors":  {
+                                                                                           "type":  "integer"
+                                                                                       },
+                                                            "shared_i2c_readers":  {
+                                                                                       "type":  "integer"
+                                                                                   }
+                                                        },
+                                         "additionalProperties":  false
+                                     },
+                       "protocol":  {
+                                        "type":  "object",
+                                        "required":  [
+                                                         "header_hex",
+                                                         "crc",
+                                                         "commands",
+                                                         "set_all",
+                                                         "temperature_data"
+                                                     ],
+                                        "properties":  {
+                                                           "header_hex":  {
+                                                                              "type":  "string"
+                                                                          },
+                                                           "crc":  {
+                                                                       "type":  "object",
+                                                                       "required":  [
+                                                                                        "name",
+                                                                                        "polynomial",
+                                                                                        "initial",
+                                                                                        "reflect_input",
+                                                                                        "reflect_output",
+                                                                                        "xor_output",
+                                                                                        "coverage",
+                                                                                        "wire_order"
+                                                                                    ],
+                                                                       "properties":  {
+                                                                                          "name":  {
+                                                                                                       "type":  "string"
+                                                                                                   },
+                                                                                          "polynomial":  {
+                                                                                                             "type":  "integer"
+                                                                                                         },
+                                                                                          "initial":  {
+                                                                                                          "type":  "integer"
+                                                                                                      },
+                                                                                          "reflect_input":  {
+                                                                                                                "type":  "boolean"
+                                                                                                            },
+                                                                                          "reflect_output":  {
+                                                                                                                 "type":  "boolean"
+                                                                                                             },
+                                                                                          "xor_output":  {
+                                                                                                             "type":  "integer"
+                                                                                                         },
+                                                                                          "coverage":  {
+                                                                                                           "type":  "string"
+                                                                                                       },
+                                                                                          "wire_order":  {
+                                                                                                             "type":  "string"
+                                                                                                         }
+                                                                                      },
+                                                                       "additionalProperties":  false
+                                                                   },
+                                                           "commands":  {
+                                                                            "type":  "object",
+                                                                            "required":  [
+                                                                                             "set_all",
+                                                                                             "get_temperature",
+                                                                                             "temperature_data"
+                                                                                         ],
+                                                                            "properties":  {
+                                                                                               "set_all":  {
+                                                                                                               "type":  "integer"
+                                                                                                           },
+                                                                                               "get_temperature":  {
+                                                                                                                       "type":  "integer"
+                                                                                                                   },
+                                                                                               "temperature_data":  {
+                                                                                                                        "type":  "integer"
+                                                                                                                    }
+                                                                                           },
+                                                                            "additionalProperties":  false
+                                                                        },
+                                                           "set_all":  {
+                                                                           "type":  "object",
+                                                                           "required":  [
+                                                                                            "payload_length",
+                                                                                            "ptc_offset",
+                                                                                            "fan_offset",
+                                                                                            "motor_x_offset",
+                                                                                            "motor_y_offset",
+                                                                                            "duty_min",
+                                                                                            "duty_max",
+                                                                                            "motor_values",
+                                                                                            "heartbeat",
+                                                                                            "response"
+                                                                                        ],
+                                                                           "properties":  {
+                                                                                              "payload_length":  {
+                                                                                                                     "type":  "integer"
+                                                                                                                 },
+                                                                                              "ptc_offset":  {
+                                                                                                                 "type":  "integer"
+                                                                                                             },
+                                                                                              "fan_offset":  {
+                                                                                                                 "type":  "integer"
+                                                                                                             },
+                                                                                              "motor_x_offset":  {
+                                                                                                                     "type":  "integer"
+                                                                                                                 },
+                                                                                              "motor_y_offset":  {
+                                                                                                                     "type":  "integer"
+                                                                                                                 },
+                                                                                              "duty_min":  {
+                                                                                                               "type":  "integer"
+                                                                                                           },
+                                                                                              "duty_max":  {
+                                                                                                               "type":  "integer"
+                                                                                                           },
+                                                                                              "motor_values":  {
+                                                                                                                   "type":  "array"
+                                                                                                               },
+                                                                                              "heartbeat":  {
+                                                                                                                "type":  "array"
+                                                                                                            },
+                                                                                              "response":  {
+                                                                                                               "type":  "string"
+                                                                                                           }
+                                                                                          },
+                                                                           "additionalProperties":  false
+                                                                       },
+                                                           "temperature_data":  {
+                                                                                    "type":  "object",
+                                                                                    "required":  [
+                                                                                                     "payload_length",
+                                                                                                     "frame_length"
+                                                                                                 ],
+                                                                                    "properties":  {
+                                                                                                       "payload_length":  {
+                                                                                                                              "type":  "integer"
+                                                                                                                          },
+                                                                                                       "frame_length":  {
+                                                                                                                            "type":  "integer"
+                                                                                                                        }
+                                                                                                   },
+                                                                                    "additionalProperties":  false
+                                                                                }
+                                                       },
+                                        "additionalProperties":  false
+                                    },
+                       "timeouts":  {
+                                        "type":  "object",
+                                        "required":  [
+                                                         "frame_inter_byte_ms",
+                                                         "host_get_response_ms"
+                                                     ],
+                                        "properties":  {
+                                                           "frame_inter_byte_ms":  {
+                                                                                       "type":  "integer"
+                                                                                   },
+                                                           "host_get_response_ms":  {
+                                                                                        "type":  "integer"
+                                                                                    }
+                                                       },
+                                        "additionalProperties":  false
+                                    },
+                       "watchdog":  {
+                                        "type":  "object",
+                                        "required":  [
+                                                         "timeout_seconds",
+                                                         "tick_us",
+                                                         "tick_clks",
+                                                         "timeout_ticks",
+                                                         "target"
+                                                     ],
+                                        "properties":  {
+                                                           "timeout_seconds":  {
+                                                                                   "type":  "integer"
+                                                                               },
+                                                           "tick_us":  {
+                                                                           "type":  "integer"
+                                                                       },
+                                                           "tick_clks":  {
+                                                                             "type":  "integer"
+                                                                         },
+                                                           "timeout_ticks":  {
+                                                                                 "type":  "integer"
+                                                                             },
+                                                           "target":  {
+                                                                          "type":  "object",
+                                                                          "required":  [
+                                                                                           "ptc",
+                                                                                           "fan"
+                                                                                       ],
+                                                                          "properties":  {
+                                                                                             "ptc":  {
+                                                                                                         "type":  "integer"
+                                                                                                     },
+                                                                                             "fan":  {
+                                                                                                         "type":  "integer"
+                                                                                                     }
+                                                                                         },
+                                                                          "additionalProperties":  false
+                                                                      }
+                                                       },
+                                        "additionalProperties":  false
+                                    }
+                   },
+    "$defs":  {
+                  "channel":  {
+                                  "type":  "object",
+                                  "required":  [
+                                                   "index",
+                                                   "name",
+                                                   "signal",
+                                                   "board_signal",
+                                                   "ball",
+                                                   "connector",
+                                                   "connector_pin",
+                                                   "polarity"
+                                               ],
+                                  "properties":  {
+                                                     "index":  {
+                                                                   "type":  "integer",
+                                                                   "minimum":  0
+                                                               },
+                                                     "name":  {
+                                                                  "type":  "string",
+                                                                  "pattern":  "^(ptc|fan)[1-9][0-9]*$"
+                                                              },
+                                                     "signal":  {
+                                                                    "type":  "string",
+                                                                    "pattern":  "^(ptc|fan)_pwm_out\\[[0-9]+\\]$"
+                                                                },
+                                                     "board_signal":  {
+                                                                          "type":  "string",
+                                                                          "minLength":  1
+                                                                      },
+                                                     "ball":  {
+                                                                  "type":  "string",
+                                                                  "pattern":  "^[A-Z][0-9]+$"
+                                                              },
+                                                     "connector":  {
+                                                                       "type":  "string",
+                                                                       "pattern":  "^CON[0-9]+$"
+                                                                   },
+                                                     "connector_pin":  {
+                                                                           "type":  "integer",
+                                                                           "minimum":  1,
+                                                                           "maximum":  14
+                                                                       },
+                                                     "polarity":  {
+                                                                      "type":  "string",
+                                                                      "enum":  [
+                                                                                   "active_high",
+                                                                                   "active_low"
+                                                                               ]
+                                                                  }
+                                                 },
+                                  "additionalProperties":  false
+                              },
+                  "motor":  {
+                                "type":  "object",
+                                "required":  [
+                                                 "axis",
+                                                 "role",
+                                                 "step_ball",
+                                                 "dir_ball"
+                                             ],
+                                "properties":  {
+                                                   "axis":  {
+                                                                "type":  "string",
+                                                                "enum":  [
+                                                                             "x",
+                                                                             "y"
+                                                                         ]
+                                                            },
+                                                   "role":  {
+                                                                "type":  "string"
+                                                            },
+                                                   "step_ball":  {
+                                                                     "type":  "string",
+                                                                     "enum":  [
+                                                                                  "C11",
+                                                                                  "D15"
+                                                                              ]
+                                                                 },
+                                                   "dir_ball":  {
+                                                                    "type":  "string",
+                                                                    "enum":  [
+                                                                                 "B12",
+                                                                                 "H14"
+                                                                             ]
+                                                                }
+                                               },
+                                "additionalProperties":  false
+                            },
+                  "x_limit":  {
+                                  "type":  "object",
+                                  "required":  [
+                                                   "name",
+                                                   "ball"
+                                               ],
+                                  "properties":  {
+                                                     "name":  {
+                                                                  "type":  "string"
+                                                              },
+                                                     "ball":  {
+                                                                  "type":  "string"
+                                                              }
+                                                 },
+                                  "additionalProperties":  false
+                              },
+                  "y_limit":  {
+                                  "type":  "object",
+                                  "required":  [
+                                                   "name",
+                                                   "ball"
+                                               ],
+                                  "properties":  {
+                                                     "name":  {
+                                                                  "type":  "string"
+                                                              },
+                                                     "ball":  {
+                                                                  "type":  "string"
+                                                              }
+                                                 },
+                                  "additionalProperties":  false
+                              }
+              },
+    "additionalProperties":  false
 }