This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
defines.h
141 lines (115 loc) · 4.47 KB
/
defines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/****************************************************************************************************************************
defines.h
For W5x00, ENC28J60 and built-in LAN8742A Ethernet shields.
Ethernet_Manager is a library for STM32F/L/H/G/WB/MP1 with Ethernet W5x00, ENC28J60 or built-in LAN8742A shields,
to enable easy configuration/reconfiguration of Credentials and autoconnect/autoreconnect of Ethernet.
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager_STM32
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef defines_h
#define defines_h
#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
defined(STM32WB) || defined(STM32MP1) )
#if defined(ETHERNET_USE_STM32)
#undef ETHERNET_USE_STM32
#endif
#define ETHERNET_USE_STM32 true
#define USE_DYNAMIC_PARAMETERS true
#else
#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
#endif
// To suppress boolean warnings of old libraries
#define boolean bool
/* Comment this out to disable prints and save space */
#define ETHERNET_MANAGER_STM32_DEBUG_PORT Serial
// Debug Level from 0 to 4
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 0
#define _ETHERNET_MANAGER_STM32_LOGLEVEL_ 2
#define DRD_GENERIC_DEBUG true
// To override the default CS/SS pin. Don't use unless you know exactly which pin to use
// You can define here or customize for each board at same place with BOARD_TYPE
//#define USE_THIS_SS_PIN 22 //21 //5 //4 //2 //15
// Default pin 10 to SS/CS. To change according to your board, if necessary
#define USE_THIS_SS_PIN 10
// Only one if the following to be true
#define USE_BUILTIN_ETHERNET true
#define USE_ETHERNET_GENERIC false
#define USE_ETHERNET_ENC false
#define USE_UIP_ETHERNET false
#define USE_CUSTOM_ETHERNET false
#if defined(STM32F0)
#warning STM32F0 board selected
#define BOARD_TYPE "STM32F0"
#elif defined(STM32F1)
#warning STM32F1 board selected
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#warning STM32F2 board selected
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#warning STM32F3 board selected
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#warning STM32F4 board selected
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#warning STM32F7 board selected
#define BOARD_TYPE "STM32F7"
#elif defined(STM32L0)
#warning STM32L0 board selected
#define BOARD_TYPE "STM32L0"
#elif defined(STM32L1)
#warning STM32L1 board selected
#define BOARD_TYPE "STM32L1"
#elif defined(STM32L4)
#warning STM32L4 board selected
#define BOARD_TYPE "STM32L4"
#elif defined(STM32H7)
#warning STM32H7 board selected
#define BOARD_TYPE "STM32H7"
#elif defined(STM32G0)
#warning STM32G0 board selected
#define BOARD_TYPE "STM32G0"
#elif defined(STM32G4)
#warning STM32G4 board selected
#define BOARD_TYPE "STM32G4"
#elif defined(STM32WB)
#warning STM32WB board selected
#define BOARD_TYPE "STM32WB"
#elif defined(STM32MP1)
#warning STM32MP1 board selected
#define BOARD_TYPE "STM32MP1"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif
#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif
//////////////////////////////////////////
#define EEPROM_START 0
/////////////////////////////////////////////
// Add customs headers from v1.2.0
#define USING_CUSTOMS_STYLE true
#define USING_CUSTOMS_HEAD_ELEMENT true
#define USING_CORS_FEATURE true
/////////////////////////////////////////////
// Config Timeout 120s (default 60s)
#define CONFIG_TIMEOUT 120000L
#define USE_DYNAMIC_PARAMETERS true
//////////////////////////////////////////
#include <Ethernet_Manager_STM32.h>
#ifndef SHIELD_TYPE
#define SHIELD_TYPE "Unknown Ethernet shield/library"
#endif
#if USE_ETHERNET_GENERIC
// Change to true if using old Ethernet card with built-in SD
#define ETHERNET_WITH_SD_CARD false
#endif
#if (defined(ETHERNET_WITH_SD_CARD) && ETHERNET_WITH_SD_CARD)
#define W5100_CS 10
#define SDCARD_CS 4
#endif
#define ETHERNET_HOST_NAME "STM32-Ethernet"
#endif //defines_h