Files
STM32F4-Base/Drivers/BSP/UI
wandering1 515db819ab 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.
2026-11-16 23:30:35 +08:00
..
2026-09-09 17:15:04 +08:00
2026-09-10 11:36:33 +08:00

Drivers/BSP/UI/ — LVGL UI 组件

基于 LVGL 的界面实现:菜单树、内容页、通用组件、中文字库、待机页。 与 PC 模拟器共用同一套 UI 源码(simulator/ 只提供平台层)。

结构

核心 / 框架

文件 作用
ui_port.c/h LVGL 移植层:显示驱动、输入设备、tick 注册
ui_menu.c/h 菜单框架(树结构与导航)
ui_menu_view.c/h 菜单视图渲染
ui_menu_tab.c/h 页签组件
ui_deco.c/h 界面装饰元素(图标、边框等)
ui_standby.c/h 待机页
ui_pwd_def.h 密码页默认值定义
ui_font_cn_12.c 中文字库(由 tools/font_gen/ 生成,勿手改)

内容页

文件 作用
ui_content_page.c/h 内容页框架
ui_page_ac.c/h 交流量页
ui_page_dc.c/h 直流量页
ui_page_device_info.c/h 设备信息页
ui_page_net_cfg.c/h 网口设置页
ui_page_password.c/h 密码页
ui_page_runlog.c/h 运行日志页
ui_page_selftest.c/h 自检页

数据汇入(推流)

文件 作用
ui_net_sink.c/h 远端显示总线(RemoDispBus)数据汇入口
ui_net_sink_backend.h 后端抽象接口(MCU / 模拟器分别实现)
ui_net_sink_backend_mcu.c MCU 端后端实现

⚠️ 编码注意(本目录含中文字符串)

  • 本目录文件带 UTF-8 BOM(.c 内含中文字符串字面量,BOM 使 ARMCC 按 UTF-8 解码)
  • Edit 工具会剥掉 BOM:改完必须核对并按原样补回 3 字节 EF BB BF, 否则 ARMCC 改按 CP936 解读 → #870-D: invalid multibyte character sequence
  • UI 改动一律走 ui-verify skill 五步门禁
  • 含新汉字的文案提交前先跑 font-regen skill 重生成 ui_font_cn_12.c

相关文档

  • UI 架构:docs/UI设计/UI_设计架构.md
  • 菜单设计:docs/UI设计/菜单页面设计.md、docs/UI设计/内容页架构.md
  • 字体:docs/UI设计/UI_中文字体生成与配置.md
  • 模拟器:docs/UI设计/LVGL模拟器部署与使用说明.md
  • 自动化测试:docs/UI设计/UI_自动化测试流程.md
  • 协议:docs/UI设计/RemoDispBus协议与接收设计说明.md