-
Notifications
You must be signed in to change notification settings - Fork 0
/
Platform.h
122 lines (111 loc) · 4.89 KB
/
Platform.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
/*=============================================================================|
| PROJECT SETTIMINO 2.0.0 |
|==============================================================================|
| Copyright (C) 2013, 2019 Davide Nardella |
| All rights reserved. |
|==============================================================================|
| SETTIMINO is free software: you can redistribute it and/or modify |
| it under the terms of the Lesser GNU General Public License as published by |
| the Free Software Foundation, either version 3 of the License, or |
| (at your option) any later version. |
| |
| It means that you can distribute your commercial software linked with |
| SETTIMINO without the requirement to distribute the source code of your |
| application and without the requirement that your application be itself |
| distributed under LGPL. |
| |
| SETTIMINO is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| Lesser GNU General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License and a |
| copy of Lesser GNU General Public License along with Snap7. |
| If not, see http://www.gnu.org/licenses/ |
|------------------------------------------------------------------------------|
| |
| 1.1.0 Added support for ESP8266 (Thanks to Geoffrey Hayward Piggot) |
| 2.0.0 Added new hardware support |
| Added Read/Write consistent bit into the CPU |
| Added new 18 helper functions |
| Small bugfixes (Thanks to Daniel Förstmann and Schöneberg Swen) |
| |
|=============================================================================*/
#ifndef PLATFORM_H
#define PLATFORM_H
//*********************************************************************
// PLATFORM AND MEDIA DEFINITION
//
// Chose your platform and uncomment the related define
// *ONLY* one line must be uncommented
//*********************************************************************
// ARDUINO_LAN
// Arduino UNO R3 + Ethernet Shield R3 or Ethernet Shield 2
// Arduino MEGA 2560 R3 + Ethernet Shield R3 or Ethernet Shield 2
// ESP8266_FAMILY (WiFi)
// NodeMCU
// Wemos
// Lolin V3
// (Other 7 modules based onto ESP8266 chip)
// ESP32_WIFI
// ESP32-WROOM-32 / 32D
// ESP32 DevModule
// M5STACK_WIFI (only core)
// Basic, Gray, Red
// M5STACK_LAN
// Core + LAN MODULE (W5500)
//
//*********************************************************************
// Notes of external libraries needed.
// If you already use that boards, you should have already installed
//*********************************************************************
// ESP8266_FAMILY
// https://github.com/esp8266/Arduino
// ESP32
// https://github.com/espressif/arduino-esp32
// M5STACK (*)
// https://docs.m5stack.com/#/en/quick_start/m5core/m5stack_core_get_started_Arduino_Windows
// https://github.com/m5stack/M5Stack
//
// (*) Need also to install Ethernet2 library to use the LAN MODULE.
// Use the Arduino IDE Library Manager.
//
//*********************************************************************
#define ARDUINO_LAN
//#define ESP8266_FAMILY
//#define ESP32_WIFI
//#define M5STACK_WIFI
//#define M5STACK_LAN
#include <SPI.h>
// Platforms
#ifdef ARDUINO_LAN
#include <Ethernet.h>
#define S7WIRED
#endif
#ifdef ESP8266_FAMILY
#include <ESP8266WiFi.h>
#include <Ethernet.h>
#define S7WIFI
#endif
#ifdef ESP32_WIFI
#include <Ethernet.h>
#include <WiFi.h>
#define S7WIFI
#endif
#ifdef M5STACK_WIFI
#include <M5Stack.h>
#include <Ethernet.h>
#include <WiFi.h>
#define S7WIFI
#endif
#ifdef M5STACK_LAN
#include <M5Stack.h>
#include <Ethernet2.h>
#define S7WIRED
#endif
#ifdef S7WIRED
#include "EthernetClient.h"
#else
#include "WiFiClient.h"
#endif
#endif //PLATFORM_H