Files
CodeRepository/Projects/App_Toolkits/3rd/GuideCaptrueCard/include/ProtocolDYT6210.h
2026-03-02 21:40:25 +08:00

243 lines
12 KiB
C

/* Copyright (C)
* 2026 - marco <marco.tbls@gmail.com>
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef _PROTOCOL_DYT6210_H__
#define _PROTOCOL_DYT6210_H__
#pragma pack(1)
typedef struct _target {
unsigned char target_type;
char conf_thr;
short x;
short y;
short w;
short h;
}ST_AI_TARGE;
typedef struct _target_info {
unsigned char head[2];
unsigned char addr;
unsigned char length;
unsigned char cmd[2];
unsigned int frame_index;//当前AI检测的图像帧编号
unsigned long long frameRef;//当前帧的时间戳
unsigned char image_type;
unsigned char target_num;
ST_AI_TARGE targets[10];
unsigned char modelid; //模型ID
unsigned char crc;
unsigned char tail;
}ST_AI_TARGES;
typedef struct _t_target {
unsigned char target_type;
unsigned char conf_thr;
unsigned short w;
unsigned short h;
unsigned char noise;
unsigned char receved;
unsigned short x;
unsigned short y;
}ST_TRACK_TARGE;
typedef struct _track {
unsigned char head[2];
unsigned char addr;
unsigned char length;
unsigned char cmd[2];
unsigned int frame_index;//当前跟踪的图像帧编号
unsigned long long frameRef;//当前帧的时间戳
unsigned char image_type;
unsigned char track_status;
unsigned char track_num;
unsigned int fly_dis;
unsigned char fly_time;
unsigned char target_num;
ST_TRACK_TARGE targets[10];
unsigned char crc;
unsigned char tail;
}ST_TRACK_TARGES;
typedef struct _mnn_info {
unsigned char head[2];
unsigned char addr;
unsigned char length;
unsigned char cmd[2];
unsigned int frame_index;
unsigned long long frameRef;
unsigned char template_num;
unsigned char id;
unsigned short x1;
unsigned short y1;
unsigned short x2;
unsigned short y2;
unsigned char crc;
unsigned char tail;
}ST_MNN_TARGES;
typedef struct _cmp_data_source {
unsigned short tag; /* 2B 标记 */
unsigned int addr; /* 4B 地址 */
unsigned short length; /* 2B 长度 */
}ST_CMP_D_SOURCE;
typedef struct _cmp_data1 {
unsigned char Pcode[4]; /* 4B 数据源1: 产品代号: 0x44 0x59 0x18 0x42(DY6210) */
unsigned int Mcode; /* 4B 数据源1: 机器码: 0x00 */
short temp; /* 2B 数据源1: 温度 */
unsigned short status; /* 2B 数据源1: 组件结果: 0: 正常 1: 异常 */
unsigned char reserved[20]; /* 20B 数据源1: 预留 */
}ST_CMP_D1;
typedef struct _cmp_data2 {
unsigned short year; /* 2B 数据源2: 系统时间: 年 */
unsigned char month; /* 1B 数据源2: 系统时间: 月 */
unsigned char day; /* 1B 数据源2: 系统时间: 日 */
unsigned int sec; /* 4B 数据源2: 系统时间: 秒 s */
unsigned int pps; /* 4B 数据源2: 系统时间: 时间戳 us */
unsigned int uptime; /* 4B 数据源2: 本次工作时间 s */
unsigned int titaltime; /* 4B 数据源2: 累积工作时间 s */
unsigned int powerup_num; /* 4B 数据源2: 累积开机次数 */
unsigned char FPGA_V0_xx; /* 1B 数据源2: FPGA xx 外部版本 */
unsigned char FPGA_V0_yy; /* 1B 数据源2: FPGA yy */
unsigned char FPGA_V0_mm; /* 1B 数据源2: FPGA mm */
unsigned char FPGA_V0_nn; /* 1B 数据源2: FPGA nn */
unsigned short FPGA_V0_year; /* 2B 数据源2: FPGA year */
unsigned char FPGA_V0_month; /* 1B 数据源2: FPGA month */
unsigned char FPGA_V0_day; /* 1B 数据源2: FPGA day */
unsigned char FPGA_V1_xx; /* 1B 数据源2: FPGA xx 内部版本 */
unsigned char FPGA_V1_yy; /* 1B 数据源2: FPGA yy */
unsigned char FPGA_V1_mm; /* 1B 数据源2: FPGA mm */
unsigned short FPGA_V1_year; /* 2B 数据源2: FPGA year */
unsigned char FPGA_V1_month; /* 1B 数据源2: FPGA month */
unsigned char FPGA_V1_day; /* 1B 数据源2: FPGA day */
unsigned char FPGA_V1_hour; /* 1B 数据源2: FPGA hour */
unsigned char FPGA_V1_min; /* 1B 数据源2: FPGA minute */
unsigned char FPGA_V1_src; /* 1B 数据源2: FPGA second */
union {
//unsigned char _FPGA_status[2];
struct {
unsigned char pl_ddr : 1; /* 数据源2: FPGA b[0] : pl端ddr : 0: 正常 1: 故障 */
unsigned char ps_ddr : 1; /* 数据源2: FPGA b[1] : ps端ddr : 0: 正常 1: 故障 */
unsigned char flash : 1; /* 数据源2: FPGA b[2] : flash: 0: 正常 1: 故障 */
unsigned char emmc : 1; /* 数据源2: FPGA b[3] : emmc: 0: 正常 1: 故障 */
unsigned char comm_srio : 1; /* 数据源2: FPGA b[4] : 与通信控制板的SRIO link: 0: 正常 1: 故障 */
unsigned char dsp_srio : 1; /* 数据源2: FPGA b[5] : 与DSP的SRIO link: 0: 正常 1: 故障 */
unsigned char cm_ir : 1; /* 数据源2: FPGA b[6] : 红外输入: 0: 正常 1: 故障 */
unsigned char cm_rgb : 1; /* 数据源2: FPGA b[7] : 多光谱输入: 0: 正常 1: 故障 */
unsigned char comm_net : 1; /* 数据源2: FPGA b[0] : 与通信控制网络通信 : 0: 正常 1: 故障 */
unsigned char earth_uart: 1; /* 数据源2: FPGA b[1] : 与地测串口通信 : 0: 正常 1: 故障 */
unsigned char comm_uart : 1; /* 数据源2: FPGA b[2] : 与通信控制串口通信 : 0: 正常 1: 故障 */
unsigned char dsp_uart : 1; /* 数据源2: FPGA b[3] : 与DSP串口通信 : 0: 正常 1: 故障 */
unsigned char reserved : 4; /* 数据源2: FPGA b[4-7] : 保留 */
}FPGA_status;
};
union {
//unsigned char _DSP_status[20];
struct {
unsigned char ddr : 1; /* 数据源2: DSP b[0] : DDR: 0: 正常 1: 故障 */
unsigned char flash : 1; /* 数据源2: DSP b[1] : FLASH: 0: 正常 1: 故障 */
unsigned char srio_init : 1; /* 数据源2: DSP b[2] : SRIO初始化: 0: 正常 1: 故障 */
unsigned char recv_param: 1; /* 数据源2: DSP b[3] : 接收参数行: 0: 正常 1: 故障 */
unsigned char fpga_uart : 1; /* 数据源2: DSP b[4] : 与FPGA 串口通信: 0: 正常 1: 故障 */
unsigned char reserved0 : 3; /* 数据源2: DSP b[5-7] : 保留 */
unsigned char dsp_v0[8]; /* 数据源2: DSP 软件版本(外部) */
unsigned char dsp_v1[10]; /* 数据源2: DSP 软件版本(内部) */
unsigned char reserved1; /* 数据源2: 预留 */
}DSP_status;
};
}ST_CMP_D2;
typedef struct _cmp_data3 {
unsigned int pps; /* 4B 数据源3: pps 微秒 */
unsigned int sec; /* 4B 数据源3: 秒 */
}ST_CMP_D3;
typedef struct _cmp_data4 {
unsigned short tag; /* 2B 数据源4: 标记 */
unsigned short length; /* 2B 数据源4: 长度: 有效源长度和时间戳 */
unsigned char info[252]; /* 252B 数据源4: 识别信息: */
}ST_CMP_D4;
typedef struct _cmp_data5 {
unsigned short tag; /* 2B 数据源5: 标记 */
unsigned short length; /* 2B 数据源5: 长度: 有效源长度和时间戳 */
unsigned char info[508]; /* 508B 数据源5: 跟踪结果信息: */
}ST_CMP_D5;
typedef struct _cmp_data6 {
unsigned short tag; /* 2B 数据源6: 标记 */
unsigned short length; /* 2B 数据源6: 长度: 有效源长度和时间戳 */
unsigned char info[124]; /* 124B 数据源6: 惯导信息: */
}ST_CMP_D6;
typedef struct _cmp_data7 {
unsigned short tag; /* 2B 数据源7: 标记 */
unsigned short length; /* 2B 数据源7: 长度: 有效源长度和时间戳 */
unsigned char info[60]; /* 60B 数据源7: 扩充信息: */
}ST_CMP_D7;
typedef struct _cmp_data8 {
unsigned short tag; /* 2B 数据源8: 标记 */
unsigned short length; /* 2B 数据源8: 长度: 有效源长度和时间戳 */
unsigned char info[60]; /* 60B 数据源8: 扩充信息: */
}ST_CMP_D8;
typedef struct _cmp_data9 {
unsigned short tag; /* 2B 数据源9: 标记 */
unsigned short length; /* 2B 数据源9: 长度: 有效源长度和时间戳 */
unsigned char info[60]; /* 60B 数据源9: 扩充信息: */
}ST_CMP_D9;
typedef struct _cmp_dataA {
unsigned short tag; /* 2B 数据源A: 标记 */
unsigned short length; /* 2B 数据源A: 长度: 有效源长度和时间戳 */
unsigned char info[32]; /* 32B 数据源A: 扩充信息: */
}ST_CMP_DA;
typedef struct _cameralinke_param {
unsigned short head[4]; /* 0 - 7 帧头: 0x55AA 0xAA55 0xAAAA 0x5555 */
unsigned int index; /* 8 - 11 帧编号 */
unsigned char type[2]; /* 12 - 13 参数行类别: 0x73 0x62 */
unsigned char ver_xx; /* 14 - 14 版本号: xx */
unsigned char ver_yy; /* 15 - 15 版本号: yy */
unsigned int param_size; /* 16 - 19 参数行长度: 1280 * 2 */
unsigned int source_num; /* 20 - 23 数据源个数: 10 */
ST_CMP_D_SOURCE source[10]; /* 24 - 103 数据 */
ST_CMP_D1 D1; /* 104 - 135 数据源1 - 设备信息 */
ST_CMP_D2 D2; /* 136 - 199 数据源2 - 测试信息 */
ST_CMP_D3 D3; /* 200 - 207 数据源3 - PPS时间戳信息 */
ST_CMP_D4 D4; /* 208 - 463 数据源4 - 识别结果信息 */
ST_CMP_D5 D5; /* 464 - 975 数据源5 - 跟踪结果信息 */
ST_CMP_D6 D6; /* 976 - 1103 数据源6 - 预留信息 */
ST_CMP_D7 D7; /* 1104 - 1167 数据源7 - 预留信息 */
ST_CMP_D8 D8; /* 1168 - 1231 数据源8 - 预留信息 */
ST_CMP_D9 D9; /* 1232 - 1295 数据源9 - 预留信息 */
ST_CMP_DA DA; /* 1296 - 1331 数据源A - 预留信息 */
unsigned int crc; /* 1332 - 1335 校验 */
unsigned short tail[4]; /* 1336 - 1343 帧尾: 0x5555 0xAAAA 0xAA55 0x55AA */
}ST_CAMERALINK_PARAM;
Q_DECLARE_METATYPE(ST_CAMERALINK_PARAM)
#pragma pack()
#endif /* _PROTOCOL_DYT6210_H__ */