📄 stacktsk.h
字号:
/*********************************************************************
*
* Microchip TCP/IP Stack Definitions
*
*********************************************************************
* FileName: StackTsk.h
* Dependencies: Compiler.h
* Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F
* Complier: Microchip C18 v3.02 or higher
* Microchip C30 v2.01 or higher
* Company: Microchip Technology, Inc.
*
* Software License Agreement
*
* This software is owned by Microchip Technology Inc. ("Microchip")
* and is supplied to you for use exclusively as described in the
* associated software agreement. This software is protected by
* software and other intellectual property laws. Any use in
* violation of the software license may subject the user to criminal
* sanctions as well as civil liability. Copyright 2006 Microchip
* Technology Inc. All rights reserved.
*
* This software is provided "AS IS." MICROCHIP DISCLAIMS ALL
* WARRANTIES, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, NOT LIMITED
* TO MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
* INFRINGEMENT. Microchip shall in no event be liable for special,
* incidental, or consequential damages.
*
*
* Author Date Comment
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Nilesh Rajbharti 8/10/01 Original (Rev 1.0)
* Nilesh Rajbharti 2/9/02 Cleanup
* Nilesh Rajbharti 5/22/02 Rev 2.0 (See version.log for detail)
* Nilesh Rajbharti 8/7/03 Rev 2.21 - TFTP Client addition
* Howard Schlunder 9/30/04 Added MCHP_MAC, MAC_POWER_ON_TEST,
EEPROM_BUFFER_SIZE, USE_LCD
* Howard Schlunder 8/09/06 Removed MCHP_MAC, added STACK_USE_NBNS,
* STACK_USE_DNS, and STACK_USE_GENERIC_TCP_EXAMPLE
********************************************************************/
#ifndef STACK_TSK_H
#define STACK_TSK_H
#include "..\Include\GenericTypeDefs.h"
#include "..\Include\Compiler.h"
/*
* This value is used by TCP to implement timeout actions.
* If SNMP module is in use, this value should be 100 as required
* by SNMP protocol unless main application is providing separate
* tick which 10mS.
*/
#define TICKS_PER_SECOND (100) // 10ms
#if (TICKS_PER_SECOND < 10 || TICKS_PER_SECOND > 255)
#error Invalid TICKS_PER_SECONDS specified.
#endif
/*
* Manually select prescale value to achieve necessary tick period
* for a given clock frequency.
*/
#define TICK_PRESCALE_VALUE (256)
#if (TICK_PRESCALE_VALUE != 2 && \
TICK_PRESCALE_VALUE != 4 && \
TICK_PRESCALE_VALUE != 8 && \
TICK_PRESCALE_VALUE != 16 && \
TICK_PRESCALE_VALUE != 32 && \
TICK_PRESCALE_VALUE != 64 && \
TICK_PRESCALE_VALUE != 128 && \
TICK_PRESCALE_VALUE != 256 )
#error Invalid TICK_PRESCALE_VALUE specified.
#endif
#if defined(WIN32)
#undef TICKS_PER_SECOND
#define TICKS_PER_SECOND (1)
#endif
/*
* This value is specific to the Microchip Ethernet controllers.
* If a different Ethernet controller is used, this define is not
* used. If a Microchip controller is used and a self memory test
* should be done when the MACInit() function is called,
* uncomment this define. The test requires ~512 bytes of
* program memory.
*/
//#define MAC_POWER_ON_TEST
/*
* This value is specific to the Microchip Ethernet controllers.
* If a different Ethernet controller is used, this define is not
* used. Ideally, when MAC_FILTER_BROADCASTS is defined, all
* broadcast packets that are received would be discarded by the
* hardware, except for ARP requests for our IP address. This could
* be accomplished by filtering all broadcasts, but allowing the ARPs
* using the patter match filter. The code for this feature has been
* partially implemented, but it is not complete nor tested, so this
* option should remain unused in this stack version.
*/
//#define MAC_FILTER_BROADCASTS
/*
* SPI Serial EEPROM buffer size. To enhance performance while
* cooperatively sharing the SPI bus with other peripherals, bytes
* read and written to the memory are locally buffered. This
* parameter has no effect if spieeprom.c is not included in the
* project. Legal sizes are 1 to the EEPROM page size.
*/
#define EEPROM_BUFFER_SIZE (12)
/*
* This value is for Microchip 24LC256 - 256kb serial EEPROM
*/
#define EEPROM_CONTROL (0xa0)
/*
* Number of bytes to be reserved before MPFS storage is to start.
*
* These bytes host application configurations such as IP Address,
* MAC Address, and any other required variables.
*
* After making any change to this variable, MPFS.exe must be
* executed with correct block size.
* See MPFS.exe help message by executing MPFS /?
*/
#define MPFS_RESERVE_BLOCK (64)
/*
* Modules to include in this project
* For demo purpose only, each sample project defines one or more
* of following defines in compiler command-line options. (See
* each MPLAB Project Node Properties under "Project->Edit Project" menu.
* In real applcation, user may want to define them here.
*/
#define STACK_USE_ICMP
#define STACK_USE_HTTP_SERVER
//#define STACK_USE_SLIP // Not currently supported
#define STACK_USE_IP_GLEANING
#define STACK_USE_DHCP
//#define STACK_USE_FTP_SERVER
//#define STACK_USE_SNMP_SERVER
//#define STACK_USE_TFTP_CLIENT
//#define STACK_USE_GENERIC_TCP_EXAMPLE // HTTP Client example in GenericTCPExample.c
#define STACK_USE_ANNOUNCE // Microchip Embedded Ethernet Device Discoverer server/client
#define STACK_USE_DNS // Domain Name Service Client
#define STACK_USE_NBNS // NetBIOS Name Service Server
/*
* Following low level modules are automatically enabled/disabled based on high-level
* module selections.
* If you need them with your custom application, enable it here.
*/
//#define STACK_USE_TCP
//#define STACK_USE_UDP
// Uncomment following line if SNMP TRAP support is required
//#define SNMP_TRAP_DISABED
/*
* When SLIP is used, DHCP is not supported.
*/
#if defined(STACK_USE_SLIP)
#undef STACK_USE_DHCP
#endif
/*
* When MPFS_USE_PGRM is used, FTP is not supported.
*/
#if defined(MPFS_USE_PGRM)
#undef STACK_USE_FTP_SERVER
#endif
/*
* Comment following line if StackTsk should wait for acknowledgement
* from remote host before transmitting another packet.
* Commenting following line may reduce throughput.
*/
//#define TCP_NO_WAIT_FOR_ACK
/*
* Uncomment following line if this stack will be used in CLIENT
* mode. In CLIENT mode, some functions specific to client operation
* are enabled.
*/
//#define STACK_CLIENT_MODE
/*
* If html pages are stored in internal program memory,
* uncomment MPFS_USE_PRGM and comment MPFS_USE_EEPROM
* If html pages are stored in external eeprom memory,
* comment MPFS_USE_PRGM and uncomment MPFS_USE_EEPROM
*/
//#define MPFS_USE_PGRM
//#define MPFS_USE_EEPROM
#if defined(MPFS_USE_PGRM) && defined(MPFS_USE_EEPROM)
#error Invalid MPFS Storage option specified.
#endif
#if !defined(MPFS_USE_PGRM) && !defined(MPFS_USE_EEPROM)
#error You have not specified MPFS storage option.
#endif
/*
* When HTTP is enabled, TCP must be enabled.
*/
#if defined(STACK_USE_HTTP_SERVER)
#if !defined(STACK_USE_TCP)
#define STACK_USE_TCP
#endif
#endif
/*
* When FTP is enabled, TCP must be enabled.
*/
#if defined(STACK_USE_FTP_SERVER)
#if !defined(STACK_USE_TCP)
#define STACK_USE_TCP
#endif
#endif
#if (defined(STACK_USE_FTP_SERVER) || \
defined(STACK_USE_SNMP_SERVER) || \
defined(STACK_USE_DNS) || \
defined(STACK_USE_GENERIC_TCP_EXAMPLE) || \
defined(STACK_USE_TFTP_CLIENT) )
#if !defined(STACK_CLIENT_MODE)
#define STACK_CLIENT_MODE
#endif
#endif
/*
* When DHCP is enabled, UDP must also be enabled.
*/
#if defined(STACK_USE_DHCP) || \
defined(STACK_USE_DNS) || \
defined(STACK_USE_NBNS) || \
defined(STACK_USE_SNMP_SERVER) || \
defined(STACK_USE_TFTP_CLIENT) || \
defined(STACK_USE_ANNOUNCE)
#if !defined(STACK_USE_UDP)
#define STACK_USE_UDP
#endif
#endif
/*
* When IP Gleaning is enabled, ICMP must also be enabled.
*/
#if defined(STACK_USE_IP_GLEANING)
#if !defined(STACK_USE_ICMP)
#define STACK_USE_ICMP
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -