This repository has been archived by the owner on Feb 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
defines.h
112 lines (84 loc) · 3.67 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
/****************************************************************************************************************************
defines.h
For W5x00, LAN8720 and ENC28J60 Ethernet shields.
Ethernet_Manager is a library for nRF52, Teensy, STM32, SAM DUE and SAMD boards, with Ethernet W5x00, LAN8720 or ENC28J60 shields,
to enable easy configuration/reconfiguration of Credentials and autoconnect/autoreconnect of Ethernet.
AVR Mega is not supported.
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef defines_h
#define defines_h
#if ( defined(CORE_TEENSY) )
// Don't support Teensy 2.x, LC
#if defined(ETHERNET_USE_TEENSY)
#undef ETHERNET_USE_TEENSY
#endif
#define ETHERNET_USE_TEENSY true
#define USE_DYNAMIC_PARAMETERS true
#else
#error This code is designed to run on Teensy platform! Please check your Tools->Board setting.
#endif
/* Comment this out to disable prints and save space */
#define DEBUG_ETHERNET_WEBSERVER_PORT Serial
// Debug Level from 0 to 4
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 2
#define _ETHERNET_MANAGER_LOGLEVEL_ 2
#define DRD_GENERIC_DEBUG true
// Default pin 10 to SS/CS
#define USE_THIS_SS_PIN 10
#if ( defined(CORE_TEENSY) && defined(__IMXRT1062__) && defined(ARDUINO_TEENSY41) )
// For Teensy 4.1
#define BOARD_TYPE "TEENSY 4.1"
// Use true for NativeEthernet Library, false if using other Ethernet libraries
#define USE_NATIVE_ETHERNET true
#define USE_QN_ETHERNET false
#else
#error Only Teensy 4.1 supported
#endif
#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif
#define USE_ETHERNET_WRAPPER false
// Use true for ENC28J60 and UIPEthernet library (https://github.com/UIPEthernet/UIPEthernet)
// Use false for W5x00 and Ethernetx library (https://www.arduino.cc/en/Reference/Ethernet)
#define USE_UIP_ETHERNET false
#define USE_ETHERNET_GENERIC false
#define USE_ETHERNET_ENC false
#define USE_CUSTOM_ETHERNET false
#if USE_NATIVE_ETHERNET
#include "NativeEthernet.h"
#warning Using NativeEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error
#define SHIELD_TYPE "using NativeEthernet"
#elif USE_QN_ETHERNET
#include "QNEthernet.h" // https://github.com/ssilverman/QNEthernet
using namespace qindesign::network;
#warning Using QNEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error
#define SHIELD_TYPE "using QNEthernet"
#endif
//////////////////////////////////////////
// EEPROM_START + CONFIG_DATA_SIZE must be <= EEPROM_SIZE
#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
//////////////////////////////////////////
#define USING_DHCP false //true
//#if !USING_DHCP
// Set the static IP address to use if the DHCP fails to assign
IPAddress myIP(192, 168, 2, 222);
IPAddress myNetmask(255, 255, 255, 0);
IPAddress myGW(192, 168, 2, 1);
//IPAddress mydnsServer(192, 168, 2, 1);
IPAddress mydnsServer(8, 8, 8, 8);
//#endif
//////////////////////////////////////////
#include <Ethernet_Manager.h>
#define ETHERNET_HOST_NAME "Teensy-QNEthernet"
#endif //defines_h