Mbed library for ENC28J60 Ethernet modules. Full support for TCP/IP and UDP Server, Client and HTTP server (webserver). DHCP and DNS is included.

Dependents:   mBuino_ENC28_MQTT Nucleo_Web_ENC28J60 Nucleo_Web_ENC28J60_ADC Serial_over_Ethernet ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers uip-conf.h Source File

uip-conf.h

00001 /**
00002  * UIPEthernet Project-specific configuration options
00003  * Copyright (c) 2013 Norbert Truchsess <norbert.truchsess@t-online.de>
00004  * @{
00005  *
00006  * UIP has a number of configuration options that can be overridden
00007  * for each project. These are kept in a project-specific uip-conf.h
00008  * file and all configuration names have the prefix UIP_CONF.
00009  */
00010 /*
00011  * Copyright (c) 2006, Swedish Institute of Computer Science.
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without
00015  * modification, are permitted provided that the following conditions
00016  * are met:
00017  * 1. Redistributions of source code must retain the above copyright
00018  *    notice, this list of conditions and the following disclaimer.
00019  * 2. Redistributions in binary form must reproduce the above copyright
00020  *    notice, this list of conditions and the following disclaimer in the
00021  *    documentation and/or other materials provided with the distribution.
00022  * 3. Neither the name of the Institute nor the names of its contributors
00023  *    may be used to endorse or promote products derived from this software
00024  *    without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
00027  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00029  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
00030  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00031  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00032  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00033  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00034  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00035  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00036  * SUCH DAMAGE.
00037  *
00038  * This file is part of the UIP TCP/IP stack
00039  *
00040  */
00041 #ifndef __UIP_CONF_H__
00042 #define __UIP_CONF_H__
00043 
00044 #include <inttypes.h>
00045 #include "uipethernet-conf.h"
00046 
00047 /**
00048  * 8 bit datatype
00049  *
00050  * This typedef defines the 8-bit type used throughout UIP.
00051  *
00052  * \hideinitializer
00053  */
00054 typedef uint8_t         u8_t;
00055 
00056 /**
00057  * 16 bit datatype
00058  *
00059  * This typedef defines the 16-bit type used throughout UIP.
00060  *
00061  * \hideinitializer
00062  */
00063 typedef uint16_t        u16_t;
00064 
00065 /**
00066  * Statistics datatype
00067  *
00068  * This typedef defines the dataype used for keeping statistics in
00069  * UIP.
00070  *
00071  * \hideinitializer
00072  */
00073 typedef unsigned short  uip_stats_t;
00074 
00075 /**
00076  * Maximum number of TCP connections.
00077  * (see uipethernet-conf.h)
00078  * \hideinitializer
00079  *
00080  * #define UIP_CONF_MAX_CONNECTIONS 4
00081  */
00082 
00083 /**
00084  * Maximum number of listening TCP ports.
00085  *
00086  * \hideinitializer
00087  */
00088 #define UIP_CONF_MAX_LISTENPORTS    4
00089 
00090 /**
00091  * UIP buffer size.
00092  *
00093  * \hideinitializer
00094  */
00095 
00096 #define UIP_CONF_BUFFER_SIZE    98
00097 //#define UIP_CONF_BUFFER_SIZE     118
00098 
00099 /**
00100  * The TCP maximum segment size.
00101  *
00102  * This is should not be to set to more than
00103  * UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN.
00104  */
00105 #define UIP_CONF_TCP_MSS    512
00106 
00107 /**
00108  * The size of the advertised receiver's window.
00109  *
00110  * Should be set low (i.e., to the size of the uip_buf buffer) is the
00111  * application is slow to process incoming data, or high (32768 bytes)
00112  * if the application processes data quickly.
00113  *
00114  * \hideinitializer
00115  */
00116 
00117 #define UIP_CONF_RECEIVE_WINDOW 512
00118 
00119 /**
00120  * CPU byte order.
00121  *
00122  * \hideinitializer
00123  */
00124 
00125 #define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
00126 
00127 /**
00128  * Logging on or off
00129  *
00130  * \hideinitializer
00131  */
00132 
00133 #define UIP_CONF_LOGGING    0
00134 
00135 /**
00136  * UDP support on or off
00137  * (see uipethernet-conf.h)
00138  * \hideinitializer
00139  *
00140  * #define UIP_CONF_UDP             1
00141  *
00142  * #define UIP_CONF_UDP_CONNS       4
00143  */
00144 
00145 /**
00146  * UDP checksums on or off
00147  *
00148  * \hideinitializer
00149  */
00150 #define UIP_CONF_UDP_CHECKSUMS  1
00151 
00152 /**
00153  * UDP Broadcast (receive) on or off
00154  * (see uipethernet-conf.h)
00155  * \hideinitializer
00156  * #define UIP_CONF_BROADCAST    1
00157  */
00158 
00159 /**
00160  * UIP statistics on or off
00161  *
00162  * \hideinitializer
00163  */
00164 #define UIP_CONF_STATISTICS 0
00165 //#define UIP_CONF_LLH_LEN 0
00166 typedef void*   uip_tcp_appstate_t;
00167 void            uipclient_appcall(void);
00168 #define UIP_APPCALL uipclient_appcall
00169 typedef void*   uip_udp_appstate_t;
00170 void            uipudp_appcall(void);
00171 #define UIP_UDP_APPCALL uipudp_appcall
00172 #define CC_REGISTER_ARG register
00173 #define UIP_ARCH_CHKSUM 1
00174 #endif /* __UIP_CONF_H__ */