|
56 | 56 | // 20240122 Modified for unit testing
|
57 | 57 | // 20240204 Added separate ARDUINO_heltec_wireless_stick_v2/v3
|
58 | 58 | // 20240322 Added pin definitions for M5Stack Core2 with M5Stack Module LoRa868
|
| 59 | +// 20240415 Added pin definitions for ESP32-S3 PowerFeather with with RFM95W "FeatherWing" ADA3232 |
| 60 | +// 20240417 Modified SENSOR_IDS_INC |
| 61 | +// 20240425 Added define variant ARDUINO_heltec_wifi_lora_32_V3 |
| 62 | +// 20240507 Renamed NUM_SENSORS to MAX_SENSORS_DEFAULT |
| 63 | +// NOTE: ARDUINO_ARCH_AVR no longer supported due to code size!!! |
59 | 64 | //
|
60 | 65 | // ToDo:
|
61 | 66 | // -
|
|
70 | 75 | // ------------------------------------------------------------------------------------------------
|
71 | 76 | // --- Weather Sensors ---
|
72 | 77 | // ------------------------------------------------------------------------------------------------
|
73 |
| -#define NUM_SENSORS 1 // Number of sensors to be received |
| 78 | +#define MAX_SENSORS_DEFAULT 1 // Maximum number of sensors to be received |
74 | 79 |
|
75 | 80 | // List of sensor IDs to be excluded - can be empty
|
76 | 81 | #define SENSOR_IDS_EXC { 0x792882A2 }
|
|
115 | 120 | // ------------------------------------------------------------------------------------------------
|
116 | 121 | // --- Board ---
|
117 | 122 | // ------------------------------------------------------------------------------------------------
|
118 |
| -// Use pinning for LoRaWAN Node |
119 |
| - |
120 | 123 |
|
121 | 124 | // LILIGO TTGO LoRaP32 board with integrated RF tranceiver (SX1276)
|
122 | 125 | // See pin definitions in
|
|
185 | 188 |
|
186 | 189 | #elif defined(ARDUINO_TTGO_LoRa32_V2)
|
187 | 190 | #pragma message("ARDUINO_TTGO_LoRa32_V2 defined; using on-board transceiver")
|
188 |
| - #pragma message("LoRa DIO1 must be wired to GPIO33 manually!") |
| 191 | + #pragma message("Wiring required for LMIC: DIO1 to GPIO33") |
189 | 192 | #define USE_SX1276
|
190 | 193 |
|
191 | 194 | #elif defined(ARDUINO_TTGO_LoRa32_v21new)
|
|
210 | 213 | #pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
|
211 | 214 | #define USE_SX1276
|
212 | 215 |
|
213 |
| -#elif defined(ARDUINO_heltec_wifi_32_lora_V3) |
214 |
| - #pragma message("ARDUINO_heltec_wifi_32_lora_V3 defined; using on-board transceiver") |
| 216 | +#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3) |
| 217 | + #pragma message("ARDUINO_heltec_wifi_32_lora_V3 (or similar) defined; using on-board transceiver") |
215 | 218 | #define USE_SX1262
|
216 | 219 |
|
217 | 220 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
|
218 | 221 | #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
|
219 | 222 | #define USE_SX1276
|
220 | 223 |
|
| 224 | +#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) |
| 225 | + #pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32_V2 defined; assuming RFM95W FeatherWing will be used") |
| 226 | + #define USE_SX1276 |
| 227 | + #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS") |
| 228 | + |
221 | 229 | #elif defined(ARDUINO_FEATHER_ESP32)
|
222 | 230 | #pragma message("ARDUINO_FEATHER_ESP32 defined; assuming RFM95W FeatherWing will be used")
|
223 | 231 | #define USE_SX1276
|
224 | 232 | #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
|
225 | 233 |
|
226 | 234 | #elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2)
|
| 235 | + // Note: Depending on board package file date, either variant is used - |
| 236 | + // see https://github.com/espressif/arduino-esp32/issues/9423! |
227 | 237 | #pragma message("ARDUINO_M5STACK_CORE2 defined; assuming M5Stack Module LoRa868 will be used")
|
228 | 238 | #define USE_SX1276
|
229 |
| - #pragma message("Required wiring: DIO1 to GPIO35") |
| 239 | + #pragma message("Wiring required for LMIC: DIO1 to GPIO35") |
230 | 240 |
|
231 |
| -#elif defined(ARDUINO_AVR_FEATHER32U4) |
232 |
| - #pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Adafruit Feather 32u4 RFM95 LoRa Radio") |
| 241 | +#elif defined(ARDUINO_ESP32S3_POWERFEATHER) |
| 242 | + #pragma message("ARDUINO_ESP32S3_POWERFEATHER defined; assuming RFM95W FeatherWing will be used") |
233 | 243 | #define USE_SX1276
|
| 244 | + #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS") |
234 | 245 |
|
235 | 246 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
|
236 |
| - #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming assuming RFM95W FeatherWing will be used") |
| 247 | + #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming RFM95W FeatherWing will be used") |
237 | 248 | #define USE_SX1276
|
238 | 249 | #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")
|
239 | 250 |
|
240 | 251 | #elif defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32)
|
241 |
| - #define LORAWAN_NODE |
242 |
| - //#define FIREBEETLE_ESP32_COVER_LORA |
| 252 | + //#define LORAWAN_NODE |
| 253 | + #define FIREBEETLE_ESP32_COVER_LORA |
243 | 254 |
|
244 | 255 | #if defined(FIREBEETLE_ESP32_COVER_LORA)
|
245 | 256 | #pragma message("FIREBEETLE_ESP32_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
|
|
332 | 343 |
|
333 | 344 | #endif
|
334 | 345 |
|
335 |
| - |
336 |
| -// Replacement for |
337 |
| -// https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h |
338 |
| -// on Arduino AVR: |
339 |
| -#if defined(ARDUINO_ARCH_AVR) |
340 |
| - #define ARDUHAL_LOG_LEVEL_NONE 0 |
341 |
| - #define ARDUHAL_LOG_LEVEL_ERROR 1 |
342 |
| - #define ARDUHAL_LOG_LEVEL_WARN 2 |
343 |
| - #define ARDUHAL_LOG_LEVEL_INFO 3 |
344 |
| - #define ARDUHAL_LOG_LEVEL_DEBUG 4 |
345 |
| - #define ARDUHAL_LOG_LEVEL_VERBOSE 5 |
346 |
| - |
347 |
| - // Set desired level here! |
348 |
| - #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_INFO |
349 |
| - |
350 |
| - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE |
351 |
| - #define log_e(...) { printf(__VA_ARGS__); println(); } |
352 |
| - #else |
353 |
| - #define log_e(...) {} |
354 |
| - #endif |
355 |
| - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR |
356 |
| - #define log_w(...) { printf(__VA_ARGS__); println(); } |
357 |
| - #else |
358 |
| - #define log_w(...) {} |
359 |
| - #endif |
360 |
| - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN |
361 |
| - #define log_i(...) { printf(__VA_ARGS__); println(); } |
362 |
| - #else |
363 |
| - #define log_i(...) {} |
364 |
| - #endif |
365 |
| - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO |
366 |
| - #define log_d(...) { printf(__VA_ARGS__); println(); } |
367 |
| - #else |
368 |
| - #define log_d(...) {} |
369 |
| - #endif |
370 |
| - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG |
371 |
| - #define log_v(...) { printf(__VA_ARGS__); println(); } |
372 |
| - #else |
373 |
| - #define log_v(...) {} |
374 |
| - #endif |
375 |
| -#endif |
376 |
| - |
377 | 346 | #if ( (defined(USE_CC1101) && defined(USE_SX1276)) || \
|
378 | 347 | (defined(USE_SX1276) && defined(USE_SX1262)) || \
|
379 | 348 | (defined(USE_SX1262) && defined(USE_CC1101)) )
|
|
462 | 431 | // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
|
463 | 432 | #define PIN_RECEIVER_RST RST_LoRa
|
464 | 433 |
|
465 |
| -#elif defined(ARDUINO_heltec_wifi_32_lora_V3) |
| 434 | +#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3) |
466 | 435 | // Use pinning for Heltec WiFi LoRa32 V3
|
467 | 436 | #define PIN_RECEIVER_CS SS
|
468 | 437 |
|
|
488 | 457 | // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
|
489 | 458 | #define PIN_RECEIVER_RST 9
|
490 | 459 |
|
| 460 | +#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) |
| 461 | + // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232 |
| 462 | + #define PIN_RECEIVER_CS 14 |
| 463 | + |
| 464 | + // CC1101: GDO0 / RFM95W/SX127x: G0 |
| 465 | + #define PIN_RECEIVER_IRQ 32 |
| 466 | + |
| 467 | + // CC1101: GDO2 / RFM95W/SX127x: G1 |
| 468 | + #define PIN_RECEIVER_GPIO 33 |
| 469 | + |
| 470 | + // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC |
| 471 | + #define PIN_RECEIVER_RST 27 |
| 472 | + |
491 | 473 | #elif defined(ARDUINO_FEATHER_ESP32)
|
492 | 474 | // Use pinning for Adafruit Feather ESP32 with RFM95W "FeatherWing" ADA3232
|
493 | 475 | #define PIN_RECEIVER_CS 14
|
|
501 | 483 | // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
|
502 | 484 | #define PIN_RECEIVER_RST 27
|
503 | 485 |
|
504 |
| -#elif defined(ARDUINO_M5STACK_CORE2) |
| 486 | +#elif defined(ARDUINO_M5STACK_CORE2) || defined(ARDUINO_M5STACK_Core2) |
| 487 | + // Note: Depending on board package file date, either variant is used - |
| 488 | + // see https://github.com/espressif/arduino-esp32/issues/9423! |
505 | 489 | // Use pinning for M5Stack Core2 with M5Stack Module LoRa868
|
506 | 490 | #define PIN_RECEIVER_CS 33
|
507 | 491 |
|
|
514 | 498 | // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
|
515 | 499 | #define PIN_RECEIVER_RST 26
|
516 | 500 |
|
| 501 | +#elif defined(ARDUINO_ESP32S3_POWERFEATHER) |
| 502 | + // Use pinning for ESP32-S3 PowerFeather with RFM95W "FeatherWing" ADA3232 |
| 503 | + #define PIN_RECEIVER_CS 15 |
| 504 | + |
| 505 | + // CC1101: GDO0 / RFM95W/SX127x: G0 |
| 506 | + #define PIN_RECEIVER_IRQ 16 |
| 507 | + |
| 508 | + // CC1101: GDO2 / RFM95W/SX127x: G1 |
| 509 | + #define PIN_RECEIVER_GPIO 18 |
| 510 | + |
| 511 | + // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC |
| 512 | + #define PIN_RECEIVER_RST 45 |
| 513 | + |
517 | 514 | #elif defined(ESP32)
|
518 | 515 | // Generic pinning for ESP32 development boards
|
519 | 516 | #define PIN_RECEIVER_CS 27
|
|
539 | 536 |
|
540 | 537 | // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
|
541 | 538 | #define PIN_RECEIVER_RST 2
|
542 |
| - |
543 |
| -#elif defined(ARDUINO_AVR_FEATHER32U4) |
544 |
| - // Pinning for Adafruit Feather 32u4 |
545 |
| - #define PIN_RECEIVER_CS 8 |
546 |
| - |
547 |
| - // CC1101: GDO0 / RFM95W/SX127x: G0 |
548 |
| - #define PIN_RECEIVER_IRQ 7 |
549 |
| - |
550 |
| - // CC1101: GDO2 / RFM95W/SX127x: G1 (not used) |
551 |
| - #define PIN_RECEIVER_GPIO 99 |
552 |
| - |
553 |
| - // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC |
554 |
| - #define PIN_RECEIVER_RST 4 |
555 | 539 |
|
556 | 540 | #elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
|
557 | 541 | // Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232
|
|
0 commit comments