This repository has been archived by the owner on Feb 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefines.h
159 lines (130 loc) · 5.36 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/****************************************************************************************************************************
defines.h
For ESP32, ESP8266, Teensy, SAMD, SAM DUE using W5x00 Ethernet shields
BlynkEthernet_WM is a library for Teensy, ESP, SAM DUE and SAMD boards, with Ethernet W5X00 or ENC28J60 shields,
to enable easy configuration/reconfiguration and autoconnect/autoreconnect of Ethernet/Blynk
AVR Mega and W5100 is not supported.
Library modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases
Built by Khoi Hoang https://github.com/khoih-prog/BlynkEthernet_WM
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) )
#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
#endif
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#define DEBUG_ETHERNET_WEBSERVER_PORT Serial
// Debug Level from 0 to 4
#define BLYNK_WM_DEBUG 1
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 2
#define DRD_GENERIC_DEBUG true
// If USE_BUILTIN_ETHERNET == false and USE_UIP_ETHERNET == false =>
// either use W5x00 with EthernetXYZ library
// or ENC28J60 with EthernetENC library
#define USE_BUILTIN_ETHERNET false
#define USE_UIP_ETHERNET false
// 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
#if !(USE_BUILTIN_ETHERNET || USE_UIP_ETHERNET)
// Only one if the following to be true
#define USE_ETHERNET false
#define USE_ETHERNET2 false
#define USE_ETHERNET3 false
#define USE_ETHERNET_LARGE true
#define USE_ETHERNET_ENC false
#define USE_CUSTOM_ETHERNET false
#endif
#if ( USE_ETHERNET2 || USE_ETHERNET3 || USE_ETHERNET_LARGE || USE_ETHERNET_ENC )
#ifdef USE_CUSTOM_ETHERNET
#undef USE_CUSTOM_ETHERNET
#endif
#define USE_CUSTOM_ETHERNET false //true
#endif
#if (USE_BUILTIN_ETHERNET)
#warning Using LAN8742A Ethernet & STM32Ethernet lib
#define SHIELD_TYPE "LAN8742A Ethernet & STM32Ethernet Library"
#elif (USE_UIP_ETHERNET)
#warning Using ENC28J60 & UIPEthernet lib
#define SHIELD_TYPE "ENC28J60 & UIPEthernet Library"
#elif USE_ETHERNET3
//#include "Ethernet3.h"
#warning Using W5x00 & Ethernet3 lib
#define SHIELD_TYPE "W5x00 & Ethernet3 Library"
#elif USE_ETHERNET2
//#include "Ethernet2.h"
#warning Using W5x00 & Ethernet2 lib
#define SHIELD_TYPE "W5x00 & Ethernet2 Library"
#elif USE_ETHERNET_LARGE
//#include "EthernetLarge.h"
#warning Using W5x00 & EthernetLarge lib
#define SHIELD_TYPE "W5x00 & EthernetLarge Library"
#elif USE_ETHERNET_ENC
//#include "EthernetENC.h"
#warning Using ENC28J60 & EthernetENC lib
#define SHIELD_TYPE "ENC28J60 & EthernetENC Library"
#elif USE_CUSTOM_ETHERNET
//#include "Ethernet_XYZ.h"
#include "EthernetENC.h"
#warning Using Custom Ethernet library. You must include a library and initialize.
#define SHIELD_TYPE "Custom Ethernet & Ethernet_XYZ Library"
#else
#define USE_ETHERNET true
//#include "Ethernet.h"
#warning Using Ethernet lib
#define SHIELD_TYPE "W5x00 & Ethernet Library"
#endif
#define BLYNK_NO_YIELD
// Start location in emulated-EEPROM to store config data. Default 0.
// Config data Size currently is 128 bytes w/o chksum, 132 with chksum)
#define EEPROM_START 0
#define USE_BLYNK_WM true
#define USE_SSL false
#if USE_BLYNK_WM
#define USE_DYNAMIC_PARAMETERS true
#if USE_SSL
// Need ArduinoECCX08 and ArduinoBearSSL libraries
// Currently, error not enough memory for many STM32 boards. Don't use
#error SSL not support
#else
#if USE_BUILTIN_ETHERNET
#include <BlynkSTM32BIEthernet_WM.h>
#elif USE_UIP_ETHERNET
#include <BlynkSTM32UIPEthernet_WM.h>
#elif USE_ETHERNET_ENC
#include <BlynkSTM32EthernetENC_WM.h>
#else
#include <BlynkSTM32Ethernet_WM.h>
#endif
#endif
#else //USE_BLYNK_WM
#if USE_BUILTIN_ETHERNET
#include <BlynkSimple_STM32BI_Ethernet.h>
#elif USE_UIP_ETHERNET
#include <BlynkSimpleUIPEthernet.h>
#else
#include <BlynkSimpleEthernet.h>
#endif
#define USE_LOCAL_SERVER true
#if USE_LOCAL_SERVER
char auth[] = "******";
char server[] = "account.duckdns.org";
//char server[] = "192.168.2.112";
#else
char auth[] = "******";
char server[] = "blynk-cloud.com";
#endif
#define BLYNK_HARDWARE_PORT 8080
#endif //USE_BLYNK_WM
#if !(USE_BUILTIN_ETHERNET || USE_UIP_ETHERNET)
#define W5100_CS 10
#define SDCARD_CS 4
#endif
#define BLYNK_HOST_NAME "STM32-Master-Controller"
#endif //defines_h