Customer_controller/USER/referee.h

42 lines
764 B
C

//
// Created by 24871 on 2024/10/9.
//
#ifndef CUSTOMER_CONTROLLER_REFEREE_H
#define CUSTOMER_CONTROLLER_REFEREE_H
#include "main.h"
/* 帧头定义 */
typedef struct __packed
{
uint8_t SOF; // 数据帧起始字节 固定值为0xA5
uint16_t DataLength; // 数据帧中data的长度
uint8_t Seq; // 包序号
uint8_t CRC8; // 帧头CRC8校验
} xFrameHeader;
typedef struct __packed
{
xFrameHeader FrameHeader; // 接收到的帧头信息
uint16_t CmdID;
uint16_t motor1_pos;
uint16_t motor2_pos;
uint16_t motor3_pos;
uint16_t motor4_pos;
uint8_t data[22];
uint16_t CRC16;
} VT_info_t;
extern VT_info_t VTinfo;
void VT_Init();
void VTdata_update();
#endif //CUSTOMER_CONTROLLER_REFEREE_H