mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-06 01:48:13 +00:00
Merge branch 'master' into raspi-portduino
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
|
||||
#define ADC_MULTIPLIER 4.9
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
|
||||
#define ADC_MULTIPLIER 4.9
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
68
variants/rak11310/pins_arduino.h
Normal file
68
variants/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_SPI0_MISO (12u)
|
||||
#define PIN_SPI0_MOSI (11u)
|
||||
#define PIN_SPI0_SCK (10u)
|
||||
#define PIN_SPI0_SS (13u)
|
||||
|
||||
#define PIN_SPI1_MISO (16u)
|
||||
#define PIN_SPI1_MOSI (19u)
|
||||
#define PIN_SPI1_SCK (18u)
|
||||
#define PIN_SPI1_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;
|
||||
13
variants/rak11310/platformio.ini
Normal file
13
variants/rak11310/platformio.ini
Normal file
@@ -0,0 +1,13 @@
|
||||
[env:rak11310]
|
||||
extends = rp2040_base
|
||||
board = wiscore_rak11300
|
||||
upload_protocol = picotool
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${rp2040_base.build_flags}
|
||||
-DRAK11310
|
||||
-Ivariants/rak11310
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
54
variants/rak11310/variant.h
Normal file
54
variants/rak11310/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
|
||||
|
||||
#undef CBC
|
||||
#define CBC 0
|
||||
#undef CTR
|
||||
#define CTR 1
|
||||
#undef ECB
|
||||
#define ECB 0
|
||||
|
||||
#undef GPS_SERIAL_NUM
|
||||
|
||||
#define LED_CONN PIN_LED2
|
||||
#define LED_PIN LED_BUILTIN
|
||||
|
||||
#define BUTTON_PIN 9
|
||||
#define BUTTON_NEED_PULLUP
|
||||
// #define EXT_NOTIFY_OUT 4
|
||||
|
||||
#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_SX1262
|
||||
|
||||
#undef RF95_SCK
|
||||
#undef RF95_MISO
|
||||
#undef RF95_MOSI
|
||||
#undef RF95_NSS
|
||||
|
||||
// RAK BSP somehow uses SPI1 instead of SPI0
|
||||
#define HW_SPI1_DEVICE
|
||||
#define RF95_SCK PIN_SPI0_SCK
|
||||
#define RF95_MOSI PIN_SPI0_MOSI
|
||||
#define RF95_MISO PIN_SPI0_MISO
|
||||
#define RF95_NSS PIN_SPI0_SS
|
||||
|
||||
#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 RF95_NSS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_POWER_EN 25
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#endif
|
||||
@@ -258,6 +258,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
#define PIN_ETHERNET_RESET 21
|
||||
#define PIN_ETHERNET_SS PIN_EINK_CS
|
||||
#define ETH_SPI_PORT SPI1
|
||||
#define AQ_SET_PIN 10
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -267,4 +268,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,18 +1,14 @@
|
||||
[env:pico]
|
||||
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}
|
||||
-DPRIVATE_HW
|
||||
-DRPI_PICO
|
||||
-Ivariants/rpipico
|
||||
-DARDUINO_AVR_NANO_EVERY
|
||||
-DDEBUG_RP2040_WIRE
|
||||
-DDEBUG_RP2040_SPI
|
||||
-DDEBUG_RP2040_CORE
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DUSE_TINYUSB
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
@@ -4,8 +4,11 @@
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
#undef CBC
|
||||
#define CBC 0
|
||||
#undef CTR
|
||||
#define CTR 1
|
||||
#undef ECB
|
||||
#define ECB 0
|
||||
|
||||
#define NO_GPS 1
|
||||
@@ -18,11 +21,12 @@
|
||||
#define BUTTON_PIN 17
|
||||
#define EXT_NOTIFY_OUT 4
|
||||
|
||||
#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
|
||||
#define USE_SX1262
|
||||
|
||||
#undef RF95_SCK
|
||||
@@ -47,6 +51,4 @@
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#endif
|
||||
|
||||
#include <Adafruit_TinyUSB.h>
|
||||
#endif
|
||||
@@ -6,13 +6,10 @@ upload_protocol = picotool
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${rp2040_base.build_flags}
|
||||
-DPRIVATE_HW
|
||||
-DRPI_PICO
|
||||
-Ivariants/rpipicow
|
||||
-DARDUINO_AVR_NANO_EVERY
|
||||
-DDEBUG_RP2040_WIRE
|
||||
-DDEBUG_RP2040_SPI
|
||||
-DDEBUG_RP2040_CORE
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DUSE_TINYUSB
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
@@ -4,8 +4,11 @@
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
#undef CBC
|
||||
#define CBC 0
|
||||
#undef CTR
|
||||
#define CTR 1
|
||||
#undef ECB
|
||||
#define ECB 0
|
||||
|
||||
#define NO_GPS 1
|
||||
@@ -22,7 +25,6 @@
|
||||
// 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
|
||||
#define USE_SX1262
|
||||
|
||||
#undef RF95_SCK
|
||||
@@ -47,6 +49,4 @@
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#endif
|
||||
|
||||
#include <Adafruit_TinyUSB.h>
|
||||
#endif
|
||||
@@ -1,5 +1,11 @@
|
||||
[env:wio-e5]
|
||||
extends = stm32wl5e_base
|
||||
board_level = extra
|
||||
build_flags = ${stm32wl5e_base.build_flags} -Ivariants/wio-e5 -DHAL_DAC_MODULE_ONLY
|
||||
-DSERIAL_UART_INSTANCE=1 -DPIN_SERIAL_RX=PB7 -DPIN_SERIAL_TX=PB6
|
||||
build_flags =
|
||||
${stm32wl5e_base.build_flags}
|
||||
-Ivariants/wio-e5
|
||||
-DHAL_DAC_MODULE_ONLY
|
||||
-DSERIAL_UART_INSTANCE=1
|
||||
-DPIN_SERIAL_RX=PB7
|
||||
-DPIN_SERIAL_TX=PB6
|
||||
upload_port = stlink
|
||||
@@ -12,18 +12,6 @@ Do not expect a working Meshtastic device with this target.
|
||||
#ifndef _VARIANT_WIOE5_
|
||||
#define _VARIANT_WIOE5_
|
||||
|
||||
// Arduino/PlatformIO support for SUBGHZSPI is not currently available
|
||||
//#define USE_SX1262
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define HAS_RADIO 1
|
||||
|
||||
/* module only transmits through RFO_HP */
|
||||
#define SX126X_RXEN PA5
|
||||
#define SX126X_TXEN PA4
|
||||
|
||||
/* TCXO fed by internal LDO option behind PB0 pin */
|
||||
#define SX126X_E22
|
||||
#endif
|
||||
#define USE_STM32WLx
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user