From 3e0a8e421e6add920135737e2ee8638bb9f66f63 Mon Sep 17 00:00:00 2001 From: Matthias Prinke <83612361+matthias-bs@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:31:31 +0200 Subject: [PATCH] Update WeatherSensorCfg.h --- src/WeatherSensorCfg.h | 55 +++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/src/WeatherSensorCfg.h b/src/WeatherSensorCfg.h index 809161cf..aa32a589 100644 --- a/src/WeatherSensorCfg.h +++ b/src/WeatherSensorCfg.h @@ -45,6 +45,7 @@ // 20230607 Added pin definitions for Heltec WiFi LoRa 32(V2) // 20230624 Added Bresser Lightning Sensor decoder // 20230804 Added Bresser Water Leakage Sensor decoder +// 20230926 Added pin definitions for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232 // // ToDo: // - @@ -139,7 +140,13 @@ #elif defined(ARDUINO_AVR_FEATHER32U4) #pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Adafruit Feather 32u4 RFM95 LoRa Radio") #define USE_SX1276 - + +#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) + #pragma message("ARDUINO_ADAFRUIT_FEATHER_RP2040 defined; assuming assuming RFM95W FeatherWing will be used") + #define USE_SX1276 + #pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS") + #pragma message("NOT TESTED!") + #elif defined(ARDUINO_ESP32_DEV) //#define LORAWAN_NODE #define FIREBEETLE_ESP32_COVER_LORA @@ -200,10 +207,14 @@ // DEBUG_ESP_PORT is set in Arduino IDE: // Tools->Debug port: "||" // +// - RP2040: +// DEBUG_RP2040_PORT is set in Arduino IDE: +// Tools->Debug port: "|||" +// // Replacement for // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h // on ESP8266: -#if defined(ESP8266) +#if defined(ESP8266) || defined(ARDUINO_ARCH_RP2040) #define ARDUHAL_LOG_LEVEL_NONE 0 #define ARDUHAL_LOG_LEVEL_ERROR 1 #define ARDUHAL_LOG_LEVEL_WARN 2 @@ -211,31 +222,37 @@ #define ARDUHAL_LOG_LEVEL_DEBUG 4 #define ARDUHAL_LOG_LEVEL_VERBOSE 5 + #if defined(ARDUINO_ARCH_RP2040) + #define DEBUG_ESP_PORT DEBUG_RP2040_PORT + #else + #define DEBUG_PORT DEBUG_ESP_PORT + #endif + // Set desired level here! #define CORE_DEBUG_LEVEL ARDUHAL_LOG_LEVEL_VERBOSE - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE - #define log_e(...) { DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.println(); } + #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_NONE + #define log_e(...) { DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); } #else #define log_e(...) {} #endif - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR - #define log_w(...) { DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.println(); } + #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_ERROR + #define log_w(...) { DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); } #else #define log_w(...) {} #endif - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN - #define log_i(...) { DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.println(); } + #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_WARN + #define log_i(...) { DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); } #else #define log_i(...) {} #endif - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO - #define log_d(...) { DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.println(); } + #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_INFO + #define log_d(...) { DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); } #else #define log_d(...) {} #endif - #if defined(DEBUG_ESP_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG - #define log_v(...) { DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.println(); } + #if defined(DEBUG_PORT) && CORE_DEBUG_LEVEL > ARDUHAL_LOG_LEVEL_DEBUG + #define log_v(...) { DEBUG_PORT.printf(__VA_ARGS__); DEBUG_PORT.println(); } #else #define log_v(...) {} #endif @@ -459,6 +476,20 @@ // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC #define PIN_RECEIVER_RST 4 +#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) + // Use pinning for Adafruit Feather RP2040 with RFM95W "FeatherWing" ADA3232 + // NOTE: NOT TESTED! + #define PIN_RECEIVER_CS 7 + + // CC1101: GDO0 / RFM95W/SX127x: G0 + #define PIN_RECEIVER_IRQ 8 + + // CC1101: GDO2 / RFM95W/SX127x: G1 (not used) + #define PIN_RECEIVER_GPIO 10 + + // RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC + #define PIN_RECEIVER_RST 11 + #endif #define STR_HELPER(x) #x