Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.68 KB | None | 0 0
  1.  
  2. /**
  3.   ******************************************************************************
  4.   * @file    LwIP/LwIP_HTTP_Server_Netconn_RTOS/Inc/lwipopts.h
  5.   * @author  MCD Application Team
  6.   * @version V1.0.0
  7.   * @date    25-June-2015
  8.   * @brief   lwIP Options Configuration.
  9.   ******************************************************************************
  10.   * @attention
  11.   *
  12.   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  13.   *
  14.   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15.   * You may not use this file except in compliance with the License.
  16.   * You may obtain a copy of the License at:
  17.   *
  18.   *        http://www.st.com/software_license_agreement_liberty_v2
  19.   *
  20.   * Unless required by applicable law or agreed to in writing, software
  21.   * distributed under the License is distributed on an "AS IS" BASIS,
  22.   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23.   * See the License for the specific language governing permissions and
  24.   * limitations under the License.
  25.   *
  26.   ******************************************************************************
  27.   */
  28.  
  29. #ifndef __LWIPOPTS_H__
  30. #define __LWIPOPTS_H__
  31.  
  32. #include <stm32f4xx_hal.h>
  33. #include <stdio.h>
  34. #include "Networking.h"
  35.  
  36. #define SYS_LIGHTWEIGHT_PROT    0
  37. #define ETHARP_TRUST_IP_MAC     0
  38. #define IP_REASSEMBLY           0
  39. #define IP_FRAG                 0
  40. #define ARP_QUEUEING            0
  41. #define LWIP_COMPAT_MUTEX  1
  42. #define LWIP_COMPAT_MUTEX_ALLOWED
  43. #define NO_SYS                  1
  44.  
  45. /* ---------- Memory options ---------- */
  46. /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
  47.    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
  48.    byte alignment -> define MEM_ALIGNMENT to 2. */
  49. #define MEM_ALIGNMENT           4
  50.  
  51. /* MEM_SIZE: the size of the heap memory. If the application will send
  52. a lot of data that needs to be copied, this should be set high. */
  53. #define MEM_SIZE                (5*1024)
  54.  
  55. /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
  56.    sends a lot of data out of ROM (or other static memory), this
  57.    should be set high. */
  58. #define MEMP_NUM_PBUF           100
  59. /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
  60.    per active UDP "connection". */
  61. #define MEMP_NUM_UDP_PCB        6
  62. /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
  63.    connections. */
  64. #define MEMP_NUM_TCP_PCB        10
  65. /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
  66.    connections. */
  67. #define MEMP_NUM_TCP_PCB_LISTEN 5
  68. /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
  69.    segments. */
  70. #define MEMP_NUM_TCP_SEG        12
  71. /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
  72.    timeouts. */
  73. #define MEMP_NUM_SYS_TIMEOUT    10
  74.  
  75.  
  76. /* ---------- Pbuf options ---------- */
  77. /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
  78. #define PBUF_POOL_SIZE          10
  79.  
  80. /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
  81. #define PBUF_POOL_BUFSIZE       1524
  82.  
  83.  
  84. /* ---------- TCP options ---------- */
  85. #define LWIP_TCP                1
  86. #define TCP_TTL                 255
  87.  
  88. /* Controls if TCP should queue segments that arrive out of
  89.    order. Define to 0 if your device is low on memory. */
  90. #define TCP_QUEUE_OOSEQ         0
  91.  
  92. /* TCP Maximum segment size. */
  93. #define TCP_MSS                 (1500 - 40)   /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */
  94.  
  95. /* TCP sender buffer space (bytes). */
  96. #define TCP_SND_BUF             (4*TCP_MSS)
  97.  
  98. /*  TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
  99.   as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. */
  100.  
  101. #define TCP_SND_QUEUELEN        (2* TCP_SND_BUF/TCP_MSS)
  102. #define TCP_WND                 (2*TCP_MSS)
  103. #define LWIP_ICMP                       1
  104. #define LWIP_DHCP                       1
  105. #define LWIP_UDP                        1
  106. #define UDP_TTL                         255
  107. #define LWIP_STATS                      0
  108. #define LWIP_NETIF_LINK_CALLBACK        0
  109.  
  110. #define LWIP_TIMERS 1
  111.  
  112.  
  113. /*
  114. The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums by hardware:
  115.  - To use this feature let the following define uncommented.
  116.  - To disable it and process by CPU comment the  the checksum.
  117. */
  118. #define CHECKSUM_BY_HARDWARE
  119.  
  120. /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/
  121. #define CHECKSUM_GEN_IP                 0
  122. /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/
  123. #define CHECKSUM_GEN_UDP                0
  124. /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/
  125. #define CHECKSUM_GEN_TCP                0
  126. /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/
  127. #define CHECKSUM_CHECK_IP               0
  128. /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/
  129. #define CHECKSUM_CHECK_UDP              0
  130. /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/
  131. #define CHECKSUM_CHECK_TCP              0
  132. /* CHECKSUM_CHECK_ICMP==0: Check checksums by hardware for incoming ICMP packets.*/  
  133. #define CHECKSUM_GEN_ICMP               0
  134.  
  135.  
  136. #define LWIP_NETCONN                    0
  137. #define LWIP_SOCKET                     0
  138. #define LWIP_DEBUG                      1
  139. #define DHCP_DEBUG LWIP_DBG_ON
  140. #define TCP_DEBUG                       LWIP_DBG_ON
  141. #define ETHARP_DEBUG                    LWIP_DBG_ON
  142. #define PBUF_DEBUG                      LWIP_DBG_ON
  143.  
  144. // SNTP options
  145. #define SNTP_MAX_SERVERS 2
  146.  
  147. #define SNTP_SET_SYSTEM_TIME_US(sec, usec) SetRtcFromNtpTimestamp(sec, usec);
  148. #define SNTP_GET_SYSTEM_TIME(sec, usec)
  149.  
  150.  
  151. #endif /* __LWIPOPTS_H__ */
  152.  
  153. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement