📄 global.h
字号:
/********************************************************************
* File: GLOBAL.h
*
* Copyright: Peak Microtech Corporation
*
*******************************************************************/
#ifndef _GLOBAL_H#define _GLOBAL_H#include "uart.h"#define GLOBAL_EXT extern GLOBAL_EXT struct Socket_Type TCP1024;GLOBAL_EXT volatile union Ip_Address_Type My_Ip_Address ; GLOBAL_EXT union Ip_Address_Type Gateway_Ip_Address; GLOBAL_EXT union Ip_Address_Type Mask_Ip_Address;GLOBAL_EXT union Ip_Address_Type Ping_Ip_Address; // save ping IP addressGLOBAL_EXT union Netcard RxdNetBuff; // Rx data bufferGLOBAL_EXT union Netcard TxdNetBuff; // Tx data bufferGLOBAL_EXT union Netcard Resend_Buff;
GLOBAL_EXT union Ethernet_Address_Type Gateway_MAC;GLOBAL_EXT union Ethernet_Address_Type Ping_MAC;GLOBAL_EXT union u RemotePort;GLOBAL_EXT union Ethernet_Address_Type My_MAC ;GLOBAL_EXT U8 BiSecond; // 2s this var is setGLOBAL_EXT U8 Tcp_Timeout;GLOBAL_EXT U8 TcpConnected;GLOBAL_EXT U8 ComTxdBufempty;GLOBAL_EXT uchar Msec;GLOBAL_EXT uchar Sec;GLOBAL_EXT uchar Min;GLOBAL_EXT uchar Gateway_IP_TTL;GLOBAL_EXT uchar Ping_IP_TTL;GLOBAL_EXT uchar Ping_Count;GLOBAL_EXT uchar Udp_Count;GLOBAL_EXT uchar RtTime;GLOBAL_EXT uchar Tcp_Drop_Count;GLOBAL_EXT uint FrameIndex;GLOBAL_EXT uchar ComRxdBuf[]; // UART RX data bufferGLOBAL_EXT uchar ComTxdBuf[]; // UART TX data bufferGLOBAL_EXT uint Command_Len;GLOBAL_EXT uchar HexTable[];GLOBAL_EXT uchar Command_Buf[COMMAND_BUFF_SIZE];GLOBAL_EXT unsigned char IpStr[16];GLOBAL_EXT unsigned char PortStr[5];GLOBAL_EXT void initial_system();GLOBAL_EXT unsigned char Rec_NewPacket();GLOBAL_EXT void SetMacID();GLOBAL_EXT unsigned char VerifyIpHeadCrc();GLOBAL_EXT unsigned char VerifyTcpCrc();GLOBAL_EXT uint CreateIpHeadCrc();GLOBAL_EXT uint CreateIcmpCrc();GLOBAL_EXT unsigned char VerifyUdpCrc();GLOBAL_EXT uint CreateTcpCrc();
GLOBAL_EXT uint CreateUdpCrc();GLOBAL_EXT void Create_Ip_Frame(uint length,uint IPH,uint IPL,uchar NextProtocal);GLOBAL_EXT union Ip_Address_Type *IP_Str2Hex(unsigned char *Str);GLOBAL_EXT void Delay_MS(uint ms_number);GLOBAL_EXT void IP_Hex2Str(union Ip_Address_Type ip) ;GLOBAL_EXT void Port_Hex2Str(U16 portnum);GLOBAL_EXT void Send_Packet(union Netcard *TxdNetBuff,uint length);GLOBAL_EXT void Delay(int ms);GLOBAL_EXT void NetReset(void);GLOBAL_EXT void PrintDataAsAsc(U8 *buf,U16 iBufLen);GLOBAL_EXT void TIMER1_Event();GLOBAL_EXT U16 converU16(U16 data);#endif /* _GLOBAL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -