Files
mongoose/tutorials/nxp/rt1060-evkb/minimal/mongoose_config.h
T
2026-09-18 10:07:08 +03:00

44 lines
1.7 KiB
C

#pragma once
// See https://mongoose.ws/documentation/#build-options
#define MG_ARCH MG_ARCH_ARMGCC
#define MG_OTA MG_OTA_RT1060
#define MG_ENABLE_TCPIP 1
#define MG_ENABLE_DRIVER_IMXRT10 1
#define MG_IO_SIZE 256
#define MG_ENABLE_CUSTOM_MILLIS 1
#define MG_ENABLE_CUSTOM_RANDOM 1
#define MG_OTA MG_OTA_RT1060
// #define MG_ENABLE_TCPIP_PRINT_DEBUG_STATS 1
#define MG_TCPIP_PHY_ADDR 2
// #define MG_DRIVER_MDC_CR 24
// For static IP configuration, define MG_TCPIP_{IP,MASK,GW}
// By default, those are set to zero, meaning that DHCP is used
//
// #define MG_TCPIP_IP MG_IPV4(192, 168, 0, 10)
// #define MG_TCPIP_GW MG_IPV4(192, 168, 0, 1)
// #define MG_TCPIP_MASK MG_IPV4(255, 255, 255, 0)
// Set custom MAC address. By default, it is randomly generated
// Using a build-time constant:
// #define MG_SET_MAC_ADDRESS(mac) do { uint8_t buf_[6] = {2,3,4,5,6,7};
// memmove(mac, buf_, sizeof(buf_)); } while (0)
//
// Using custom function:
// extern void my_function(unsigned char *mac);
// #define MG_SET_MAC_ADDRESS(mac) my_function(mac)
#define MG_OCOTP_FUSES ((volatile uint32_t *) 0x401f4410)
#define MG_SET_MAC_ADDRESS(mac) \
do { \
mac[0] = 2; \
mac[1] = (MG_OCOTP_FUSES[0] >> 0) & 255; \
mac[2] = (MG_OCOTP_FUSES[0] >> 10) & 255; \
mac[3] = ((MG_OCOTP_FUSES[0] >> 19) ^ (MG_OCOTP_FUSES[4] >> 19)) & 255; \
mac[4] = (MG_OCOTP_FUSES[4] >> 10) & 255; \
mac[5] = (MG_OCOTP_FUSES[4] >> 0) & 255; \
} while (0)