Skip to content

Commit dccc153

Browse files
committed
example configs
1 parent db0867f commit dccc153

2 files changed

Lines changed: 103 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#pragma once
2+
3+
// Build environment. Possible options are at https://github.com/cesanta/mongoose/blob/master/src/arch.h
4+
// #define MG_ARCH MG_ARCH_CUSTOM
5+
6+
// Choice of the network stack. By default, use an external BSD-compatible stack
7+
// #define MG_ENABLE_FREERTOS_TCP 0 // Amazon FreeRTOS-TCP
8+
// #define MG_ENABLE_LWIP 0 // lWIP
9+
// #define MG_ENABLE_TCPIP 0 // Mongoose built-in
10+
// #define MG_ENABLE_RL 0 // ARM MDK
11+
// #define MG_ENABLE_POLL 0 // Only for BSD stack. Use poll()
12+
// #define MG_ENABLE_EPOLL 0 // Only for Linux/BSD stack. Use epoll()
13+
// #define MG_ENABLE_WINSOCK 1 // Only for Windows stack. Use Winsock
14+
// #define MG_ENABLE_SOCKET !MG_ENABLE_TCPIP
15+
// #define MG_SOCK_LISTEN_BACKLOG_SIZE 3 // Only for socket-based stacks
16+
17+
// Only for built-in network stack, MG_ENABLE_TCPIP == 1
18+
// #define MG_ENABLE_TCPIP_DRIVER_INIT 1 // enabled built-in driver for
19+
// #define MG_SET_MAC_ADDRESS(mac) // set MAC address for built-in driver
20+
// #define MG_SET_WIFI_CONFIG(data)
21+
// #define MG_ENABLE_TCPIP_PRINT_DEBUG_STATS 0
22+
23+
// Choose a driver for built-in network stack, MG_ENABLE_TCPIP == 1
24+
// #define MG_ENABLE_DRIVER_STM32H 0
25+
// #define MG_ENABLE_DRIVER_STM32F 0
26+
// #define MG_ENABLE_DRIVER_IMXRT 0
27+
// #define MG_ENABLE_DRIVER_CMSIS 0
28+
// #define MG_ENABLE_DRIVER_RA 0
29+
// #define MG_ENABLE_DRIVER_RW612 0
30+
// #define MG_ENABLE_DRIVER_SAME54 0
31+
// #define MG_ENABLE_DRIVER_MCXN 0
32+
// #define MG_ENABLE_DRIVER_TM4C 0
33+
// #define MG_ENABLE_DRIVER_TMS570 0
34+
// #define MG_ENABLE_DRIVER_XMC7 0
35+
// #define MG_ENABLE_DRIVER_XMC 0
36+
37+
// Filesystem support
38+
// #define MG_ENABLE_PACKED_FS 0 // Enable packed filesystem support
39+
// #define MG_ENABLE_FATFS 0 // Enable FATFS support, mg_fs_packed
40+
// #define MG_ENABLE_POSIX_FS 0 // Enable POSIX filesystem support, mg_fs_posix
41+
// #define MG_PATH_MAX 128 // Maximum path length
42+
// #define MG_DIRSEP '/' // Directory separator
43+
44+
// Misc options
45+
// #define MG_ENABLE_LOG 1 // Enable logging
46+
// #define MG_TLS MG_TLS_NONE // MG_TLS_NONE, MG_TLS_MBED, MG_TLS_OPENSSL, MG_TLS_CUSTOM
47+
// #define MG_ENABLE_IPV6 0 // Enable IPv6 support
48+
// #define MG_IPV6_V6ONLY 0 // IPv6 socket binds only to V6, not V4 address
49+
// #define MG_ENABLE_CUSTOM_CALLOC 0 // Set to 1 to let user define mg_calloc() and mg_free()
50+
// #define MG_ENABLE_CUSTOM_RANDOM 0 // Set to 1 to let user define mg_random()
51+
// #define MG_ENABLE_CUSTOM_MILLIS 0 // Set to 1 to let user define mg_millis()
52+
// #define MG_ENABLE_SSI 0 // Enable SSI support
53+
// #define MG_ENABLE_DIRLIST 0 // Enable directory listing
54+
// #define MG_IO_SIZE 512 // Granularity of the send/recv IO buffer growth
55+
// #define MG_MAX_RECV_SIZE (3UL * 1024UL * 1024UL) // Maximum recv IO buffer size
56+
// #define MG_DATA_SIZE 32 // struct mg_connection :: data size
57+
// #define MG_MAX_HTTP_HEADERS 30 // Maximum number of HTTP headers
58+
// #define MG_HTTP_INDEX "index.html" // Default HTTP index file
59+
// #define MG_ENABLE_LINES 0 // Show unamalgamated line numbers
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#pragma once
2+
3+
#define MG_ARCH MG_ARCH_ARMGCC // Generic ARM GCC
4+
#define MG_TLS MG_TLS_BUILTIN // MG_TLS_NONE, MG_TLS_MBED, MG_TLS_OPENSSL
5+
#define MG_ENABLE_TCPIP 1 // Enable built-in TCP/IP stack
6+
7+
// #define MG_ENABLE_DRIVER_STM32F 1
8+
// #define MG_ENABLE_DRIVER_STM32H 1
9+
#error "Choose network driver in mongoose_config.h"
10+
11+
// OTA implementation
12+
// #define MG_OTA_STM32F 1
13+
// #define MG_OTA_STM32H5 1
14+
// #define MG_OTA_STM32H7 1
15+
16+
// IP and MAC configuration
17+
// ------------------------
18+
// For static IP configuration, define MG_TCPIP_{IP,MASK,GW}
19+
// By default, those are set to zero, meaning that DHCP is used
20+
//
21+
// #define MG_TCPIP_IP MG_IPV4(192, 168, 0, 10)
22+
// #define MG_TCPIP_GW MG_IPV4(192, 168, 0, 1)
23+
// #define MG_TCPIP_MASK MG_IPV4(255, 255, 255, 0)
24+
//
25+
// Construct MAC address from UUID
26+
#include "main.h"
27+
#define MGUID ((uint32_t *) UID_BASE) // Unique 96-bit chip ID
28+
#define MG_SET_MAC_ADDRESS(mac) \
29+
do { \
30+
mac[0] = 2; \
31+
mac[1] = MGUID[0] & 255; \
32+
mac[2] = (MGUID[0] >> 10) & 255; \
33+
mac[3] = (MGUID[0] >> 19) & 255; \
34+
mac[4] = MGUID[1] & 255; \
35+
mac[5] = MGUID[2] & 255; \
36+
} while (0)
37+
38+
// #define MG_ENABLE_CUSTOM_CALLOC 1 // Let user define mg_calloc() and mg_free()
39+
// #define MG_ENABLE_CUSTOM_RANDOM 1 // Let user define mg_random()
40+
// #define MG_ENABLE_CUSTOM_MILLIS 1 // Let user define mg_millis()
41+
42+
// Driver options
43+
// #define MG_DRIVER_MDC_CR 4 // RMII MDC clock divider, from 0 to 4
44+
// #define MG_TCPIP_PHY_ADDR 0 // PHY address

0 commit comments

Comments
 (0)