Files
simba-rmic-2026/components/esp32-camera/sensors/private_include/hm1055_regs.h
T
Horldsence 4f893ce140 ESP32-S3 摄像头图传:固件 + Slint 客户端 + 共享协议
两块 ESP32-S3-WROOM-1-N16R8 图传板(DVP 接口接 OV2640/OV3660/OV5640),
向队伍客户端与裁判终端推 UDP 图传。固件是跑在 ESP-IDF 上的 Rust,用官方
esp32-camera 组件采集;客户端是 Rust + Slint 桌面程序。

三个 crate 各自独立构建:
  .            firmware,交叉编译到 Xtensa
  protocol/    线路格式与帧重组,两端共用,无 ESP-IDF 依赖,有单元测试
  client/      Slint 桌面客户端

视频走 UDP 而非 TCP:实测传感器产出 22 fps,TCP MJPEG 只送出 1.9 fps,
且只占用链路能力的 1%——链路是空的,帧堵在队头阻塞后面等一个实时画面
等不起的重传计时器。改为独立数据报、不重传、缺片丢整帧后达到 20.8 fps。

发现是双向的:板子每 2 秒广播 Hello,客户端广播 Subscribe,板子据此定向
推流。板子身份由 MAC 派生,重启不变,所以客户端可以把绑定存进配置。

裁判端同时收两块板子(每个发送方一个重组器),队伍端绑定其中一块并只显示
自己那一边的血量。装甲板接口已预留(ArmorSource trait + ARMOR_PORT),
当前无数据源,界面显示占位符。

vendor 了 esp32-camera 2.1.7:组件注册表的版本求解器找不到它,且需要打一处
补丁(见 components/esp32-camera/target/esp32s3/ll_cam.c)。

.gitignore 三条 target/ 都锚定在根目录,因为 protocol/ 与 client/ 各自也是
独立 crate;而 components/esp32-camera/target/ 是上游的按芯片分目录,里面是
源码,必须保留。
2026-10-05 18:22:19 +08:00

121 lines
2.4 KiB
C

/*
* HM1055 register definitions.
*/
#ifndef __REG_REGS_H__
#define __REG_REGS_H__
// Imager Configuration
#define CMU 0x0000
#define IDH 0x0001
#define IDL 0x0002
#define VID 0x0003
#define PWDCTRL 0x0004
#define TGRDCFG 0x0005
#define RDCFG 0x0006
#define VREAD 0x000D
#define HREAD 0x000E
#define IMG_CFG 0x000F
// Imager Operation
#define BLNKRH 0x0010
#define BLNKRL 0x0011
#define BLNKCCLK 0x0012
#define BLNKC 0x0013
#define INTGH 0x0015
#define INTGL 0x0016
#define AGAIN 0x0018
#define DGAIN 0x001D
// IO and Clock Configuration Setting
#define OPRTCFG 0x0020
#define SFTRST 0x0022 // any value to reset
#define IOCTRLH 0x0023
#define IOCTRLL 0x0024
#define CKCFG1 0x0025
#define CKCFG2 0x0026
#define PORTCTRL 0x0027
#define TESTIMG 0x0028
#define CCIR656 0x0029
#define PLL1 0x002A
#define CKCFG3 0x002B
#define PLL2 0x002C
// Black Level Target
#define BLCTGT 0x0040
#define BLCTGT2 0x0053
// Vertical Arbitrary Window Configuration
#define VAWINSTARTH 0x0078
#define VAWINSTARTL 0x0079
#define VAWINENDH 0x007A
#define VAWINENDL 0x007B
// Image Signal Processing Control
#define CMU_AE 0x0100
#define CMU_AWB 0x0101
#define ISPID 0x0105
#define ISPCTRL1 0x0120
#define ISPCTRL2 0x0121
#define ISPCTRL3 0x0122
#define ISPCTRL4 0x0124
#define ISPCTRL5 0x0125
#define ISPCTRL6 0x0126
// RAW Noise Filter Control
#define RAWNF 0x01E4
#define ARAWNF 0x01E5
#define ARAWNFODEL 0x01E6
// Automatic Exposure Control Registers
#define AEWBCFG 0x0380
#define AETARGU 0x0381
#define AETARGL 0x0382
#define AETARGM 0x0383
// Saturation and Hue Control
#define SAT 0x0480
#define ASAT 0x0481
#define ASATODEL 0x0482
#define HUESIN 0x0486
#define HUECOS 0x0487
#define SCENE 0x0488
// Contrast and Brightness Control
#define CONTM 0x04B0
#define ACONTM 0x04B1
#define CONTQ 0x04B3
#define ACONTQ 0x04B4
#define CONTN 0x04B6
#define CONTP 0x04B9
#define CONTGAIN 0x04BC
#define YMEAN 0x04BD
#define BRIGHT 0x04C0
// Y Denoise Control
#define YDN 0x0580
#define AYDN 0x0581
#define AYDNODEL 0x0582
// Sharpness Control
#define EDGE 0x05A1
// Fade to Black Control
#define F2BMEAN 0x05D0
#define F2BRANGE 0x05D1
// Digital Window Control
#define YUVSCXL 0x05E0
#define YUVSCXH 0x05E1
#define YUVSCYL 0x05E2
#define YUVSCYH 0x05E3
#define WINXSTL 0x05E4
#define WINXSTH 0x05E5
#define WINXEDL 0x05E6
#define WINXEDH 0x05E7
#define WINYSTL 0x05E8
#define WINYSTH 0x05E9
#define WINYEDL 0x05EA
#define WINYEDH 0x05EB
#endif //__REG_REGS_H__