mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-06 09:57:52 +00:00
RP2040/RP2350: Migrate variants to new structure (#7345)
This commit is contained in:
14
variants/rp2040/ec_catsniffer/platformio.ini
Normal file
14
variants/rp2040/ec_catsniffer/platformio.ini
Normal file
@@ -0,0 +1,14 @@
|
||||
[env:catsniffer]
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
upload_protocol = picotool
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D RPI_PICO
|
||||
-I variants/rp2040/ec_catsniffer
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
; -D HW_SPI1_DEVICE
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap
|
||||
39
variants/rp2040/ec_catsniffer/variant.cpp
Normal file
39
variants/rp2040/ec_catsniffer/variant.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
#define CTF1 8
|
||||
#define CTF2 9
|
||||
#define CTF3 10
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// Config the LoRa Switch
|
||||
pinMode(CTF1, OUTPUT);
|
||||
pinMode(CTF2, OUTPUT);
|
||||
pinMode(CTF3, OUTPUT);
|
||||
|
||||
digitalWrite(CTF1, HIGH);
|
||||
digitalWrite(CTF2, LOW);
|
||||
digitalWrite(CTF3, LOW);
|
||||
}
|
||||
41
variants/rp2040/ec_catsniffer/variant.h
Normal file
41
variants/rp2040/ec_catsniffer/variant.h
Normal file
@@ -0,0 +1,41 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
#define HAS_SCREEN 0
|
||||
#define HAS_GPS 0
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
#define LED_PIN 27
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
#define LORA_SCK 18
|
||||
#define LORA_MISO 16
|
||||
#define LORA_MOSI 19
|
||||
#define LORA_CS 17 // NSS
|
||||
|
||||
#define LORA_DIO0 5
|
||||
#define LORA_RESET 24
|
||||
#define LORA_DIO1 4
|
||||
#define LORA_DIO2 23
|
||||
#define LORA_DIO3 25
|
||||
#define SX126X_RXEN 21
|
||||
#define SX126X_TXEN 20
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO0
|
||||
#define SX126X_BUSY LORA_DIO1
|
||||
#define SX126X_RESET LORA_RESET
|
||||
// #define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 0
|
||||
#endif
|
||||
15
variants/rp2040/feather_rp2040_rfm95/platformio.ini
Normal file
15
variants/rp2040/feather_rp2040_rfm95/platformio.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[env:feather_rp2040_rfm95]
|
||||
extends = rp2040_base
|
||||
board = adafruit_feather
|
||||
upload_protocol = picotool
|
||||
# add our variants files to the include and src paths
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D RP2040_FEATHER_RFM95
|
||||
-I variants/rp2040/feather_rp2040_rfm95
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
-D HW_SPI1_DEVICE
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
61
variants/rp2040/feather_rp2040_rfm95/variant.h
Normal file
61
variants/rp2040/feather_rp2040_rfm95/variant.h
Normal file
@@ -0,0 +1,61 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// #define USE_SSD1306
|
||||
|
||||
// #define USE_SH1106 1
|
||||
|
||||
// default I2C pins:
|
||||
// SDA = 4
|
||||
// SCL = 5
|
||||
|
||||
// Recommended pins for SerialModule:
|
||||
// txd = 8
|
||||
// rxd = 9
|
||||
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define BUTTON_PIN 7
|
||||
// #define BUTTON_NEED_PULLUP
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
// #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 USE_RF95 // RFM95/SX127x
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
// https://www.adafruit.com/product/5714
|
||||
// https://learn.adafruit.com/feather-rp2040-rfm95
|
||||
// https://learn.adafruit.com/assets/120283
|
||||
// https://learn.adafruit.com/assets/120813
|
||||
#define LORA_SCK 14 // 10 12P
|
||||
#define LORA_MISO 8 // 12 10P
|
||||
#define LORA_MOSI 15 // 11 11P
|
||||
#define LORA_CS 16 // 3 13P
|
||||
|
||||
#define LORA_RESET 17 // 15 14P
|
||||
|
||||
#define LORA_DIO0 21 // ?? 6P
|
||||
#define LORA_DIO1 22 // 20 7P
|
||||
#define LORA_DIO2 23 // 2 8P
|
||||
#define LORA_DIO3 19 // ?? 3P
|
||||
#define LORA_DIO4 20 // ?? 4P
|
||||
#define LORA_DIO5 18 // ?? 15P
|
||||
|
||||
#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
|
||||
16
variants/rp2040/nibble_rp2040/platformio.ini
Normal file
16
variants/rp2040/nibble_rp2040/platformio.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
[env:nibble-rp2040]
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
board_level = extra
|
||||
upload_protocol = picotool
|
||||
# add our variants files to the include and src paths
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D PRIVATE_HW
|
||||
-I variants/rp2040/nibble_rp2040
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
-D HW_SPI1_DEVICE
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
18
variants/rp2040/nibble_rp2040/variant.h
Normal file
18
variants/rp2040/nibble_rp2040/variant.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
#define BUTTON_PIN -1 // Pin 17 used for antenna switching via DIO4
|
||||
|
||||
#define LED_PIN 1
|
||||
|
||||
#define HAS_CPU_SHUTDOWN 1
|
||||
|
||||
#define USE_RF95
|
||||
#define LORA_SCK 10
|
||||
#define LORA_MISO 12
|
||||
#define LORA_MOSI 11
|
||||
#define LORA_CS 13
|
||||
|
||||
#define LORA_DIO0 14
|
||||
#define LORA_RESET 15
|
||||
#define LORA_DIO1 RADIOLIB_NC
|
||||
#define LORA_DIO2 RADIOLIB_NC
|
||||
68
variants/rp2040/rak11310/pins_arduino.h
Normal file
68
variants/rp2040/rak11310/pins_arduino.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
// Pin definitions taken from:
|
||||
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
|
||||
|
||||
static const uint8_t WB_IO1 = 6; // SLOT_A SLOT_B
|
||||
static const uint8_t WB_IO2 = 22; // SLOT_A SLOT_B
|
||||
static const uint8_t WB_IO3 = 7; // SLOT_C
|
||||
static const uint8_t WB_IO4 = 28; // SLOT_C
|
||||
static const uint8_t WB_IO5 = 9; // SLOT_D
|
||||
static const uint8_t WB_IO6 = 8; // SLOT_D
|
||||
static const uint8_t WB_A0 = 26; // IO_SLOT
|
||||
static const uint8_t WB_A1 = 27; // IO_SLOT
|
||||
|
||||
#define PIN_A0 (26u)
|
||||
#define PIN_A1 (27u)
|
||||
#define PIN_A2 (28u)
|
||||
#define PIN_A3 (29u)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
static const uint8_t A2 = PIN_A2;
|
||||
static const uint8_t A3 = PIN_A3;
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (23u)
|
||||
#define PIN_LED1 PIN_LED
|
||||
#define PIN_LED2 (24u)
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
#define ADC_RESOLUTION 12
|
||||
|
||||
// Serial
|
||||
#define PIN_SERIAL1_TX (0ul)
|
||||
#define PIN_SERIAL1_RX (1ul)
|
||||
|
||||
#define PIN_SERIAL2_TX (4ul)
|
||||
#define PIN_SERIAL2_RX (5ul)
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI1_MISO (12u)
|
||||
#define PIN_SPI1_MOSI (11u)
|
||||
#define PIN_SPI1_SCK (10u)
|
||||
#define PIN_SPI1_SS (13u)
|
||||
|
||||
#define PIN_SPI0_MISO (16u)
|
||||
#define PIN_SPI0_MOSI (19u)
|
||||
#define PIN_SPI0_SCK (18u)
|
||||
#define PIN_SPI0_SS (17u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (2u)
|
||||
#define PIN_WIRE0_SCL (3u)
|
||||
|
||||
#define PIN_WIRE1_SDA (20u)
|
||||
#define PIN_WIRE1_SCL (21u)
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (2u)
|
||||
|
||||
static const uint8_t SS = PIN_SPI0_SS;
|
||||
static const uint8_t MOSI = PIN_SPI0_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI0_MISO;
|
||||
static const uint8_t SCK = PIN_SPI0_SCK;
|
||||
|
||||
static const uint8_t SDA = PIN_WIRE0_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE0_SCL;
|
||||
19
variants/rp2040/rak11310/platformio.ini
Normal file
19
variants/rp2040/rak11310/platformio.ini
Normal file
@@ -0,0 +1,19 @@
|
||||
[env:rak11310]
|
||||
extends = rp2040_base
|
||||
board = rakwireless_rak11300
|
||||
upload_protocol = picotool
|
||||
# add our variants files to the include and src paths
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D RAK11310
|
||||
-I variants/rp2040/rak11310
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
-D RV3028_RTC=0x52
|
||||
build_src_filter = ${rp2040_base.build_src_filter} +<../variants/rp2040/rak11310> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
${networking_base.lib_deps}
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
64
variants/rp2040/rak11310/variant.h
Normal file
64
variants/rp2040/rak11310/variant.h
Normal file
@@ -0,0 +1,64 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// Define I2C pins to ensure correct usage of both ports
|
||||
#define I2C_SDA 20
|
||||
#define I2C_SCL 21
|
||||
#define I2C_SDA1 2
|
||||
#define I2C_SCL1 3
|
||||
|
||||
#define LED_CONN PIN_LED2
|
||||
#define LED_PIN LED_BUILTIN
|
||||
#define ledOff(pin) pinMode(pin, INPUT)
|
||||
|
||||
#define BUTTON_PIN 9
|
||||
#define BUTTON_NEED_PULLUP
|
||||
// #define EXT_NOTIFY_OUT 4
|
||||
|
||||
#define BATTERY_PIN 26
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION
|
||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||
#define ADC_MULTIPLIER 1.84
|
||||
|
||||
#define DETECTION_SENSOR_EN 28
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
// RAK BSP somehow uses SPI1 instead of SPI0
|
||||
#define HW_SPI1_DEVICE
|
||||
#define LORA_SCK (10u)
|
||||
#define LORA_MOSI (11u)
|
||||
#define LORA_MISO (12u)
|
||||
#define LORA_CS (13u)
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC
|
||||
#define LORA_RESET 14
|
||||
#define LORA_DIO1 29
|
||||
#define LORA_DIO2 15
|
||||
#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_POWER_EN 25
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
#define HAS_ETHERNET 1
|
||||
#define PIN_ETHERNET_RESET 7 // IO3
|
||||
#define PIN_ETHERNET_SS 17
|
||||
#define ETH_SPI_PORT SPI
|
||||
|
||||
#define PIN_ETH_POWER_EN 22
|
||||
15
variants/rp2040/rp2040-lora/platformio.ini
Normal file
15
variants/rp2040/rp2040-lora/platformio.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[env:rp2040-lora]
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
upload_protocol = picotool
|
||||
# add our variants files to the include and src paths
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D RP2040_LORA
|
||||
-I variants/rp2040/rp2040-lora
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
-D HW_SPI1_DEVICE
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
60
variants/rp2040/rp2040-lora/variant.h
Normal file
60
variants/rp2040/rp2040-lora/variant.h
Normal file
@@ -0,0 +1,60 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// #define USE_SH1106 1
|
||||
|
||||
// default I2C pins:
|
||||
// SDA = 4
|
||||
// SCL = 5
|
||||
|
||||
// Recommended pins for SerialModule:
|
||||
// txd = 8
|
||||
// rxd = 9
|
||||
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define BUTTON_PIN -1 // Pin 17 used for antenna switching via DIO4
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
// #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 HAS_CPU_SHUTDOWN 1
|
||||
#define USE_SX1262
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
// https://www.waveshare.com/rp2040-lora.htm
|
||||
// https://www.waveshare.com/img/devkit/RP2040-LoRa-HF/RP2040-LoRa-HF-details-11.jpg
|
||||
#define LORA_SCK 14 // GPIO14
|
||||
#define LORA_MISO 24 // GPIO24
|
||||
#define LORA_MOSI 15 // GPIO15
|
||||
#define LORA_CS 13 // GPIO13
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC // No GPIO connection
|
||||
#define LORA_RESET 23 // GPIO23
|
||||
#define LORA_BUSY 18 // GPIO18
|
||||
#define LORA_DIO1 16 // GPIO16
|
||||
#define LORA_DIO2 RADIOLIB_NC // Antenna switching, no GPIO connection
|
||||
#define LORA_DIO3 RADIOLIB_NC // No GPIO connection
|
||||
#define LORA_DIO4 17 // GPIO17
|
||||
|
||||
// On rp2040-lora board the antenna switch is wired and works with complementary-pin control logic.
|
||||
// See PE4259 datasheet page 4
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // Antenna switch CTRL
|
||||
#define SX126X_RXEN LORA_DIO4 // Antenna switch !CTRL via GPIO17
|
||||
// #define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
28
variants/rp2040/rpipico-slowclock/platformio.ini
Normal file
28
variants/rp2040/rpipico-slowclock/platformio.ini
Normal file
@@ -0,0 +1,28 @@
|
||||
[env:pico_slowclock]
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
board_level = extra
|
||||
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 =
|
||||
${rp2040_base.build_flags}
|
||||
-DRPI_PICO
|
||||
-Ivariants/rp2040/rpipico-slowclock
|
||||
-DDEBUG_RP2040_PORT=Serial2
|
||||
-DHW_SPI1_DEVICE
|
||||
-g
|
||||
-DNO_USB
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}
|
||||
-g
|
||||
-DNO_USB
|
||||
87
variants/rp2040/rpipico-slowclock/variant.h
Normal file
87
variants/rp2040/rpipico-slowclock/variant.h
Normal file
@@ -0,0 +1,87 @@
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// Build with slow system clock enabled to reduce power consumption.
|
||||
#define RP2040_SLOW_CLOCK
|
||||
|
||||
#ifdef RP2040_SLOW_CLOCK
|
||||
// Redefine UART1 serial log output to avoid collision with UART0 for GPS.
|
||||
#define SERIAL2_TX 4
|
||||
#define SERIAL2_RX 5
|
||||
// Reroute log output in SensorLib when USB is not available
|
||||
#define log_e(...) Serial2.printf(__VA_ARGS__)
|
||||
#define log_i(...) Serial2.printf(__VA_ARGS__)
|
||||
#define log_d(...) Serial2.printf(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
// Expecting the Waveshare Pico GPS hat
|
||||
#define HAS_GPS 1
|
||||
|
||||
// Enable OLED Screen
|
||||
#define HAS_SCREEN 1
|
||||
#define USE_SH1106 1
|
||||
#define RESET_OLED 13
|
||||
|
||||
// Redefine I2C0 pins to avoid collision with UART1/Serial2.
|
||||
#define I2C_SDA 8
|
||||
#define I2C_SCL 9
|
||||
|
||||
// Redefine Waveshare UPS-A/B I2C_1 pins:
|
||||
#define I2C_SDA1 6
|
||||
#define I2C_SCL1 7
|
||||
// Waveshare UPS-A/B uses a 0.01 Ohm shunt for the INA219 sensor
|
||||
#define INA219_MULTIPLIER 10.0f
|
||||
|
||||
// Waveshare Pico GPS L76B pins:
|
||||
#define GPS_RX_PIN 1
|
||||
#define GPS_TX_PIN 0
|
||||
|
||||
// Wakeup from backup mode
|
||||
// #define PIN_GPS_FORCE_ON 14
|
||||
// No GPS reset available
|
||||
#undef PIN_GPS_RESET
|
||||
/*
|
||||
* For PPS output the resistor R20 needs to be populated with 0 Ohm
|
||||
* on the Waveshare Pico GPS board.
|
||||
*/
|
||||
#define PIN_GPS_PPS 16
|
||||
/*
|
||||
* For standby mode switching the resistor R18 needs to be populated
|
||||
* with 0 Ohm on the Waveshare Pico GPS board.
|
||||
*/
|
||||
#define PIN_GPS_STANDBY 17
|
||||
|
||||
#define BUTTON_PIN 18
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
#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
|
||||
16
variants/rp2040/rpipico/platformio.ini
Normal file
16
variants/rp2040/rpipico/platformio.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
[env:pico]
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
upload_protocol = picotool
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D RPI_PICO
|
||||
-I variants/rp2040/rpipico
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
-D HW_SPI1_DEVICE
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
50
variants/rp2040/rpipico/variant.h
Normal file
50
variants/rp2040/rpipico/variant.h
Normal file
@@ -0,0 +1,50 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// 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 LED_PIN PIN_LED
|
||||
|
||||
#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
|
||||
18
variants/rp2040/rpipicow/platformio.ini
Normal file
18
variants/rp2040/rpipicow/platformio.ini
Normal file
@@ -0,0 +1,18 @@
|
||||
[env:picow]
|
||||
extends = rp2040_base
|
||||
board = rpipicow
|
||||
upload_protocol = picotool
|
||||
# add our variants files to the include and src paths
|
||||
build_flags =
|
||||
${rp2040_base.build_flags}
|
||||
-D RPI_PICO
|
||||
-I variants/rp2040/rpipicow
|
||||
-D HW_SPI1_DEVICE
|
||||
-D HAS_UDP_MULTICAST=1
|
||||
-fexceptions # for exception handling in MQTT
|
||||
build_src_filter = ${rp2040_base.build_src_filter} +<mesh/wifi/>
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
${networking_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
54
variants/rp2040/rpipicow/variant.h
Normal file
54
variants/rp2040/rpipicow/variant.h
Normal file
@@ -0,0 +1,54 @@
|
||||
// #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 LED_PIN LED_BUILTIN
|
||||
|
||||
#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
|
||||
50
variants/rp2040/senselora_rp2040/pins_arduino.h
Normal file
50
variants/rp2040/senselora_rp2040/pins_arduino.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#define PIN_A0 (26u)
|
||||
#define PIN_A1 (27u)
|
||||
#define PIN_A2 (28u)
|
||||
#define PIN_A3 (29u)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
static const uint8_t A2 = PIN_A2;
|
||||
static const uint8_t A3 = PIN_A3;
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (23u)
|
||||
#define PIN_LED1 PIN_LED
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
#define ADC_RESOLUTION 12
|
||||
|
||||
// Serial
|
||||
#define PIN_SERIAL1_TX (0ul)
|
||||
#define PIN_SERIAL1_RX (1ul)
|
||||
|
||||
#define PIN_SERIAL2_TX (4ul)
|
||||
#define PIN_SERIAL2_RX (5ul)
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (16u)
|
||||
#define PIN_SPI0_MOSI (19u)
|
||||
#define PIN_SPI0_SCK (18u)
|
||||
#define PIN_SPI0_SS (17u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (6u)
|
||||
#define PIN_WIRE0_SCL (7u)
|
||||
|
||||
#define PIN_WIRE1_SDA (-1)
|
||||
#define PIN_WIRE1_SCL (-1)
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
static const uint8_t SS = PIN_SPI0_SS;
|
||||
static const uint8_t MOSI = PIN_SPI0_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI0_MISO;
|
||||
static const uint8_t SCK = PIN_SPI0_SCK;
|
||||
|
||||
static const uint8_t SDA = PIN_WIRE0_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE0_SCL;
|
||||
13
variants/rp2040/senselora_rp2040/platformio.ini
Normal file
13
variants/rp2040/senselora_rp2040/platformio.ini
Normal file
@@ -0,0 +1,13 @@
|
||||
[env:senselora_rp2040]
|
||||
board_level = extra
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
upload_protocol = picotool
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${rp2040_base.build_flags}
|
||||
-D SENSELORA_RP2040
|
||||
-I variants/rp2040/senselora_rp2040
|
||||
-D DEBUG_RP2040_PORT=Serial
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
28
variants/rp2040/senselora_rp2040/variant.h
Normal file
28
variants/rp2040/senselora_rp2040/variant.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
#define USE_SSD1306
|
||||
|
||||
#define BUTTON_PIN 2
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
#define ledOff(pin) pinMode(pin, INPUT)
|
||||
|
||||
#undef BATTERY_PIN
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
#define USE_RF95
|
||||
#define LORA_SCK PIN_SPI0_SCK
|
||||
#define LORA_MISO PIN_SPI0_MISO
|
||||
#define LORA_MOSI PIN_SPI0_MOSI
|
||||
#define LORA_CS PIN_SPI0_SS
|
||||
|
||||
#define LORA_DIO0 21
|
||||
#define LORA_DIO1 22
|
||||
#define LORA_DIO2 RADIOLIB_NC
|
||||
#define LORA_RESET 20
|
||||
Reference in New Issue
Block a user