第一次上传E3boot
This commit is contained in:
108
interface_ethernet.h
Normal file
108
interface_ethernet.h
Normal file
@@ -0,0 +1,108 @@
|
||||
#ifndef _INTERFACE_ETHERNET_H_
|
||||
#define _INTERFACE_ETHERNET_H_
|
||||
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/udp.h"
|
||||
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/init.h"
|
||||
#include "netif/etharp.h"
|
||||
#include "lwip/pbuf.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//<2F><>̫<EFBFBD><CCAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
typedef struct _StrEthernetFault
|
||||
{
|
||||
uint8_t auto_count; //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint8_t manual_count; //<2F>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint8_t auto_state; // <20>Զ<EFBFBD>״̬ | 0<><30><EFBFBD><EFBFBD> 1<><31><EFBFBD><EFBFBD>
|
||||
uint8_t manual_state; // <20>ֶ<EFBFBD>״̬ | 0<><30><EFBFBD><EFBFBD> 1<><31><EFBFBD><EFBFBD>
|
||||
} StrEthernetFault;
|
||||
|
||||
typedef union _UnEthernetFault
|
||||
{
|
||||
StrEthernetFault bit_data; // ʹ<>ö<EFBFBD><C3B6><EFBFBD><EFBFBD>Ľṹ<C4BD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint8_t arr[sizeof(StrEthernetFault)]; // ͨ<><CDA8><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD>С
|
||||
} UnEthernetFault;
|
||||
|
||||
|
||||
extern UnEthernetFault ethernet_fault_Info;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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//ͨѶ<CDA8>˿<EFBFBD>
|
||||
#define UDPCB_2 2//<2F><>λ<EFBFBD><CEBB><EFBFBD>˿<EFBFBD>
|
||||
#define UDPCB_3 3//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>˿<EFBFBD>
|
||||
|
||||
|
||||
|
||||
#define DOWNLOAR_PORT 7812 //<2F><>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1><EFBFBD>Ķ˿ڣ<CBBF><DAA3><EFBFBD><EFBFBD>ն˿<D5B6>
|
||||
#define BOOT_TX_PORT 7811 //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>д<EFBFBD>Ķ˿ڣ<CBBF>Ŀ<EFBFBD><C4BF><EFBFBD>˿ڣ<CBBF><DAA3><EFBFBD><EFBFBD><EFBFBD>˭
|
||||
#define WDT_PORT 7813 //<2F><>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1><EFBFBD>Ķ˿ڣ<CBBF><DAA3><EFBFBD><EFBFBD>ն˿<D5B6>
|
||||
|
||||
|
||||
|
||||
//<2F>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD>
|
||||
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);
|
||||
void udp_Callback_3(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port);
|
||||
void ethernetTimerProcess(void);
|
||||
void ethernetInterfaceInit(void);
|
||||
void lwip_Ethernet(void);
|
||||
//<2F>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD>
|
||||
extern struct udp_pcb *udpcb_1;
|
||||
extern StrEthernetParameter ethernet_parameter;
|
||||
|
||||
#endif /*ETH_DEMO_H */
|
||||
Reference in New Issue
Block a user