Add Pico2W variant including Wifi support. ()

pull/6103/head
Mictronics 2025-02-20 10:56:34 +01:00 zatwierdzone przez GitHub
rodzic f1dc1b309a
commit 9930bba3f5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
5 zmienionych plików z 88 dodań i 5 usunięć
arch/rp2xx0
src/mesh/api
variants

Wyświetl plik

@ -1,8 +1,8 @@
; Common settings for rp2040 Processor based targets
[rp2350_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5 ; For arduino-pico >= 4.4.3
extends = arduino_base
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#4.4.3
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
@ -10,7 +10,6 @@ build_flags =
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
-Isrc/platform/rp2xx0
-D__PLAT_RP2350__
# -D _POSIX_THREADS
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp> -<platform/rp2xx0/pico_sleep> -<platform/rp2xx0/hardware_rosc>

Wyświetl plik

@ -51,6 +51,8 @@ template <class T, class U> int32_t APIServerPort<T, U>::runOnce()
#else
auto client = U::available();
#endif
#elif defined(ARCH_RP2040)
auto client = U::accept();
#else
auto client = U::available();
#endif
@ -78,4 +80,4 @@ template <class T, class U> int32_t APIServerPort<T, U>::runOnce()
waitTime = 100;
#endif
return 100; // only check occasionally for incoming connections
}
}

Wyświetl plik

@ -9,7 +9,7 @@ build_flags = ${rp2350_base.build_flags}
-Ivariants/rpipico2
-DDEBUG_RP2040_PORT=Serial
-DHW_SPI1_DEVICE
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m33"
lib_deps =
${rp2350_base.lib_deps}
debug_build_flags = ${rp2350_base.build_flags}, -g

Wyświetl plik

@ -0,0 +1,30 @@
[env:pico2w]
extends = rp2350_base
board = rpipico2w
upload_protocol = jlink
# debug settings for external openocd with RP2040 support (custom build)
debug_tool = custom
debug_init_cmds =
target extended-remote localhost:3333
$INIT_BREAK
monitor reset halt
$LOAD_CMDS
monitor init
monitor reset halt
# add our variants files to the include and src paths
build_flags = ${rp2350_base.build_flags}
-DRPI_PICO2
-Ivariants/rpipico2w
# -DDEBUG_RP2040_PORT=Serial
-DHW_SPI1_DEVICE
-DARDUINO_RASPBERRY_PI_PICO_2W
-DARDUINO_ARCH_RP2040
-DHAS_WIFI=1
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m33"
-fexceptions # for exception handling in MQTT
build_src_filter = ${rp2350_base.build_src_filter} +<mesh/wifi/>
lib_deps =
${rp2350_base.lib_deps}
${networking_base.lib_deps}
debug_build_flags = ${rp2350_base.build_flags}, -g

Wyświetl plik

@ -0,0 +1,52 @@
// #define RADIOLIB_CUSTOM_ARDUINO 1
// #define RADIOLIB_TONE_UNSUPPORTED 1
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
#define ARDUINO_ARCH_AVR
#ifndef HAS_WIFI
#define HAS_WIFI 1
#endif
// default I2C pins:
// SDA = 4
// SCL = 5
// Recommended pins for SerialModule:
// txd = 8
// rxd = 9
#define EXT_NOTIFY_OUT 22
#define BUTTON_PIN 17
#define BATTERY_PIN 26
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
#define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION
#define USE_SX1262
#undef LORA_SCK
#undef LORA_MISO
#undef LORA_MOSI
#undef LORA_CS
#define LORA_SCK 10
#define LORA_MISO 12
#define LORA_MOSI 11
#define LORA_CS 3
#define LORA_DIO0 RADIOLIB_NC
#define LORA_RESET 15
#define LORA_DIO1 20
#define LORA_DIO2 2
#define LORA_DIO3 RADIOLIB_NC
#ifdef USE_SX1262
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif