diff --git a/_weather_sensor_cfg_8h_source.html b/_weather_sensor_cfg_8h_source.html index 7e681d1..5731642 100644 --- a/_weather_sensor_cfg_8h_source.html +++ b/_weather_sensor_cfg_8h_source.html @@ -149,492 +149,493 @@
62 // 20240507 Renamed NUM_SENSORS to MAX_SENSORS_DEFAULT
63 // NOTE: ARDUINO_ARCH_AVR no longer supported due to code size!!!
64 // 20240508 Updated board definitions after changes in arduino-esp32 v3.0.0
-
65 //
-
66 // ToDo:
-
67 // -
-
68 //
-
70 
-
71 #if !defined(WEATHER_SENSOR_CFG_H)
-
72 #define WEATHER_SENSOR_CFG_H
-
73 
-
74 #include <Arduino.h>
-
75 
-
76 // ------------------------------------------------------------------------------------------------
-
77 // --- Weather Sensors ---
-
78 // ------------------------------------------------------------------------------------------------
-
79 #define MAX_SENSORS_DEFAULT 1 // Maximum number of sensors to be received
-
80 
-
81 // List of sensor IDs to be excluded - can be empty
-
82 #define SENSOR_IDS_EXC { 0x792882A2 }
-
83 //#define SENSOR_IDS_EXC { 0x792882A2 }
-
84 
-
85 // List of sensor IDs to be included - if empty, handle all available sensors
-
86 #define SENSOR_IDS_INC { }
-
87 //#define SENSOR_IDS_INC { 0x83750871 }
-
88 
-
89 // Disable data type which will not be used to save RAM
-
90 #define WIND_DATA_FLOATINGPOINT
-
91 #define WIND_DATA_FIXEDPOINT
-
92 
-
93 // Select appropriate sensor message format(s)
-
94 // Comment out unused decoders to save operation time/power
-
95 #define BRESSER_5_IN_1
-
96 #define BRESSER_6_IN_1
-
97 #define BRESSER_7_IN_1
-
98 #define BRESSER_LIGHTNING
-
99 #define BRESSER_LEAKAGE
-
100 
+
65 // 20240509 Fixed ARDUINO_HELTEC_WIRELESS_STICK_V3
+
66 //
+
67 // ToDo:
+
68 // -
+
69 //
+
71 
+
72 #if !defined(WEATHER_SENSOR_CFG_H)
+
73 #define WEATHER_SENSOR_CFG_H
+
74 
+
75 #include <Arduino.h>
+
76 
+
77 // ------------------------------------------------------------------------------------------------
+
78 // --- Weather Sensors ---
+
79 // ------------------------------------------------------------------------------------------------
+
80 #define MAX_SENSORS_DEFAULT 1 // Maximum number of sensors to be received
+
81 
+
82 // List of sensor IDs to be excluded - can be empty
+
83 #define SENSOR_IDS_EXC { 0x792882A2 }
+
84 //#define SENSOR_IDS_EXC { 0x792882A2 }
+
85 
+
86 // List of sensor IDs to be included - if empty, handle all available sensors
+
87 #define SENSOR_IDS_INC { }
+
88 //#define SENSOR_IDS_INC { 0x83750871 }
+
89 
+
90 // Disable data type which will not be used to save RAM
+
91 #define WIND_DATA_FLOATINGPOINT
+
92 #define WIND_DATA_FIXEDPOINT
+
93 
+
94 // Select appropriate sensor message format(s)
+
95 // Comment out unused decoders to save operation time/power
+
96 #define BRESSER_5_IN_1
+
97 #define BRESSER_6_IN_1
+
98 #define BRESSER_7_IN_1
+
99 #define BRESSER_LIGHTNING
+
100 #define BRESSER_LEAKAGE
101 
-
102 // ------------------------------------------------------------------------------------------------
-
103 // --- Rain Gauge / Lightning sensor data retention during deep sleep ---
-
104 // ------------------------------------------------------------------------------------------------
-
105 
-
106 #if !defined(INSIDE_UNITTEST)
-
107  #if defined(ESP32)
-
108  // Option: Comment out to save data in RTC RAM
-
109  // N.B.:
-
110  // ESP8266 has RTC RAM, too, but access is different from ESP32
-
111  // and currently not implemented here
-
112  #define RAINGAUGE_USE_PREFS
-
113  #define LIGHTNING_USE_PREFS
-
114  #else
-
115  // Using Preferences is mandatory on other architectures (e.g. RP2040)
-
116  #define RAINGAUGE_USE_PREFS
-
117  #define LIGHTNING_USE_PREFS
-
118  #endif
-
119 #endif
-
120 
-
121 // ------------------------------------------------------------------------------------------------
-
122 // --- Board ---
-
123 // ------------------------------------------------------------------------------------------------
-
124 
-
125 // LILIGO TTGO LoRaP32 board with integrated RF tranceiver (SX1276)
-
126 // See pin definitions in
-
127 // https://github.com/espressif/arduino-esp32/tree/master/variants/ttgo-lora32-*
-
128 // and
-
129 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-2/11973
-
130 
-
131 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V1 (No TFCard)"
-
132 // in the Arduino IDE:
-
133 //#define ARDUINO_TTGO_LoRa32_V1
-
134 
-
135 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2"
-
136 // in the Arduino IDE:
-
137 //#define ARDUINO_TTGO_LoRa32_V2
-
138 
-
139 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2.1 (1.6.1)"
-
140 // in the Arduino IDE:
-
141 //#define ARDUINO_TTGO_LoRa32_V21new
-
142 
-
143 // This define is set by selecting "Board: Heltec Wireless Stick" (SX1276) in the Arduino IDE:
-
144 //#define ARDUINO_HELTEC_WIRELESS_STICK
-
145 
-
146 // This define is set by selecting "Board: Heltec Wireless Stick(V3)" (SX1262) in the Arduino IDE:
-
147 //#define ARDUINO_HELTEC_WIRELESS_STICK_V3
-
148 
-
149 // This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)" in the Arduino IDE:
-
150 //#define ARDUINO_HELTEC_WIFI_LORA_32_V2
-
151 
-
152 // Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
-
153 // https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
-
154 //
-
155 // This define is set by selecting "Adafruit Feather ESP32-S2" in the Arduino IDE:
-
156 //#define ARDUINO_ADAFRUIT_FEATHER_ESP32S2
-
157 
-
158 // Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
-
159 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
-
160 //
-
161 // This define is set by selecting "Adafruit ESP32 Feather" in the Arduino IDE:
-
162 //#define ARDUINO_FEATHER_ESP32
-
163 
-
164 // Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
-
165 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
-
166 //
-
167 // This define is set by selecting "Adafruit Feather RP2040" in the Arduino IDE:
-
168 //#define ARDUINO_ADAFRUIT_FEATHER_RP2040
-
169 
-
170 // DFRobot Firebeetle32
-
171 // https://github.com/espressif/arduino-esp32/tree/master/variants/firebeetle32/pins_arduino.h
-
172 //
-
173 // This define is set by selecting "FireBeetle-ESP32" in the Arduino IDE:
-
174 //#define ARDUINO_DFROBOT_FIREBEETLE_ESP32
-
175 
-
176 // M5Stack Core2
-
177 // https://github.com/espressif/arduino-esp32/blob/master/variants/m5stack_core2/pins_arduino.h
-
178 //
-
179 // This define is set by selecting "M5Core2" in the Arduino IDE
-
180 //#define ARDUINO_M5STACK_CORE2
-
181 
-
182 #if defined(ARDUINO_TTGO_LoRa32_V1)
-
183  #pragma message("ARDUINO_TTGO_LoRa32_V1 defined; using on-board transceiver")
-
184  #define USE_SX1276
-
185 
-
186 #elif defined(ARDUINO_TTGO_LoRa32_V2)
-
187  #pragma message("ARDUINO_TTGO_LoRa32_V2 defined; using on-board transceiver")
-
188  #pragma message("Wiring required for LMIC: DIO1 to GPIO33")
-
189  #define USE_SX1276
-
190 
-
191 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
-
192  #pragma message("ARDUINO_TTGO_LoRa32_V21new defined; using on-board transceiver")
-
193  #define USE_SX1276
-
194 
-
195 #elif defined(ARDUINO_HELTEC_WIRELESS_STICK)
-
196  #pragma message("ARDUINO_HELTEC_WIRELESS_STICK defined; using on-board transceiver")
-
197  #define USE_SX1276 // Heltec Wireless Stick V2
-
198 
-
199 #elif defined(ARDUINO_HELTEC_WIRELESS_STICK_V3)
-
200  #pragma message("ARDUINO_HELTEC_WIRELESS_STICK_V3 defined; using on-board transceiver")
-
201  #define USE_SX1262
-
202 
-
203 #elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
-
204  #pragma message("ARDUINO_HELTEC_WIFI_LORA_32_V2 defined; using on-board transceiver")
-
205  #define USE_SX1276
-
206 
-
207 #elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
-
208  #pragma message("ARDUINO_HELTEC_WIFI_LORA_32_V3 (or similar) defined; using on-board transceiver")
-
209  #define USE_SX1262
-
210 
-
211 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
-
212  #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
-
213  #define USE_SX1276
-
214 
-
215 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
-
216  #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32_V2 defined; assuming RFM95W FeatherWing will be used")
-
217  #define USE_SX1276
-
218  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
-
219 
-
220 #elif defined(ARDUINO_FEATHER_ESP32) || defined(ARDUINO_THINGPULSE_EPULSE_FEATHER)
-
221  #pragma message("ARDUINO_FEATHER_ESP32/ARDUINO_THINGPULSE_EPULSE_FEATHER defined; assuming RFM95W FeatherWing will be used")
-
222  #define USE_SX1276
-
223  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
-
224 
-
225 #elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
-
226  // Note: Depending on board package file date, either variant is used -
-
227  // see https://github.com/espressif/arduino-esp32/issues/9423!
-
228  #pragma message("ARDUINO_M5STACK_CORE2 defined; assuming M5Stack Module LoRa868 will be used")
-
229  #define USE_SX1276
-
230  #pragma message("Wiring required for LMIC: DIO1 to GPIO35")
-
231 
-
232 #elif defined(ARDUINO_ESP32S3_POWERFEATHER)
-
233  #pragma message("ARDUINO_ESP32S3_POWERFEATHER defined; assuming RFM95W FeatherWing will be used")
-
234  #define USE_SX1276
-
235  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
-
236 
-
237 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
-
238  #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming RFM95W FeatherWing will be used")
-
239  #define USE_SX1276
-
240  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
-
241 
-
242 #elif defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32)
-
243  //#define LORAWAN_NODE
-
244  #define DFROBOT_COVER_LORA
-
245 
-
246  #if defined(DFROBOT_COVER_LORA)
-
247  #pragma message("ARDUINO_DFROBOT_FIREBEETLE_ESP32 & DFROBOT_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
-
248  #define USE_SX1276
-
249  #pragma message("Required wiring: D2 to RESET, D3 to DIO0, D4 to CS, D5 to DIO1")
-
250 
-
251  #elif defined(LORAWAN_NODE)
-
252  #pragma message("ARDUINO_DFROBOT_FIREBEETLE_ESP32 & LORAWAN_NODE defined; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
-
253  #define USE_SX1276
-
254 
-
255  #else
-
256  #pragma message("ARDUINO_DFROBOT_FIREBEETLE_ESP32 defined; if you use one of those boards, select either LORAWAN_NODE or FIREBEETLE_ESP32_COVER_LORA manually!")
-
257 
-
258  #endif
-
259 #endif
-
260 
+
102 
+
103 // ------------------------------------------------------------------------------------------------
+
104 // --- Rain Gauge / Lightning sensor data retention during deep sleep ---
+
105 // ------------------------------------------------------------------------------------------------
+
106 
+
107 #if !defined(INSIDE_UNITTEST)
+
108  #if defined(ESP32)
+
109  // Option: Comment out to save data in RTC RAM
+
110  // N.B.:
+
111  // ESP8266 has RTC RAM, too, but access is different from ESP32
+
112  // and currently not implemented here
+
113  #define RAINGAUGE_USE_PREFS
+
114  #define LIGHTNING_USE_PREFS
+
115  #else
+
116  // Using Preferences is mandatory on other architectures (e.g. RP2040)
+
117  #define RAINGAUGE_USE_PREFS
+
118  #define LIGHTNING_USE_PREFS
+
119  #endif
+
120 #endif
+
121 
+
122 // ------------------------------------------------------------------------------------------------
+
123 // --- Board ---
+
124 // ------------------------------------------------------------------------------------------------
+
125 
+
126 // LILIGO TTGO LoRaP32 board with integrated RF tranceiver (SX1276)
+
127 // See pin definitions in
+
128 // https://github.com/espressif/arduino-esp32/tree/master/variants/ttgo-lora32-*
+
129 // and
+
130 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-2/11973
+
131 
+
132 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V1 (No TFCard)"
+
133 // in the Arduino IDE:
+
134 //#define ARDUINO_TTGO_LoRa32_V1
+
135 
+
136 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2"
+
137 // in the Arduino IDE:
+
138 //#define ARDUINO_TTGO_LoRa32_V2
+
139 
+
140 // This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2.1 (1.6.1)"
+
141 // in the Arduino IDE:
+
142 //#define ARDUINO_TTGO_LoRa32_V21new
+
143 
+
144 // This define is set by selecting "Board: Heltec Wireless Stick" (SX1276) in the Arduino IDE:
+
145 //#define ARDUINO_HELTEC_WIRELESS_STICK
+
146 
+
147 // This define is set by selecting "Board: Heltec Wireless Stick(V3)" (SX1262) in the Arduino IDE:
+
148 //#define ARDUINO_HELTEC_WIRELESS_STICK_V3
+
149 
+
150 // This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)" in the Arduino IDE:
+
151 //#define ARDUINO_HELTEC_WIFI_LORA_32_V2
+
152 
+
153 // Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
+
154 // https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
+
155 //
+
156 // This define is set by selecting "Adafruit Feather ESP32-S2" in the Arduino IDE:
+
157 //#define ARDUINO_ADAFRUIT_FEATHER_ESP32S2
+
158 
+
159 // Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
+
160 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
+
161 //
+
162 // This define is set by selecting "Adafruit ESP32 Feather" in the Arduino IDE:
+
163 //#define ARDUINO_FEATHER_ESP32
+
164 
+
165 // Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
+
166 // https://github.com/espressif/arduino-esp32/blob/master/variants/feather_esp32/pins_arduino.h
+
167 //
+
168 // This define is set by selecting "Adafruit Feather RP2040" in the Arduino IDE:
+
169 //#define ARDUINO_ADAFRUIT_FEATHER_RP2040
+
170 
+
171 // DFRobot Firebeetle32
+
172 // https://github.com/espressif/arduino-esp32/tree/master/variants/firebeetle32/pins_arduino.h
+
173 //
+
174 // This define is set by selecting "FireBeetle-ESP32" in the Arduino IDE:
+
175 //#define ARDUINO_DFROBOT_FIREBEETLE_ESP32
+
176 
+
177 // M5Stack Core2
+
178 // https://github.com/espressif/arduino-esp32/blob/master/variants/m5stack_core2/pins_arduino.h
+
179 //
+
180 // This define is set by selecting "M5Core2" in the Arduino IDE
+
181 //#define ARDUINO_M5STACK_CORE2
+
182 
+
183 #if defined(ARDUINO_TTGO_LoRa32_V1)
+
184  #pragma message("ARDUINO_TTGO_LoRa32_V1 defined; using on-board transceiver")
+
185  #define USE_SX1276
+
186 
+
187 #elif defined(ARDUINO_TTGO_LoRa32_V2)
+
188  #pragma message("ARDUINO_TTGO_LoRa32_V2 defined; using on-board transceiver")
+
189  #pragma message("Wiring required for LMIC: DIO1 to GPIO33")
+
190  #define USE_SX1276
+
191 
+
192 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
+
193  #pragma message("ARDUINO_TTGO_LoRa32_V21new defined; using on-board transceiver")
+
194  #define USE_SX1276
+
195 
+
196 #elif defined(ARDUINO_HELTEC_WIRELESS_STICK)
+
197  #pragma message("ARDUINO_HELTEC_WIRELESS_STICK defined; using on-board transceiver")
+
198  #define USE_SX1276 // Heltec Wireless Stick V2
+
199 
+
200 #elif defined(ARDUINO_HELTEC_WIRELESS_STICK_V3)
+
201  #pragma message("ARDUINO_HELTEC_WIRELESS_STICK_V3 defined; using on-board transceiver")
+
202  #define USE_SX1262
+
203 
+
204 #elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
+
205  #pragma message("ARDUINO_HELTEC_WIFI_LORA_32_V2 defined; using on-board transceiver")
+
206  #define USE_SX1276
+
207 
+
208 #elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
+
209  #pragma message("ARDUINO_HELTEC_WIFI_LORA_32_V3 (or similar) defined; using on-board transceiver")
+
210  #define USE_SX1262
+
211 
+
212 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
+
213  #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
+
214  #define USE_SX1276
+
215 
+
216 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
+
217  #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32_V2 defined; assuming RFM95W FeatherWing will be used")
+
218  #define USE_SX1276
+
219  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
+
220 
+
221 #elif defined(ARDUINO_FEATHER_ESP32) || defined(ARDUINO_THINGPULSE_EPULSE_FEATHER)
+
222  #pragma message("ARDUINO_FEATHER_ESP32/ARDUINO_THINGPULSE_EPULSE_FEATHER defined; assuming RFM95W FeatherWing will be used")
+
223  #define USE_SX1276
+
224  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
+
225 
+
226 #elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
+
227  // Note: Depending on board package file date, either variant is used -
+
228  // see https://github.com/espressif/arduino-esp32/issues/9423!
+
229  #pragma message("ARDUINO_M5STACK_CORE2 defined; assuming M5Stack Module LoRa868 will be used")
+
230  #define USE_SX1276
+
231  #pragma message("Wiring required for LMIC: DIO1 to GPIO35")
+
232 
+
233 #elif defined(ARDUINO_ESP32S3_POWERFEATHER)
+
234  #pragma message("ARDUINO_ESP32S3_POWERFEATHER defined; assuming RFM95W FeatherWing will be used")
+
235  #define USE_SX1276
+
236  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
+
237 
+
238 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
+
239  #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming RFM95W FeatherWing will be used")
+
240  #define USE_SX1276
+
241  #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
+
242 
+
243 #elif defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32)
+
244  //#define LORAWAN_NODE
+
245  #define DFROBOT_COVER_LORA
+
246 
+
247  #if defined(DFROBOT_COVER_LORA)
+
248  #pragma message("ARDUINO_DFROBOT_FIREBEETLE_ESP32 & DFROBOT_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
+
249  #define USE_SX1276
+
250  #pragma message("Required wiring: D2 to RESET, D3 to DIO0, D4 to CS, D5 to DIO1")
+
251 
+
252  #elif defined(LORAWAN_NODE)
+
253  #pragma message("ARDUINO_DFROBOT_FIREBEETLE_ESP32 & LORAWAN_NODE defined; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
+
254  #define USE_SX1276
+
255 
+
256  #else
+
257  #pragma message("ARDUINO_DFROBOT_FIREBEETLE_ESP32 defined; if you use one of those boards, select either LORAWAN_NODE or FIREBEETLE_ESP32_COVER_LORA manually!")
+
258 
+
259  #endif
+
260 #endif
261 
-
262 // ------------------------------------------------------------------------------------------------
-
263 // --- Radio Transceiver ---
-
264 // ------------------------------------------------------------------------------------------------
-
265 // Select type of receiver module (if not yet defined based on the assumptions above)
-
266 #if ( !defined(USE_CC1101) && !defined(USE_SX1276) && !defined(USE_SX1262) )
-
267  //#define USE_CC1101
-
268  #define USE_SX1276
-
269  //#define USE_SX1262
-
270 #endif
-
271 
+
262 
+
263 // ------------------------------------------------------------------------------------------------
+
264 // --- Radio Transceiver ---
+
265 // ------------------------------------------------------------------------------------------------
+
266 // Select type of receiver module (if not yet defined based on the assumptions above)
+
267 #if ( !defined(USE_CC1101) && !defined(USE_SX1276) && !defined(USE_SX1262) )
+
268  //#define USE_CC1101
+
269  #define USE_SX1276
+
270  //#define USE_SX1262
+
271 #endif
272 
-
273 // ------------------------------------------------------------------------------------------------
-
274 // --- Debug Logging Output ---
-
275 // ------------------------------------------------------------------------------------------------
-
276 // - ESP32:
-
277 // CORE_DEBUG_LEVEL is set in Adruino IDE:
-
278 // Tools->Core Debug Level: "<None>|<Error>|<Warning>|<Info>|<Debug>|<Verbose>"
-
279 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
-
280 //
-
281 // - ESP8266:
-
282 // DEBUG_ESP_PORT is set in Arduino IDE:
-
283 // Tools->Debug port: "<None>|<Serial>|<Serial1>"
-
284 //
-
285 // - RP2040:
-
286 // DEBUG_RP2040_PORT is set in Arduino IDE:
-
287 // Tools->Debug port: "<Disabled>|<Serial>|<Serial1>|<Serial2>"
-
288 //
-
289 // Replacement for
-
290 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
-
291 // on ESP8266 and RP2040:
-
292 #if defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)
-
293  #define ARDUHAL_LOG_LEVEL_NONE 0
-
294  #define ARDUHAL_LOG_LEVEL_ERROR 1
-
295  #define ARDUHAL_LOG_LEVEL_WARN 2
-
296  #define ARDUHAL_LOG_LEVEL_INFO 3
-
297  #define ARDUHAL_LOG_LEVEL_DEBUG 4
-
298  #define ARDUHAL_LOG_LEVEL_VERBOSE 5
-
299 
-
300  #if defined(ARDUINO_ARCH_RP2040) && defined(DEBUG_RP2040_PORT)
-
301  #define DEBUG_PORT DEBUG_RP2040_PORT
-
302  #elif defined(DEBUG_ESP_PORT)
-
303  #define DEBUG_PORT DEBUG_ESP_PORT
-
304  #endif
-
305 
-
306  // Set desired level here!
-
307  #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
-
308 
-
309  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
-
310  #define log_e(...) { DEBUG_PORT.printf("%s(), l.%d: ",__func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
311  #else
-
312  #define log_e(...) {}
-
313  #endif
-
314  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
-
315  #define log_w(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
316  #else
-
317  #define log_w(...) {}
-
318  #endif
-
319  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
-
320  #define log_i(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
321  #else
-
322  #define log_i(...) {}
-
323  #endif
-
324  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
-
325  #define log_d(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
326  #else
-
327  #define log_d(...) {}
-
328  #endif
-
329  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
-
330  #define log_v(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
-
331  #else
-
332  #define log_v(...) {}
-
333  #endif
-
334 
-
335 #endif
-
336 
-
337 #if ( (defined(USE_CC1101) && defined(USE_SX1276)) || \
-
338  (defined(USE_SX1276) && defined(USE_SX1262)) || \
-
339  (defined(USE_SX1262) && defined(USE_CC1101)) )
-
340  #error "Either USE_CC1101 OR USE_SX1276 OR USE_SX1262 must be defined!"
-
341 #endif
-
342 
-
343 #if defined(USE_CC1101)
-
344  #define RECEIVER_CHIP "[CC1101]"
-
345 #elif defined(USE_SX1276)
-
346  #define RECEIVER_CHIP "[SX1276]"
-
347 #elif defined(USE_SX1262)
-
348  #define RECEIVER_CHIP "[SX1262]"
-
349 #else
-
350  #error "Either USE_CC1101, USE_SX1276 or USE_SX1262 must be defined!"
-
351 #endif
-
352 
+
273 
+
274 // ------------------------------------------------------------------------------------------------
+
275 // --- Debug Logging Output ---
+
276 // ------------------------------------------------------------------------------------------------
+
277 // - ESP32:
+
278 // CORE_DEBUG_LEVEL is set in Adruino IDE:
+
279 // Tools->Core Debug Level: "<None>|<Error>|<Warning>|<Info>|<Debug>|<Verbose>"
+
280 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
+
281 //
+
282 // - ESP8266:
+
283 // DEBUG_ESP_PORT is set in Arduino IDE:
+
284 // Tools->Debug port: "<None>|<Serial>|<Serial1>"
+
285 //
+
286 // - RP2040:
+
287 // DEBUG_RP2040_PORT is set in Arduino IDE:
+
288 // Tools->Debug port: "<Disabled>|<Serial>|<Serial1>|<Serial2>"
+
289 //
+
290 // Replacement for
+
291 // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
+
292 // on ESP8266 and RP2040:
+
293 #if defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)
+
294  #define ARDUHAL_LOG_LEVEL_NONE 0
+
295  #define ARDUHAL_LOG_LEVEL_ERROR 1
+
296  #define ARDUHAL_LOG_LEVEL_WARN 2
+
297  #define ARDUHAL_LOG_LEVEL_INFO 3
+
298  #define ARDUHAL_LOG_LEVEL_DEBUG 4
+
299  #define ARDUHAL_LOG_LEVEL_VERBOSE 5
+
300 
+
301  #if defined(ARDUINO_ARCH_RP2040) && defined(DEBUG_RP2040_PORT)
+
302  #define DEBUG_PORT DEBUG_RP2040_PORT
+
303  #elif defined(DEBUG_ESP_PORT)
+
304  #define DEBUG_PORT DEBUG_ESP_PORT
+
305  #endif
+
306 
+
307  // Set desired level here!
+
308  #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO
+
309 
+
310  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE
+
311  #define log_e(...) { DEBUG_PORT.printf("%s(), l.%d: ",__func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
312  #else
+
313  #define log_e(...) {}
+
314  #endif
+
315  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR
+
316  #define log_w(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
317  #else
+
318  #define log_w(...) {}
+
319  #endif
+
320  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN
+
321  #define log_i(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
322  #else
+
323  #define log_i(...) {}
+
324  #endif
+
325  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO
+
326  #define log_d(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
327  #else
+
328  #define log_d(...) {}
+
329  #endif
+
330  #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG
+
331  #define log_v(...) { DEBUG_PORT.printf("%s(), l.%d: ", __func__, __LINE__); DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); }
+
332  #else
+
333  #define log_v(...) {}
+
334  #endif
+
335 
+
336 #endif
+
337 
+
338 #if ( (defined(USE_CC1101) && defined(USE_SX1276)) || \
+
339  (defined(USE_SX1276) && defined(USE_SX1262)) || \
+
340  (defined(USE_SX1262) && defined(USE_CC1101)) )
+
341  #error "Either USE_CC1101 OR USE_SX1276 OR USE_SX1262 must be defined!"
+
342 #endif
+
343 
+
344 #if defined(USE_CC1101)
+
345  #define RECEIVER_CHIP "[CC1101]"
+
346 #elif defined(USE_SX1276)
+
347  #define RECEIVER_CHIP "[SX1276]"
+
348 #elif defined(USE_SX1262)
+
349  #define RECEIVER_CHIP "[SX1262]"
+
350 #else
+
351  #error "Either USE_CC1101, USE_SX1276 or USE_SX1262 must be defined!"
+
352 #endif
353 
-
354 // Arduino default SPI pins
-
355 //
-
356 // Board SCK MOSI MISO
-
357 // ESP8266 D5 D7 D6
-
358 // ESP32 D18 D23 D19
-
359 #if defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32) && defined(LORAWAN_NODE)
-
360  // Use pinning for LoRaWAN_Node (https://github.com/matthias-bs/LoRaWAN_Node)
-
361  #define PIN_RECEIVER_CS 14
-
362 
-
363  // CC1101: GDO0 / RFM95W/SX127x: G0
-
364  #define PIN_RECEIVER_IRQ 4
-
365 
-
366  // CC1101: GDO2 / RFM95W/SX127x: G1
-
367  #define PIN_RECEIVER_GPIO 16
-
368 
-
369  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
370  #define PIN_RECEIVER_RST 12
-
371 
-
372 #elif defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32) && defined(DFROBOT_COVER_LORA)
-
373  #define PIN_RECEIVER_CS 27 // D4
-
374 
-
375  // CC1101: GDO0 / RFM95W/SX127x: G0
-
376  #define PIN_RECEIVER_IRQ 26 // D3
-
377 
-
378  // CC1101: GDO2 / RFM95W/SX127x: G1
-
379  #define PIN_RECEIVER_GPIO 9 // D5
-
380 
-
381  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
382  #define PIN_RECEIVER_RST 25 // D2
-
383 
-
384 #elif defined(ARDUINO_TTGO_LoRa32_V1) || defined(ARDUINO_TTGO_LoRa32_V2)
-
385  // Use pinning for LILIGO TTGO LoRa32-OLED
-
386  #define PIN_RECEIVER_CS LORA_CS
-
387 
-
388  // CC1101: GDO0 / RFM95W/SX127x: G0
-
389  #define PIN_RECEIVER_IRQ LORA_IRQ
-
390 
-
391  // CC1101: GDO2 / RFM95W/SX127x: G1
-
392  // n.c. on v1/v2?, LORA_D1 on v21
-
393  #define PIN_RECEIVER_GPIO 33
-
394 
-
395  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
396  #define PIN_RECEIVER_RST LORA_RST
-
397 
-
398 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
-
399  // Use pinning for LILIGO TTGO LoRa32-OLED V2.1 (1.6.1)
-
400  // Same pinout for Heltec Wireless Stick
-
401  #define PIN_RECEIVER_CS LORA_CS
-
402 
-
403  // CC1101: GDO0 / RFM95W/SX127x: G0
-
404  #define PIN_RECEIVER_IRQ LORA_IRQ
-
405 
-
406  // CC1101: GDO2 / RFM95W/SX127x: G1
-
407  #define PIN_RECEIVER_GPIO LORA_D1
-
408 
-
409  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
410  #define PIN_RECEIVER_RST LORA_RST
-
411 
-
412 #elif defined(ARDUINO_HELTEC_WIRELESS_STICK) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
-
413  // Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
-
414  #define PIN_RECEIVER_CS SS
-
415 
-
416  // CC1101: GDO0 / RFM95W/SX127x: G0
-
417  #define PIN_RECEIVER_IRQ DIO0
-
418 
-
419  // CC1101: GDO2 / RFM95W/SX127x: G1
-
420  #define PIN_RECEIVER_GPIO DIO1
-
421 
-
422  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
423  #define PIN_RECEIVER_RST RST_LoRa
-
424 
-
425 #elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
-
426  // Use pinning for Heltec WiFi LoRa32 V3
-
427  #define PIN_RECEIVER_CS SS
-
428 
-
429  // CC1101: GDO0 / RFM95W/SX127x: G0 / SX1262: DIO0
-
430  #define PIN_RECEIVER_IRQ DIO0
-
431 
-
432  // CC1101: GDO2 / RFM95W/SX127x: G1 / SX1262: BUSY
-
433  #define PIN_RECEIVER_GPIO BUSY_LoRa
-
434 
-
435  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
436  #define PIN_RECEIVER_RST RST_LoRa
-
437 
-
438 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
-
439  // Use pinning for Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
-
440  #define PIN_RECEIVER_CS 6
-
441 
-
442  // CC1101: GDO0 / RFM95W/SX127x: G0
-
443  #define PIN_RECEIVER_IRQ 5
-
444 
-
445  // CC1101: GDO2 / RFM95W/SX127x: G1
-
446  #define PIN_RECEIVER_GPIO 11
-
447 
-
448  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
449  #define PIN_RECEIVER_RST 9
-
450 
-
451 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
-
452  // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
-
453  #define PIN_RECEIVER_CS 14
-
454 
-
455  // CC1101: GDO0 / RFM95W/SX127x: G0
-
456  #define PIN_RECEIVER_IRQ 32
-
457 
-
458  // CC1101: GDO2 / RFM95W/SX127x: G1
-
459  #define PIN_RECEIVER_GPIO 33
-
460 
-
461  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
462  #define PIN_RECEIVER_RST 27
-
463 
-
464 #elif defined(ARDUINO_FEATHER_ESP32)
-
465  // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
-
466  #define PIN_RECEIVER_CS 14
-
467 
-
468  // CC1101: GDO0 / RFM95W/SX127x: G0
-
469  #define PIN_RECEIVER_IRQ 32
-
470 
-
471  // CC1101: GDO2 / RFM95W/SX127x: G1
-
472  #define PIN_RECEIVER_GPIO 33
-
473 
-
474  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
475  #define PIN_RECEIVER_RST 27
-
476 
-
477 #elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
-
478  // Note: Depending on board package file date, either variant is used -
-
479  // see https://github.com/espressif/arduino-esp32/issues/9423!
-
480  // Use pinning for M5Stack Core2 with M5Stack Module LoRa868
-
481  #define PIN_RECEIVER_CS 33
-
482 
-
483  // CC1101: GDO0 / RFM95W/SX127x: G0
-
484  #define PIN_RECEIVER_IRQ 36
-
485 
-
486  // CC1101: GDO2 / RFM95W/SX127x: G1
-
487  #define PIN_RECEIVER_GPIO 35
-
488 
-
489  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
490  #define PIN_RECEIVER_RST 26
-
491 
-
492 #elif defined(ARDUINO_ESP32S3_POWERFEATHER)
-
493  // Use pinning for ESP32-S3 PowerFeather with RFM95W "FeatherWing" ADA3232
-
494  #define PIN_RECEIVER_CS 15
-
495 
-
496  // CC1101: GDO0 / RFM95W/SX127x: G0
-
497  #define PIN_RECEIVER_IRQ 16
-
498 
-
499  // CC1101: GDO2 / RFM95W/SX127x: G1
-
500  #define PIN_RECEIVER_GPIO 18
-
501 
-
502  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
503  #define PIN_RECEIVER_RST 45
-
504 
-
505 #elif defined(ESP32)
-
506  // Generic pinning for ESP32 development boards
-
507  #define PIN_RECEIVER_CS 27
-
508 
-
509  // CC1101: GDO0 / RFM95W/SX127x: G0
-
510  #define PIN_RECEIVER_IRQ 21
-
511 
-
512  // CC1101: GDO2 / RFM95W/SX127x: G1
-
513  #define PIN_RECEIVER_GPIO 33
-
514 
-
515  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
516  #define PIN_RECEIVER_RST 32
-
517 
-
518 #elif defined(ESP8266)
-
519  // Generic pinning for ESP8266 development boards (e.g. LOLIN/WEMOS D1 mini)
-
520  #define PIN_RECEIVER_CS 15
-
521 
-
522  // CC1101: GDO0 / RFM95W/SX127x: G0
-
523  #define PIN_RECEIVER_IRQ 4
-
524 
-
525  // CC1101: GDO2 / RFM95W/SX127x: G1
-
526  #define PIN_RECEIVER_GPIO 5
-
527 
-
528  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
529  #define PIN_RECEIVER_RST 2
-
530 
-
531 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
-
532  // Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
-
533  #define PIN_RECEIVER_CS 7
-
534 
-
535  // CC1101: GDO0 / RFM95W/SX127x: G0
-
536  #define PIN_RECEIVER_IRQ 8
-
537 
-
538  // CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
-
539  #define PIN_RECEIVER_GPIO 10
-
540 
-
541  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
-
542  #define PIN_RECEIVER_RST 11
-
543 
-
544 #endif
-
545 
-
546 #define STR_HELPER(x) #x
-
547 #define STR(x) STR_HELPER(x)
-
548 #pragma message("Receiver chip: " RECEIVER_CHIP)
-
549 #pragma message("Pin config: RST->" STR(PIN_RECEIVER_RST) ", CS->" STR(PIN_RECEIVER_CS) ", GD0/G0/IRQ->" STR(PIN_RECEIVER_IRQ) ", GDO2/G1/GPIO->" STR(PIN_RECEIVER_GPIO) )
-
550 
-
551 #endif
+
354 
+
355 // Arduino default SPI pins
+
356 //
+
357 // Board SCK MOSI MISO
+
358 // ESP8266 D5 D7 D6
+
359 // ESP32 D18 D23 D19
+
360 #if defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32) && defined(LORAWAN_NODE)
+
361  // Use pinning for LoRaWAN_Node (https://github.com/matthias-bs/LoRaWAN_Node)
+
362  #define PIN_RECEIVER_CS 14
+
363 
+
364  // CC1101: GDO0 / RFM95W/SX127x: G0
+
365  #define PIN_RECEIVER_IRQ 4
+
366 
+
367  // CC1101: GDO2 / RFM95W/SX127x: G1
+
368  #define PIN_RECEIVER_GPIO 16
+
369 
+
370  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
371  #define PIN_RECEIVER_RST 12
+
372 
+
373 #elif defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32) && defined(DFROBOT_COVER_LORA)
+
374  #define PIN_RECEIVER_CS 27 // D4
+
375 
+
376  // CC1101: GDO0 / RFM95W/SX127x: G0
+
377  #define PIN_RECEIVER_IRQ 26 // D3
+
378 
+
379  // CC1101: GDO2 / RFM95W/SX127x: G1
+
380  #define PIN_RECEIVER_GPIO 9 // D5
+
381 
+
382  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
383  #define PIN_RECEIVER_RST 25 // D2
+
384 
+
385 #elif defined(ARDUINO_TTGO_LoRa32_V1) || defined(ARDUINO_TTGO_LoRa32_V2)
+
386  // Use pinning for LILIGO TTGO LoRa32-OLED
+
387  #define PIN_RECEIVER_CS LORA_CS
+
388 
+
389  // CC1101: GDO0 / RFM95W/SX127x: G0
+
390  #define PIN_RECEIVER_IRQ LORA_IRQ
+
391 
+
392  // CC1101: GDO2 / RFM95W/SX127x: G1
+
393  // n.c. on v1/v2?, LORA_D1 on v21
+
394  #define PIN_RECEIVER_GPIO 33
+
395 
+
396  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
397  #define PIN_RECEIVER_RST LORA_RST
+
398 
+
399 #elif defined(ARDUINO_TTGO_LoRa32_v21new)
+
400  // Use pinning for LILIGO TTGO LoRa32-OLED V2.1 (1.6.1)
+
401  // Same pinout for Heltec Wireless Stick
+
402  #define PIN_RECEIVER_CS LORA_CS
+
403 
+
404  // CC1101: GDO0 / RFM95W/SX127x: G0
+
405  #define PIN_RECEIVER_IRQ LORA_IRQ
+
406 
+
407  // CC1101: GDO2 / RFM95W/SX127x: G1
+
408  #define PIN_RECEIVER_GPIO LORA_D1
+
409 
+
410  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
411  #define PIN_RECEIVER_RST LORA_RST
+
412 
+
413 #elif defined(ARDUINO_HELTEC_WIRELESS_STICK) || defined(ARDUINO_HELTEC_WIRELESS_STICK_V3) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
+
414  // Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
+
415  #define PIN_RECEIVER_CS SS
+
416 
+
417  // CC1101: GDO0 / RFM95W/SX127x: G0
+
418  #define PIN_RECEIVER_IRQ DIO0
+
419 
+
420  // CC1101: GDO2 / RFM95W/SX127x: G1
+
421  #define PIN_RECEIVER_GPIO DIO1
+
422 
+
423  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
424  #define PIN_RECEIVER_RST RST_LoRa
+
425 
+
426 #elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
+
427  // Use pinning for Heltec WiFi LoRa32 V3
+
428  #define PIN_RECEIVER_CS SS
+
429 
+
430  // CC1101: GDO0 / RFM95W/SX127x: G0 / SX1262: DIO0
+
431  #define PIN_RECEIVER_IRQ DIO0
+
432 
+
433  // CC1101: GDO2 / RFM95W/SX127x: G1 / SX1262: BUSY
+
434  #define PIN_RECEIVER_GPIO BUSY_LoRa
+
435 
+
436  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
437  #define PIN_RECEIVER_RST RST_LoRa
+
438 
+
439 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
+
440  // Use pinning for Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
+
441  #define PIN_RECEIVER_CS 6
+
442 
+
443  // CC1101: GDO0 / RFM95W/SX127x: G0
+
444  #define PIN_RECEIVER_IRQ 5
+
445 
+
446  // CC1101: GDO2 / RFM95W/SX127x: G1
+
447  #define PIN_RECEIVER_GPIO 11
+
448 
+
449  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
450  #define PIN_RECEIVER_RST 9
+
451 
+
452 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
+
453  // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
+
454  #define PIN_RECEIVER_CS 14
+
455 
+
456  // CC1101: GDO0 / RFM95W/SX127x: G0
+
457  #define PIN_RECEIVER_IRQ 32
+
458 
+
459  // CC1101: GDO2 / RFM95W/SX127x: G1
+
460  #define PIN_RECEIVER_GPIO 33
+
461 
+
462  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
463  #define PIN_RECEIVER_RST 27
+
464 
+
465 #elif defined(ARDUINO_FEATHER_ESP32)
+
466  // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
+
467  #define PIN_RECEIVER_CS 14
+
468 
+
469  // CC1101: GDO0 / RFM95W/SX127x: G0
+
470  #define PIN_RECEIVER_IRQ 32
+
471 
+
472  // CC1101: GDO2 / RFM95W/SX127x: G1
+
473  #define PIN_RECEIVER_GPIO 33
+
474 
+
475  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
476  #define PIN_RECEIVER_RST 27
+
477 
+
478 #elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
+
479  // Note: Depending on board package file date, either variant is used -
+
480  // see https://github.com/espressif/arduino-esp32/issues/9423!
+
481  // Use pinning for M5Stack Core2 with M5Stack Module LoRa868
+
482  #define PIN_RECEIVER_CS 33
+
483 
+
484  // CC1101: GDO0 / RFM95W/SX127x: G0
+
485  #define PIN_RECEIVER_IRQ 36
+
486 
+
487  // CC1101: GDO2 / RFM95W/SX127x: G1
+
488  #define PIN_RECEIVER_GPIO 35
+
489 
+
490  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
491  #define PIN_RECEIVER_RST 26
+
492 
+
493 #elif defined(ARDUINO_ESP32S3_POWERFEATHER)
+
494  // Use pinning for ESP32-S3 PowerFeather with RFM95W "FeatherWing" ADA3232
+
495  #define PIN_RECEIVER_CS 15
+
496 
+
497  // CC1101: GDO0 / RFM95W/SX127x: G0
+
498  #define PIN_RECEIVER_IRQ 16
+
499 
+
500  // CC1101: GDO2 / RFM95W/SX127x: G1
+
501  #define PIN_RECEIVER_GPIO 18
+
502 
+
503  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
504  #define PIN_RECEIVER_RST 45
+
505 
+
506 #elif defined(ESP32)
+
507  // Generic pinning for ESP32 development boards
+
508  #define PIN_RECEIVER_CS 27
+
509 
+
510  // CC1101: GDO0 / RFM95W/SX127x: G0
+
511  #define PIN_RECEIVER_IRQ 21
+
512 
+
513  // CC1101: GDO2 / RFM95W/SX127x: G1
+
514  #define PIN_RECEIVER_GPIO 33
+
515 
+
516  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
517  #define PIN_RECEIVER_RST 32
+
518 
+
519 #elif defined(ESP8266)
+
520  // Generic pinning for ESP8266 development boards (e.g. LOLIN/WEMOS D1 mini)
+
521  #define PIN_RECEIVER_CS 15
+
522 
+
523  // CC1101: GDO0 / RFM95W/SX127x: G0
+
524  #define PIN_RECEIVER_IRQ 4
+
525 
+
526  // CC1101: GDO2 / RFM95W/SX127x: G1
+
527  #define PIN_RECEIVER_GPIO 5
+
528 
+
529  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
530  #define PIN_RECEIVER_RST 2
+
531 
+
532 #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
+
533  // Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
+
534  #define PIN_RECEIVER_CS 7
+
535 
+
536  // CC1101: GDO0 / RFM95W/SX127x: G0
+
537  #define PIN_RECEIVER_IRQ 8
+
538 
+
539  // CC1101: GDO2 / RFM95W/SX127x: G1 (not used)
+
540  #define PIN_RECEIVER_GPIO 10
+
541 
+
542  // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
+
543  #define PIN_RECEIVER_RST 11
+
544 
+
545 #endif
+
546 
+
547 #define STR_HELPER(x) #x
+
548 #define STR(x) STR_HELPER(x)
+
549 #pragma message("Receiver chip: " RECEIVER_CHIP)
+
550 #pragma message("Pin config: RST->" STR(PIN_RECEIVER_RST) ", CS->" STR(PIN_RECEIVER_CS) ", GD0/G0/IRQ->" STR(PIN_RECEIVER_IRQ) ", GDO2/G1/GPIO->" STR(PIN_RECEIVER_GPIO) )
+
551 
+
552 #endif