⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mn_stackconst.h

📁 flash programming source code for silabs uC s.
💻 H
字号:
//-----------------------------------------------------------------------------
// mn_stackconst.h
//-----------------------------------------------------------------------------
// Copyright 2006 Silicon Laboratories, Inc.
//
// Description:
// 	This file contains stack-defined constants used by the TCP/IP Stack.
//    These constants should not be modified by the user.
//
// Generated by TCP/IP Configuration Wizard Version 3.1.
//

#ifndef MN_STACKCONST_H
#define MN_STACKCONST_H

#define IP_ADDR_LEN        4     // number of bytes in IP address
#define ETH_ADDR_LEN       6     // number of bytes in MAC address
#define VF_NAME_LEN        20
#define FUNC_NAME_LEN      20

// Duplex Modes
#define  HALF_DUPLEX 0x00
#define  FULL_DUPLEX 0x01
#define  AUTO_NEG    0x02

// Virtual File Page Types
#define VF_PTYPE_DYNAMIC         0x01  // Page Type Dynamic allocated memory
#define VF_PTYPE_STATIC          0x02  // Page Type Static allocated memory
#define VF_PTYPE_FLASH           0x04  // Page Type Type FLASH memory
#define VF_PTYPE_RAM             0x08  // Page Type Type RAM memory
#define VF_PTYPE_CP2200_FLASH    0x10  // Page Type Type CP2200 FLASH memory
#define VF_PTYPE_HTML            0x80  // Web page is an HTML page

// HTTP Status Message Lengths
#define STATUS_204_LEN  27
#define STATUS_400_LEN  39
#define STATUS_404_LEN  35
#define STATUS_501_LEN  47

#define PCONST_BYTE  byte cmx_const *

#define TEMP_CGI_BUFF_LEN     (FUNC_NAME_LEN+18)

#define MK_SOCKET_PTR(s)      &sock_info[(s)]
#define SOCKET_ACTIVATE(s)    sock_info[(s)].socket_state |= 0x01
#define SOCKET_DEACTIVATE(s)  sock_info[(s)].socket_state = 0
#define SOCKET_ACTIVE(s)      (sock_info[(s)].socket_state & 0x01)
#define CLEAR_SOCKET(s)       { SOCKET_DEACTIVATE(s); }

// Ports
#define DEFAULT_PORT       1500
#define ECHO_PORT          7
#define HTTP_PORT          80
#define SMTP_PORT          25
#define FTP_DATA_PORT      20
#define FTP_CONTROL_PORT   21
#define BOOTP_SERVER_PORT  67
#define BOOTP_CLIENT_PORT  68
#define DHCP_SERVER_PORT   67
#define DHCP_CLIENT_PORT   68
#define TFTP_SERVER_PORT   69
#define DNS_SERVER_PORT    53
#define DNS_CLIENT_PORT    1027

// ARP doesn't use ports but we need a port number to get a socket
#define ARP_PORT           0xFFFF
// PING doesn't use ports but we need a port number to get a socket
#define PING_PORT          0

// socket types
#define  STD_TYPE       0x00
#define  HTTP_TYPE      0x01
#define  FTP_TYPE       0x02
#define  SMTP_TYPE      0x04
#define  TFTP_TYPE      0x08
#define  MULTICAST_TYPE 0x10
#define  S_ARP_TYPE     0x20
#define  AUTO_TYPE      0x40   // for automatically created sockets
#define  INACTIVITY_TIMER  0x80

// open types
#define PASSIVE_OPEN    0
#define ACTIVE_OPEN     1
#define NO_OPEN         2
#define ANSWER_MODE  0
#define DIAL_MODE    1

// Proto Types
#define PROTO_ICMP      1
#define PROTO_IGMP      2
#define PROTO_IP        4
#define PROTO_TCP       6
#define PROTO_UDP       17

// TCP states
#define TCP_CLOSED         0
#define TCP_LISTEN         1
#define TCP_SYN_SENT       2
#define TCP_SYN_RECEIVED   3
#define TCP_ESTABLISHED    4
#define TCP_FIN_WAIT_1     5
#define TCP_FIN_WAIT_2     6
#define TCP_CLOSE_WAIT     7
#define TCP_CLOSING        8
#define TCP_LAST_ACK       9
#define TCP_TIME_WAIT      10

#define ONE_SECOND		100
#define THREE_SECONDS   (3*(ONE_SECOND))
#define THIRTY_SECONDS  (30*(ONE_SECOND))

#if ((60*(ONE_SECOND)) < 65536)
#define SIXTY_SECONDS   (60*(ONE_SECOND))
#else
#define SIXTY_SECONDS   (0xFFFF)
#endif

#ifndef PTR_NULL
#define PTR_NULL     (0x00)
#endif

// Supported Devices
#define C8051F020    0x03
#define C8051F120    0x07
#define C8051F340    0x0F

#endif   // MN_STACKCONST_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -