第一次提交
This commit is contained in:
178
MFC2AF5DEDB.tmp
Normal file
178
MFC2AF5DEDB.tmp
Normal file
@@ -0,0 +1,178 @@
|
||||
#ifndef ETH_DEMO_H
|
||||
#define ETH_DEMO_H
|
||||
|
||||
#include "app_config.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//volatile uint8_t RgCanToGPSCnt = 0;//导航仪CAN计数器
|
||||
//volatile uint8_t RgCanToGPSCntLast = 0;//导航仪CAN计数器过去值
|
||||
//volatile uint8_t RgCanGPSFault = 0;//导航仪CAN故障
|
||||
|
||||
//volatile uint8_t RgCanMoterFault = 0;//电机控制器1CAN故障
|
||||
//
|
||||
//volatile uint8_t RgENTFaultContral = 0;//控制器遥控以太网故障
|
||||
//volatile uint8_t RgConEnetVaulelast = 0;//遥控以太网过去数据
|
||||
//
|
||||
//volatile uint8_t RgENTFaultOwn = 0;//控制器自主以太网故障
|
||||
//volatile uint8_t RgOwnEnetVaulelast = 0;//自主以太网过去数据
|
||||
//
|
||||
//volatile uint8_t RgENTFaultRemoteControlRoom = 0;//控制器遥控室故障
|
||||
//volatile uint8_t RgRemoteControlRoomENTVaulelast = 0;//控制器遥控室过去数据
|
||||
//
|
||||
//volatile uint16_t RgCanRC6GSFault = 0;//汽车遥控CAN接收故障
|
||||
//volatile uint16_t RgCanRC6GSCnt = 0;//汽车遥控CAN接收计数器
|
||||
//volatile uint16_t RgCanRC6GSCntLast = 0;//汽车遥控接收计数器过去值
|
||||
//
|
||||
//
|
||||
//uint16_t RgCanToBatteryCnt = 0;//BMS CAN接收计数器
|
||||
//uint16_t RgETHToPortableCnt = 0;//以太网遥控器接受计数器
|
||||
//uint16_t RgETHToOwnComputerCnt = 0;//以太网接受自主计算器
|
||||
//uint16_t RgETHToRemoteControlCnt = 0;//以太网监控室接收计数器
|
||||
//
|
||||
//uint16_t RgCanToMotorCnt1 = 0;//CAN接收计数器
|
||||
//uint16_t RgCanToMotorCntLast1 = 0;//CAN接收计数器过去值
|
||||
//
|
||||
//uint16_t RgCanToMotorCnt2 = 0;//CAN接收计数器
|
||||
//uint16_t RgCanToMotorCntLast2 = 0;//CAN接收计数器过去值
|
||||
//
|
||||
//uint8_t RgEthernetOwnCnt = 0;//自主接收故障定时器
|
||||
//uint8_t RgEthernetTelecontrolCnt = 0;//手柄遥控故障定时器
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char gps_state; // GPS状态 | 0故障 1正常
|
||||
unsigned char motor1_state; // 电机1状态 | 0故障 1正常
|
||||
unsigned char motor2_state; // 电机2状态 | 0故障 1正常
|
||||
unsigned char remote_state; // 遥控状态 | 0故障 1正常
|
||||
unsigned char bms_state; // BMS状态 | 0故障 1正常
|
||||
unsigned char auto_state; // 自动状态 | 0故障 1正常
|
||||
unsigned char manual_state; // 手动状态 | 0故障 1正常
|
||||
|
||||
unsigned char gps_change; // GPS变化 | 0未发生变化 1变化
|
||||
unsigned char motor1_change; // 电机1变化 | 0未发生变化 1变化
|
||||
unsigned char motor2_change; // 电机2变化 | 0未发生变化 1变化
|
||||
unsigned char remote_change; // 遥控变化 | 0未发生变化 1变化
|
||||
unsigned char bms_change; // BMS变化 | 0未发生变化 1变化
|
||||
unsigned char auto_change; // 自动变化 | 0未发生变化 1变化
|
||||
unsigned char manual_change; // 手动变化 | 0未发生变化 1变化
|
||||
|
||||
} FaultInfo;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t auto_count; //自动数据计数器
|
||||
uint8_t manual_count; //手动数据计数器
|
||||
uint8_t auto_state; // 自动状态 | 0故障 1正常
|
||||
uint8_t manual_state; // 手动状态 | 0故障 1正常
|
||||
|
||||
|
||||
uint8_t auto_count_old; //自动数据计数器
|
||||
uint8_t manual_count_old; //手动数据计数器
|
||||
uint8_t auto_state_old; // 自动状态 | 0故障 1正常
|
||||
uint8_t manual_state_old; // 手动状态 | 0故障 1正常
|
||||
uint8_t auto_state; // 自动状态 | 0故障 1正常
|
||||
uint8_t manual_state; // 手动状态 | 0故障 1正常
|
||||
|
||||
} StrFaultInformation;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t navigator_counter; //导航仪计数器
|
||||
uint16_t motor1_counter; //电机控制器1计数器
|
||||
uint16_t motor2_counter; //电机控制器2计数器
|
||||
uint16_t remote_counter; //遥控器计数器
|
||||
uint16_t bms_cnt; //BMS计数器
|
||||
uint16_t auto_cnt; //自动数据计数器
|
||||
uint16_t manual_cnt; //手动数据计数器
|
||||
|
||||
uint16_t can_gps_cnt_old ; //导航仪计数器过去值
|
||||
uint16_t can_motor1_cnt_last; //电机控制器1计数器过去值
|
||||
uint16_t can_motor2_cnt_last; //电机控制器2计数器过去值
|
||||
uint16_t can_remote_control_cnt_last; //遥控器计数器过去值
|
||||
uint16_t can_bms_cnt_last; //bms计数器过去值
|
||||
uint16_t ethernet_auto_computer_cnt_last; //自动数据计数器过去值
|
||||
uint16_t ethernet_manual_computer_cnt_last;//手动数据计数器过去值
|
||||
|
||||
bool can_gps_state_last; //导航仪故障状态过去值 0故障 1正常
|
||||
bool can_motor1_state_last; //电机控制器1状态故障过去值 0故障 1正常
|
||||
bool can_motor2_state_last; //电机控制器2状态故障过去值
|
||||
bool can_bms_state_last; //bms故障状态过去值
|
||||
bool can_remote_control_state_last; //遥控器故障状态过去值
|
||||
bool ethernet_auto_computer_state_last; //自动数据故障状态过去值
|
||||
bool ethernet_manual_computer_state_last; //手动数据故障状态过去值
|
||||
|
||||
} StrFaultTemp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t local_ip[4];
|
||||
uint8_t mask[4];
|
||||
uint16_t Local_upper_port;
|
||||
uint16_t Local_download_port;
|
||||
uint16_t local_communication_port;
|
||||
uint8_t computer_ip[4];
|
||||
uint8_t upper_ip[4];
|
||||
uint8_t download_ip[4];
|
||||
uint16_t target_upper_port;
|
||||
uint16_t target_download_port;
|
||||
uint16_t target_communication_port;
|
||||
|
||||
} StrEthernetParameter;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define UDPCB_1 1//通讯端口
|
||||
#define UDPCB_2 2//上位机端口
|
||||
#define UDPCB_3 3//下载端口
|
||||
|
||||
|
||||
#define COMMUNICATION_PORT 8011
|
||||
#define UPPER_PORT 8000
|
||||
#define DOWNLOAR_PORT 7811
|
||||
|
||||
|
||||
//外部函数
|
||||
void UDP_Echo_Init(uint8_t udpcbID, udp_recv_fn recv, uint16_t port);
|
||||
void UdpSendToData(uint8_t udpcbID, uint8_t *buf, uint16_t len, uint8_t *sip, uint16_t port);
|
||||
|
||||
void udp_Callback_1(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port);
|
||||
void udp_Callback_2(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port);
|
||||
//外部变量
|
||||
extern struct udp_pcb *udpcb_1;
|
||||
|
||||
extern StrEthernetParameter ethernet_parameter;
|
||||
extern StrFaultInformation str_faultInformation;
|
||||
|
||||
#endif /*ETH_DEMO_H */
|
||||
Reference in New Issue
Block a user