|
| 1 | +/** |
| 2 | + ****************************************************************************** |
| 3 | + * @file LwIP/LwIP_HTTP_Server_Raw/Inc/lwipopts.h |
| 4 | + * @author MCD Application Team |
| 5 | + * @version V1.5.0 |
| 6 | + * @date 17-February-2017 |
| 7 | + * @brief lwIP Options Configuration. |
| 8 | + ****************************************************************************** |
| 9 | + * @attention |
| 10 | + * |
| 11 | + * <h2><center>© Copyright (c) 2017 STMicroelectronics International N.V. |
| 12 | + * All rights reserved.</center></h2> |
| 13 | + * |
| 14 | + * Redistribution and use in source and binary forms, with or without |
| 15 | + * modification, are permitted, provided that the following conditions are met: |
| 16 | + * |
| 17 | + * 1. Redistribution of source code must retain the above copyright notice, |
| 18 | + * this list of conditions and the following disclaimer. |
| 19 | + * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 20 | + * this list of conditions and the following disclaimer in the documentation |
| 21 | + * and/or other materials provided with the distribution. |
| 22 | + * 3. Neither the name of STMicroelectronics nor the names of other |
| 23 | + * contributors to this software may be used to endorse or promote products |
| 24 | + * derived from this software without specific written permission. |
| 25 | + * 4. This software, including modifications and/or derivative works of this |
| 26 | + * software, must execute solely and exclusively on microcontroller or |
| 27 | + * microprocessor devices manufactured by or for STMicroelectronics. |
| 28 | + * 5. Redistribution and use of this software other than as permitted under |
| 29 | + * this license is void and will automatically terminate your rights under |
| 30 | + * this license. |
| 31 | + * |
| 32 | + * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" |
| 33 | + * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT |
| 34 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 35 | + * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY |
| 36 | + * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT |
| 37 | + * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 38 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 39 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, |
| 40 | + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 41 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 42 | + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| 43 | + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 44 | + * |
| 45 | + ****************************************************************************** |
| 46 | + */ |
| 47 | +#ifndef __LWIPOPTS_H__ |
| 48 | +#define __LWIPOPTS_H__ |
| 49 | + |
| 50 | +/** |
| 51 | + * NO_SYS==1: Provides VERY minimal functionality. Otherwise, |
| 52 | + * use lwIP facilities. |
| 53 | + */ |
| 54 | +#define NO_SYS 1 |
| 55 | + |
| 56 | +/** |
| 57 | + * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain |
| 58 | + * critical regions during buffer allocation, deallocation and memory |
| 59 | + * allocation and deallocation. |
| 60 | + */ |
| 61 | +#define SYS_LIGHTWEIGHT_PROT 0 |
| 62 | + |
| 63 | +/* ---------- Memory options ---------- */ |
| 64 | +/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which |
| 65 | + lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 |
| 66 | + byte alignment -> define MEM_ALIGNMENT to 2. */ |
| 67 | +#define MEM_ALIGNMENT 4 |
| 68 | + |
| 69 | +/* MEM_SIZE: the size of the heap memory. If the application will send |
| 70 | +a lot of data that needs to be copied, this should be set high. */ |
| 71 | +#define MEM_SIZE (10*1024) |
| 72 | + |
| 73 | +/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
| 74 | + sends a lot of data out of ROM (or other static memory), this |
| 75 | + should be set high. */ |
| 76 | +#define MEMP_NUM_PBUF 10 |
| 77 | +/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
| 78 | + per active UDP "connection". */ |
| 79 | +#define MEMP_NUM_UDP_PCB 6 |
| 80 | +/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
| 81 | + connections. */ |
| 82 | +#define MEMP_NUM_TCP_PCB 10 |
| 83 | +/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
| 84 | + connections. */ |
| 85 | +#define MEMP_NUM_TCP_PCB_LISTEN 6 |
| 86 | +/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
| 87 | + segments. */ |
| 88 | +#define MEMP_NUM_TCP_SEG 8 |
| 89 | +/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
| 90 | + timeouts. */ |
| 91 | +#define MEMP_NUM_SYS_TIMEOUT 10 |
| 92 | + |
| 93 | + |
| 94 | +/* ---------- Pbuf options ---------- */ |
| 95 | +/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
| 96 | +#define PBUF_POOL_SIZE 8 |
| 97 | + |
| 98 | +/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
| 99 | +#define PBUF_POOL_BUFSIZE 1524 |
| 100 | + |
| 101 | + |
| 102 | +/* ---------- TCP options ---------- */ |
| 103 | +#define LWIP_TCP 1 |
| 104 | +#define TCP_TTL 255 |
| 105 | + |
| 106 | +/* Controls if TCP should queue segments that arrive out of |
| 107 | + order. Define to 0 if your device is low on memory. */ |
| 108 | +#define TCP_QUEUE_OOSEQ 0 |
| 109 | + |
| 110 | +/* TCP Maximum segment size. */ |
| 111 | +#define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */ |
| 112 | + |
| 113 | +/* TCP sender buffer space (bytes). */ |
| 114 | +#define TCP_SND_BUF (4*TCP_MSS) |
| 115 | + |
| 116 | +/* TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least |
| 117 | + as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. */ |
| 118 | + |
| 119 | +#define TCP_SND_QUEUELEN (2* TCP_SND_BUF/TCP_MSS) |
| 120 | + |
| 121 | +/* TCP receive window. */ |
| 122 | +#define TCP_WND (2*TCP_MSS) |
| 123 | + |
| 124 | + |
| 125 | +/* ---------- ICMP options ---------- */ |
| 126 | +#define LWIP_ICMP 1 |
| 127 | + |
| 128 | + |
| 129 | +/* ---------- DHCP options ---------- */ |
| 130 | +#define LWIP_DHCP 1 |
| 131 | + |
| 132 | +/* ---------- DNS options ---------- */ |
| 133 | +#define LWIP_DNS 1 |
| 134 | + |
| 135 | + |
| 136 | +/* ---------- UDP options ---------- */ |
| 137 | +#define LWIP_UDP 1 |
| 138 | +#define UDP_TTL 255 |
| 139 | + |
| 140 | + |
| 141 | +/* ---------- Statistics options ---------- */ |
| 142 | +#define LWIP_STATS 0 |
| 143 | + |
| 144 | +/* ---------- link callback options ---------- */ |
| 145 | +/* LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface |
| 146 | + * whenever the link changes (i.e., link down) |
| 147 | + */ |
| 148 | +#define LWIP_NETIF_LINK_CALLBACK 1 |
| 149 | + |
| 150 | +/* |
| 151 | + -------------------------------------- |
| 152 | + ---------- Checksum options ---------- |
| 153 | + -------------------------------------- |
| 154 | +*/ |
| 155 | + |
| 156 | +/* |
| 157 | +The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums by hardware: |
| 158 | + - To use this feature let the following define uncommented. |
| 159 | + - To disable it and process by CPU comment the the checksum. |
| 160 | +*/ |
| 161 | +#define CHECKSUM_BY_HARDWARE |
| 162 | + |
| 163 | + |
| 164 | +#ifdef CHECKSUM_BY_HARDWARE |
| 165 | + /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/ |
| 166 | + #define CHECKSUM_GEN_IP 0 |
| 167 | + /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/ |
| 168 | + #define CHECKSUM_GEN_UDP 0 |
| 169 | + /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/ |
| 170 | + #define CHECKSUM_GEN_TCP 0 |
| 171 | + /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/ |
| 172 | + #define CHECKSUM_CHECK_IP 0 |
| 173 | + /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/ |
| 174 | + #define CHECKSUM_CHECK_UDP 0 |
| 175 | + /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/ |
| 176 | + #define CHECKSUM_CHECK_TCP 0 |
| 177 | + /* CHECKSUM_CHECK_ICMP==0: Check checksums by hardware for incoming ICMP packets.*/ |
| 178 | + #define CHECKSUM_GEN_ICMP 0 |
| 179 | +#else |
| 180 | + /* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/ |
| 181 | + #define CHECKSUM_GEN_IP 1 |
| 182 | + /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/ |
| 183 | + #define CHECKSUM_GEN_UDP 1 |
| 184 | + /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/ |
| 185 | + #define CHECKSUM_GEN_TCP 1 |
| 186 | + /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/ |
| 187 | + #define CHECKSUM_CHECK_IP 1 |
| 188 | + /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/ |
| 189 | + #define CHECKSUM_CHECK_UDP 1 |
| 190 | + /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/ |
| 191 | + #define CHECKSUM_CHECK_TCP 1 |
| 192 | + /* CHECKSUM_CHECK_ICMP==1: Check checksums by hardware for incoming ICMP packets.*/ |
| 193 | + #define CHECKSUM_GEN_ICMP 1 |
| 194 | +#endif |
| 195 | + |
| 196 | + |
| 197 | +/* |
| 198 | + ---------------------------------------------- |
| 199 | + ---------- Sequential layer options ---------- |
| 200 | + ---------------------------------------------- |
| 201 | +*/ |
| 202 | +/** |
| 203 | + * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) |
| 204 | + */ |
| 205 | +#define LWIP_NETCONN 0 |
| 206 | + |
| 207 | +/* |
| 208 | + ------------------------------------ |
| 209 | + ---------- Socket options ---------- |
| 210 | + ------------------------------------ |
| 211 | +*/ |
| 212 | +/** |
| 213 | + * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) |
| 214 | + */ |
| 215 | +#define LWIP_SOCKET 0 |
| 216 | + |
| 217 | +/* |
| 218 | + ------------------------------------ |
| 219 | + ---------- httpd options ---------- |
| 220 | + ------------------------------------ |
| 221 | +*/ |
| 222 | + |
| 223 | +/** Set this to 1 to support CGI */ |
| 224 | +#define LWIP_HTTPD_CGI 1 |
| 225 | + |
| 226 | +/** Set this to 1 to support SSI (Server-Side-Includes) */ |
| 227 | +#define LWIP_HTTPD_SSI 1 |
| 228 | + |
| 229 | +/** Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the |
| 230 | + * file system (to prevent changing the file included in CVS) */ |
| 231 | +#define HTTPD_USE_CUSTOM_FSDATA 1 |
| 232 | + |
| 233 | +/* |
| 234 | + ------------------------------------ |
| 235 | + ---------- Custom options ---------- |
| 236 | + ------------------------------------ |
| 237 | +*/ |
| 238 | + |
| 239 | +/** Enables the Ethernet peripheral in RMII mode. If not defined, MII mode will |
| 240 | + be enabled. Pin mapping must be configured for the selected mode |
| 241 | + (see PinMap_Ethernet in PeripheralPins.c). */ |
| 242 | +#define ETHERNET_RMII_MODE_CONFIGURATION 1 |
| 243 | + |
| 244 | +/** Uncomment this line to use the ethernet input in interrupt mode. |
| 245 | + * NOTE: LwIP stack documentation recommends to use the polling mode without |
| 246 | + * an operating system. */ |
| 247 | +//#define ETH_INPUT_USE_IT 1 |
| 248 | + |
| 249 | +#endif /* __LWIPOPTS_H__ */ |
| 250 | + |
| 251 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
0 commit comments