📄 rs232_ethernet.h
字号:
/**
* \addtogroup t4app
* @{
*/
/**
* \file
* \brief rs232_ethernet demo header file
* \author Jane Gao <jgao@fameg.com>
*/
/*
******************************************************************************
*
Copyright (c) 2006 FameG Shanghai, Inc. All rights reserved.
*
This is unpublished proprietary source code of FameG Shanghai, Inc.
*
The copyright notice above does not evidence any actual or intended
*
publication of such source code.
******************************************************************************
*/
/*
******************************************************************************
*
Project: FS8610 application
*
Filename: rs232_ethernet.h
*
Date: 27/10/06
*
Purpose: RS232-Ethernet functions for L4MCU (Keil C Compiler)
*
Author: Jane Gao
******************************************************************************
*/
#include "kernel/socket.h"
#include "kernel/L4.h"
#include "hw/uart.h"
#include "user_config.h"
#if INCLUDE_RS232_ETHER_DEMO
/**************** Parameter Definition ****************/
typedef struct _ETH_CONFIG {
/* serial baud rate*/
UINT32 baudrate;
/* data bits*/
UINT8 databits;
/* parity: P_EVEN, P_ODD, P_NONE */
UINT8 parity;
/* flow control: F_SOFTWARE,F_ HARDWARE, F_NONE */
UINT8 flowctl;
/* protocol selecting: TCP_SERVER, TCP_CLIENT, UDP*/
UINT8 proto_select;
/* local port*/
UINT16 lport;
/* remote IP address*/
UINT32 ripaddr;
/* remote port*/
UINT16 rport;
/* ping response enable or disable */
BOOL ping_func;
/* firmware online update enable or disable */
//BOOL fupdate_func;
}eth_config_T;
#define NET_MODE_CHANGE 0x01 /* each bit of web_param_change*/
#define LOCAL_IP_CHANGE 0x02
#define GATEWAY_CHANGE 0x04
#define NETMASK_CHANGE 0x08
#define FIRST_DNS_CHANGE 0x10
#define PROTO_SELECT_CHANGE 0x20
#define LOCAL_PORT_CHANGE 0x40
#define BAUTRATE_CHANGE 0x80
#define DATABITS_CHANGE 0x100
#define PARITY_CHANGE 0x200
#define FLOWCTL_CHANGE 0x400
#define RIP_CHANGE 0x800
#define RPORT_CHANGE 0x1000
#define TCP_SERVER 1
#define TCP_CLIENT 2
#define UDP 3
#if 0
typedef struct _RS232_TO_ETH_CONFIG {
/* protocol selecting: TCP_SERVER, TCP_CLIENT, UDP*/
UINT8 proto_select;
/* local port*/
UINT16 lport;
/* serial band rate*/
UINT32 bandrate;
/* data bits*/
UINT8 databits;
/* parity: P_EVEN, P_ODD, P_NONE */
UINT8 parity;
/* flow control: F_SOFTWARE,F_ HARDWARE, F_NONE */
UINT8 flowctl;
/* remote IP address*/
UINT32 ripaddr;
/* remote port*/
UINT16 rport;
/* ping response enable or disable */
BOOL ping_func;
/* firmware online update enable or disable */
BOOL fupdate_func;
/* tfpt file name */
UINT8 fname[11];
/* tftp server IP address */
UINT32 tftpaddr;
}rs232_to_eth_conf_T;
#endif
/*************** external variable declaration ********************/
extern eth_config_T rs232_eth_conf;
//extern eth_config_T web_eth_conf;
/*************** Function Definition *******************/
void uart_ethernet_demo_init(UINT8 ch);
//void uart_ethernet_demo_init(UINT16 port);
/*this function will run in the while(1) loop of main()
* proto: 1.TCP ; 2.UDP ;
*
*/
void uart_ethernet_demo_run(UINT8 ch);
//void uart_ethernet_demo_close_connect(UINT8 ch);
//void reinit_after_webparam_changed(UINT8 ch);
/*************** external variable declaration ********************/
/*************** external function declaration ********************/
extern void init_param_to_web(void);
extern void get_param_from_web(void);
#endif
/** @} */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -