feat(ui): fold board inputs and outputs into the telemetry page

The 12 board-level rows now live at the end of the 遥信量 page instead of
a separate 开入开出 page: 8 opto inputs (DI_A..DI_H) and 4 relay outputs
(KO6/TRIP/ERT/CLZ). 33 rows become 45, five pages become six. The
standalone page, its menu entry, its golden references and both build
registrations are removed.

Folding the display is not folding the point table. The board rows
render from dio_di_* / dio_do_* and stay out of yx_bits / yx_valid /
yx_dp: any change to those carriers is provably absent from this diff.
IEC 104 mapping and YX_VALID_MASK are untouched, so nothing new is
reported to a master station.

Input polarity was wrong and is fixed here. On this board a 24 V input
drives the opto, which pulls the 74HC165 pin LOW, so the raw mask is
inverted relative to "has signal". The bit assembly only reordered bits;
nothing converted the level. The screen showed 分 on every channel no
matter what the operator drove in. Polarity now converts once, in the
driver, behind IOBOARD_DI_LEVEL_ACTIVE (0 = active low), so callers see
1 = has signal for both inputs and outputs.

Verified on the board: page 5 shows YX33 followed immediately by DI_A,
crossing the 33-point boundary with no drift; DI_C reads 合 because the
operator's signal is on channel C, the other seven read 分; page 6 shows
DI_H then all four outputs 释放. Page rows end at y=134, the footer
starts at y=144.

Input bit order is only partly verified: channel C was confirmed against
a real signal, the other seven have not been exercised channel by
channel. The board detects the presence of 24 V, not contact closure,
and the output rows show the shadow register (our intent) rather than
mechanical contact feedback. All three limits are recorded in the page
header and in the IOBOARD README.

Also adds a polarity guard to the host tests: the input polarity was
flipped once already, and until now no assertion would have caught a
silent re-flip, since only the DO side was pinned.
This commit is contained in:
2026-11-16 23:30:35 +08:00
parent 2b466b85f0
commit 515db819ab
22 changed files with 309 additions and 366 deletions
+13 -6
View File
@@ -243,12 +243,19 @@ ioboard_bits.c ← 纯逻辑:位序组装。只依赖 <stdint.h>,主机侧
不是「继电器现在真的动没动」。后者只能靠辅助触点或万用表。
5. **PE2 / PE4 是命名残留**:硬件无信号,本驱动不配置、不读取。若 CubeMX 里还留着它们,
那是 `IN_D4` / `IN_E4` 的旧配置,不影响本驱动。
6. **开入位序未经人工验证**:8 路开入与板级丝印 `DI_A`~`DI_H` 的对应关系目前只是
**按移位顺序推定**,没有现场逐路短接核对过。2026-11-16 那一轮读过 8 次、`ok_reads` 全部正常、
但 `read` 恒为 `0x00`——原因是操作员来不及逐路短接,不是驱动故障:数据线通路本身是好的。
判定标准见 §5 第 1 步(短接某一路应读到对应位的 `0x01`/`0x80`)。
**在完成这一步之前,任何"第 n 路开入处于什么状态"的结论都只能算推定。**
UI 侧的状态页 `ui_page_di_do.c` 在文件头注释里做了同样的声明。
6. **开入位序仅部分验证**:8 路开入与板级丝印 `DI_A`~`DI_H` 的对应关系按移位顺序推定,
2026-11-16 已在 **C 通道**上实测确认(信号接入 C 路 → 屏上只有 `DI_C` 显示「合」,
其余 7 路不动),即 A 在 LSB、H 在 MSB 的位序与通道隔离都正确。
其余 7 路尚未逐路验证;若某一路接反,症状是「该路动作时屏上亮的是另一路」。
UI 侧的遥信页 `Drivers/BSP/UI/ui_page_yx.c`(板级开入开出 12 行已并入该页)在文件头注释里做了同样的声明。
7. **开入是电平检测,不是通断检测**(用户口径,2026-11-16):
本板开入测量的是**输入信号有没有 24V 高电平**,「导通」本身是测不出来的——
外部信号必须提供 24V,仅仅把回路接通而没有电平,开入不会动作。
板上是**反相链路**:有 24V 输入 → 光耦导通 → 74HC165 的 A..H 引脚被拉**低**。
这个反相由 `ioboard.h` 的 `IOBOARD_DI_LEVEL_ACTIVE`(当前 `0U` = 低电平有效)在
`ioboard_di_read()` 返回前转换,所以**上层看到的 mask 里 1 恒表示「有信号」**,
消费者不需要各自记住「0 才是有信号」。
实测依据:`IOBOARD_DI_LEVEL_ACTIVE` 取 `1U` 时屏上全灭、取 `0U` 时对应那一路亮。
---