You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.0 KiB
65 lines
2.0 KiB
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#define adwin_config_protocol_size sizeof(adwin_config_protocol_t)
|
|
#define active_report_data_size sizeof(active_report_data_t)
|
|
#define basic_report_data_size sizeof(basic_report_data_t)
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
typedef struct
|
|
{
|
|
uint32_t fixed_bit_1; /* 固定位1:F0 00 20 00 */
|
|
uint32_t time_stamp_s; /* 相对时间戳,上位机通知Xsync开始工作时,从0开始,每秒+1 */
|
|
uint32_t fixed_bit_2; /* 固定位2:00 00 B0 42 */
|
|
uint32_t server_version; /* server版本号 */
|
|
uint32_t xilinx_version; /* Xilinx Version,看需求中固定为:41 61 F7 FF */
|
|
uint8_t mac_address[6]; /* MAC地址 */
|
|
uint16_t fixed_bit_3; /* 固定位3:00 00 */
|
|
uint16_t fixed_bit_4; /* 固定位4:00 00 */
|
|
uint8_t dhcp_enable; /* DHCP enable :0-False 1- TRUE */
|
|
uint8_t netmask_count; /* netmask COUNT */
|
|
uint32_t gateway_ip; /* 网关 */
|
|
uint64_t fixed_bit_5; /* 固定位5:00 00 00 00 00 00 00 00 */
|
|
uint64_t fixed_bit_6; /* 固定位6:00 00 00 00 00 00 00 00 */
|
|
} adwin_config_protocol_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t index; /* */
|
|
uint16_t cmd_id; /* 指令id */
|
|
uint32_t time_stamp_s; /* 时间戳 */
|
|
int32_t encoder_1_count; /* 编码器1计数 */
|
|
int32_t encoder_2_count; /* 编码器2计数 */
|
|
uint8_t device_id; /* 设备ID号 */
|
|
uint8_t checksum; /* 校验和 */
|
|
} active_report_data_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t index; /* */
|
|
uint16_t cmd_id; /* 指令id */
|
|
uint16_t data; /* 数据 */
|
|
uint8_t checksum; /* 校验和 */
|
|
} basic_report_data_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t index; /* */
|
|
uint16_t cmd_id; /* 指令id */
|
|
uint8_t checksum; /* 校验和 */
|
|
} get_encoder_report_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t index; /* */
|
|
uint16_t cmd_id; /* 指令id */
|
|
uint32_t encoder1; /* 编码器1的数据 */
|
|
uint32_t encoder2; /* 编码器2的数据 */
|
|
uint8_t checksum; /* 校验和 */
|
|
} get_encoder_respont_t;
|
|
|
|
#pragma pack(pop)
|