Commit a73d7a6d093a7ebf1b5f23d53e0f1208f709cc67

Authored by Jeroen88
1 parent 33283daa

Added #if defined() preprocessor directives for the MCU's that can be used with …

…the EasyOpenTherm shield
examples/Basic_Thermostat_Commands/Basic_Thermostat_Commands.ino
... ... @@ -42,9 +42,38 @@
42 42  
43 43 #include <EasyOpenTherm.h>
44 44  
45   -// ESP32-S2
  45 +#if defined(ARDUINO_LOLIN_S2_MINI)
46 46 #define OT_RX_PIN (35)
47 47 #define OT_TX_PIN (33)
  48 +#define DALLAS (11)
  49 +#elif defined(ARDUINO_LOLIN_C3_MINI)
  50 +#define OT_RX_PIN (10)
  51 +#define OT_TX_PIN (8)
  52 +#define DALLAS (4)
  53 +#elif defined(ARDUINO_ESP8266_WEMOS_D1MINIPRO)
  54 +// I can't get my "D1 MINI PRO Based ESP8266EX" passed a WiFi connection
  55 +// D1 is GPIO5
  56 +#define OT_RX_PIN (5)
  57 +// D2 is GPIO4
  58 +#define OT_TX_PIN (4)
  59 +// D7 is GPIO13
  60 +#define DALLAS (13)
  61 +#elif defined(ESP32)
  62 +#define OT_RX_PIN (33)
  63 +#define OT_TX_PIN (16)
  64 +#define DALLAS (17)
  65 +#elif defined(ESP8266)
  66 +// GPIO5 is D1
  67 +#define OT_RX_PIN (5)
  68 +// GPIO4 is D2
  69 +#define OT_TX_PIN (4)
  70 +// D7 is GPIO13
  71 +#define DALLAS (13)
  72 +#else
  73 +#define OT_RX_PIN (35)
  74 +#define OT_TX_PIN (33)
  75 +#define DALLAS (-1)
  76 +#endif
48 77  
49 78 #define CH_SETPOINT (60.0f)
50 79  
... ...
examples/OpenTherm_Show_DATA-IDs/OpenTherm_Show_DATA-IDs.ino
1 1 #include <EasyOpenTherm.h>
2 2  
3   -// ESP32-S2
4   -// GPIO pin used to read data from the boiler or HVAC. Must support interrupts
  3 +#if defined(ARDUINO_LOLIN_S2_MINI)
5 4 #define OT_RX_PIN (35)
6   -// GPIO pin used to send data to the boiier or HVAC. Must not be a 'read only' GPIO
7 5 #define OT_TX_PIN (33)
8   -
9   -
  6 +#define DALLAS (11)
  7 +#elif defined(ARDUINO_LOLIN_C3_MINI)
  8 +#define OT_RX_PIN (10)
  9 +#define OT_TX_PIN (8)
  10 +#define DALLAS (4)
  11 +#elif defined(ARDUINO_ESP8266_WEMOS_D1MINIPRO)
  12 +// D1 is GPIO5
  13 +#define OT_RX_PIN (5)
  14 +// D2 is GPIO4
  15 +#define OT_TX_PIN (4)
  16 +// D7 is GPIO13
  17 +#define DALLAS (13)
  18 +#elif defined(ESP32)
  19 +#define OT_RX_PIN (33)
  20 +#define OT_TX_PIN (16)
  21 +#define DALLAS (17)
  22 +#elif defined(ESP8266)
  23 +// GPIO5 is D1
  24 +#define OT_RX_PIN (5)
  25 +// GPIO4 is D2
  26 +#define OT_TX_PIN (4)
  27 +// D7 is GPIO13
  28 +#define DALLAS (13)
  29 +#else
  30 +#define OT_RX_PIN (35)
  31 +#define OT_TX_PIN (33)
  32 +#define DALLAS (-1)
  33 +#endif
10 34  
11 35 // primaryFlags is used to tell the secondary device (boiler) what available services (Central heating, cooling, domestic hot water) it wants to make use of
12 36 // The meaning of each bit is defined in enum class OpenTherm::STATUS_FLAGS
... ...
examples/Test_Boiler_Communication/Test_Boiler_Communication.ino
... ... @@ -32,9 +32,37 @@
32 32 #include <EasyOpenTherm.h>
33 33  
34 34  
35   -// ESP32-S2
  35 +#if defined(ARDUINO_LOLIN_S2_MINI)
36 36 #define OT_RX_PIN (35)
37 37 #define OT_TX_PIN (33)
  38 +#define DALLAS (11)
  39 +#elif defined(ARDUINO_LOLIN_C3_MINI)
  40 +#define OT_RX_PIN (10)
  41 +#define OT_TX_PIN (8)
  42 +#define DALLAS (4)
  43 +#elif defined(ARDUINO_ESP8266_WEMOS_D1MINIPRO)
  44 +// D1 is GPIO5
  45 +#define OT_RX_PIN (5)
  46 +// D2 is GPIO4
  47 +#define OT_TX_PIN (4)
  48 +// D7 is GPIO13
  49 +#define DALLAS (13)
  50 +#elif defined(ESP32)
  51 +#define OT_RX_PIN (33)
  52 +#define OT_TX_PIN (16)
  53 +#define DALLAS (17)
  54 +#elif defined(ESP8266)
  55 +// GPIO5 is D1
  56 +#define OT_RX_PIN (5)
  57 +// GPIO4 is D2
  58 +#define OT_TX_PIN (4)
  59 +// D7 is GPIO13
  60 +#define DALLAS (13)
  61 +#else
  62 +#define OT_RX_PIN (35)
  63 +#define OT_TX_PIN (33)
  64 +#define DALLAS (-1)
  65 +#endif
38 66  
39 67  
40 68 void setup() {
... ...
examples/Test_HVAC_Communication/Test_HVAC_Communication.ino
... ... @@ -32,9 +32,38 @@
32 32 #include <EasyOpenTherm.h>
33 33  
34 34  
35   -// ESP32-S2
  35 +#if defined(ARDUINO_LOLIN_S2_MINI)
36 36 #define OT_RX_PIN (35)
37 37 #define OT_TX_PIN (33)
  38 +#define DALLAS (11)
  39 +#elif defined(ARDUINO_LOLIN_C3_MINI)
  40 +#define OT_RX_PIN (10)
  41 +#define OT_TX_PIN (8)
  42 +#define DALLAS (4)
  43 +#elif defined(ARDUINO_ESP8266_WEMOS_D1MINIPRO)
  44 +// I can't get my "D1 MINI PRO Based ESP8266EX" passed a WiFi connection
  45 +// D1 is GPIO5
  46 +#define OT_RX_PIN (5)
  47 +// D2 is GPIO4
  48 +#define OT_TX_PIN (4)
  49 +// D7 is GPIO13
  50 +#define DALLAS (13)
  51 +#elif defined(ESP32)
  52 +#define OT_RX_PIN (33)
  53 +#define OT_TX_PIN (16)
  54 +#define DALLAS (17)
  55 +#elif defined(ESP8266)
  56 +// GPIO5 is D1
  57 +#define OT_RX_PIN (5)
  58 +// GPIO4 is D2
  59 +#define OT_TX_PIN (4)
  60 +// D7 is GPIO13
  61 +#define DALLAS (13)
  62 +#else
  63 +#define OT_RX_PIN (35)
  64 +#define OT_TX_PIN (33)
  65 +#define DALLAS (-1)
  66 +#endif
38 67  
39 68  
40 69 void setup() {
... ...