mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
37 lines
1.3 KiB
C
37 lines
1.3 KiB
C
#pragma once
|
|
#include "hal.h" // Device header: UID_BASE gives the USB serial number
|
|
|
|
// See https://mongoose.ws/docs/getting-started/build-environment/
|
|
#define MG_ARCH MG_ARCH_ARMGCC
|
|
#define MG_TLS MG_TLS_BUILTIN
|
|
#define MG_ENABLE_TCPIP 1
|
|
#define MG_ENABLE_CUSTOM_MILLIS 1
|
|
#define MG_ENABLE_CUSTOM_RANDOM 1
|
|
|
|
#define MG_ENABLE_DRIVER_USB_DWC2 1 // STM32 OTG: the USB-C port
|
|
#define MG_ENABLE_USB_ETHERNET 1 // USB NCM Ethernet interface
|
|
#define MG_ENABLE_USB_SERIAL 1 // USB serial log console
|
|
#define MG_USB_DWC2_BASE USB1_OTG_HS_PERIPH_BASE // OTG_HS
|
|
#define MG_USB_DWC2_ULPI 1 // External ULPI PHY
|
|
|
|
// Filesystem on the on-board 16 MB flash, see main.c
|
|
#define MG_ENABLE_LFS 1
|
|
#define MG_LFS_SIZE (16 * 1024 * 1024) // The whole chip
|
|
#define MG_LFS_FLASH (&mg_flash_spi)
|
|
extern struct mg_flash mg_flash_spi;
|
|
|
|
// Static device address; the driver serves DHCP to the USB host. Remove
|
|
// these to get an address over DHCP instead, e.g. from Internet Sharing
|
|
#define MG_TCPIP_IP MG_IPV4(192, 168, 7, 1)
|
|
#define MG_TCPIP_MASK MG_IPV4(255, 255, 255, 0)
|
|
|
|
#define MG_SET_MAC_ADDRESS(mac) \
|
|
do { \
|
|
mac[0] = 2; \
|
|
mac[1] = 3; \
|
|
mac[2] = 4; \
|
|
mac[3] = 5; \
|
|
mac[4] = 6; \
|
|
mac[5] = 7; \
|
|
} while (0)
|