两块 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/ 是上游的按芯片分目录,里面是 源码,必须保留。
83 lines
2.3 KiB
C
83 lines
2.3 KiB
C
/*
|
|
* GC032A register definitions.
|
|
*/
|
|
#ifndef __GC032A_REG_REGS_H__
|
|
#define __GC032A_REG_REGS_H__
|
|
|
|
#define SENSOR_ID_HIGH 0XF0
|
|
#define SENSOR_ID_LOW 0XF1
|
|
#define PAD_VB_HIZ_MODE 0XF2
|
|
#define SYNC_OUTPUT 0XF3
|
|
#define I2C_CONFIG 0XF4
|
|
#define PLL_MODE1 0XF7
|
|
#define PLL_MODE2 0XF8
|
|
#define CM_MODE 0XF9
|
|
#define ISP_DIV_MODE 0XFA
|
|
#define I2C_DEVICE_ID 0XFB
|
|
#define ANALOG_PWC 0XFC
|
|
#define ISP_DIV_MODE2 0XFD
|
|
#define RESET_RELATED 0XFE // Bit[7]: Software reset
|
|
// Bit[6]: cm reset
|
|
// Bit[5]: spi reset
|
|
// Bit[4]: CISCTL_restart_n
|
|
// Bit[3]: PLL_rst
|
|
// Bit[2:0]: page select
|
|
// 000:page0
|
|
// 001:page1
|
|
// 010:page2
|
|
// 011:page3
|
|
|
|
//----page0-----------------------------
|
|
#define P0_EXPOSURE_HIGH 0X03
|
|
#define P0_EXPOSURE_LOW 0X04
|
|
#define P0_HB_HIGH 0X05
|
|
#define P0_HB_LOW 0X06
|
|
#define P0_VB_HIGH 0X07
|
|
#define P0_VB_LOW 0X08
|
|
#define P0_ROW_START_HIGH 0X09
|
|
#define P0_ROW_START_LOW 0X0A
|
|
#define P0_COLUMN_START_HIGH 0X0B
|
|
#define P0_COLUMN_START_LOW 0X0C
|
|
#define P0_WINDOW_HEIGHT_HIGH 0X0D
|
|
#define P0_WINDOW_HEIGHT_LOW 0X0E
|
|
#define P0_WINDOW_WIDTH_HIGH 0X0F
|
|
#define P0_WINDOW_WIDTH_LOW 0X10
|
|
#define P0_SH_DELAY 0X11
|
|
#define P0_VS_ST 0X12
|
|
#define P0_VS_ET 0X13
|
|
#define P0_CISCTL_MODE1 0X17
|
|
|
|
#define P0_BLOCK_ENABLE_1 0X40
|
|
#define P0_AAAA_ENABLE 0X42
|
|
#define P0_SPECIAL_EFFECT 0X43
|
|
#define P0_SYNC_MODE 0X46
|
|
#define P0_GAIN_CODE 0X48
|
|
#define P0_DEBUG_MODE2 0X4C
|
|
#define P0_WIN_MODE 0X50
|
|
#define P0_OUT_WIN_Y1_HIGH 0X51
|
|
#define P0_OUT_WIN_Y1_LOW 0X52
|
|
#define P0_OUT_WIN_X1_HIGH 0X53
|
|
#define P0_OUT_WIN_X1_LOW 0X54
|
|
#define P0_OUT_WIN_HEIGHT_HIGH 0X55
|
|
#define P0_OUT_WIN_HEIGHT_LOW 0X56
|
|
#define P0_OUT_WIN_WIDTH_HIGH 0X57
|
|
#define P0_OUT_WIN_WIDTH_LOW 0X58
|
|
|
|
#define P0_GLOBAL_SATURATION 0XD0
|
|
#define P0_SATURATION_CB 0XD1
|
|
#define P0_SATURATION_CR 0XD2
|
|
#define P0_LUMA_CONTRAST 0XD3
|
|
#define P0_CONTRAST_CENTER 0XD4
|
|
#define P0_LUMA_OFFSET 0XD5
|
|
#define P0_FIXED_CB 0XDA
|
|
#define P0_FIXED_CR 0XDB
|
|
|
|
//----page3-----------------------------
|
|
#define P3_IMAGE_WIDTH_LOW 0X5B
|
|
#define P3_IMAGE_WIDTH_HIGH 0X5C
|
|
#define P3_IMAGE_HEIGHT_LOW 0X5D
|
|
#define P3_IMAGE_HEIGHT_HIGH 0X5E
|
|
|
|
|
|
#endif //__GC032A_REG_REGS_H__
|