Skip to content

Commit 1c01542

Browse files
authored
Merge pull request #727 from recrof/waveshare_rp2040_lora_refactor
tidy up waveshare rp2040 lora variant
2 parents 605210d + c2fc700 commit 1c01542

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

src/helpers/rp2040/WaveshareBoard.h renamed to variants/waveshare_rp2040_lora/WaveshareBoard.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
// LoRa radio module pins for Waveshare RP2040-LoRa-HF/LF
77
// https://files.waveshare.com/wiki/RP2040-LoRa/Rp2040-lora-sch.pdf
88

9-
#define P_LORA_DIO_1 16
10-
#define P_LORA_NSS 13 // CS
11-
#define P_LORA_RESET 23
12-
#define P_LORA_BUSY 18
13-
#define P_LORA_SCLK 14
14-
#define P_LORA_MISO 24
15-
#define P_LORA_MOSI 15
16-
#define P_LORA_TX_LED 25
17-
18-
#define SX126X_DIO2_AS_RF_SWITCH true
19-
#define SX126X_DIO3_TCXO_VOLTAGE 0
20-
219
/*
2210
* This board has no built-in way to read battery voltage.
2311
* Nevertheless it's very easy to make it work, you only require two 1% resistors.

variants/waveshare_rp2040_lora/platformio.ini

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,34 @@
33

44
[waveshare_rp2040_lora]
55
extends = rp2040_base
6-
76
board = pico
87
board_build.filesystem_size = 0.5m
9-
108
build_flags = ${rp2040_base.build_flags}
119
-I variants/waveshare_rp2040_lora
1210
-D SX126X_CURRENT_LIMIT=140
1311
-D RADIO_CLASS=CustomSX1262
1412
-D WRAPPER_CLASS=CustomSX1262Wrapper
15-
-D LORA_TX_POWER=22
13+
-D P_LORA_DIO_1=16
14+
-D P_LORA_NSS=13 ; CS
15+
-D P_LORA_RESET=23
16+
-D P_LORA_BUSY=18
17+
-D P_LORA_SCLK=14
18+
-D P_LORA_MISO=24
19+
-D P_LORA_MOSI=15
20+
-D P_LORA_TX_LED=25
21+
-D SX126X_DIO2_AS_RF_SWITCH=true
22+
-D SX126X_DIO3_TCXO_VOLTAGE=0
1623
-D SX126X_RX_BOOSTED_GAIN=1
24+
-D LORA_TX_POWER=22
1725
; Debug options
1826
; -D DEBUG_RP2040_WIRE=1
1927
; -D DEBUG_RP2040_SPI=1
2028
; -D DEBUG_RP2040_CORE=1
2129
; -D RADIOLIB_DEBUG_SPI=1
2230
; -D DEBUG_RP2040_PORT=Serial
23-
2431
build_src_filter = ${rp2040_base.build_src_filter}
25-
+<helpers/rp2040/WaveshareBoard.cpp>
32+
+<WaveshareBoard.cpp>
2633
+<../variants/waveshare_rp2040_lora>
27-
2834
lib_deps = ${rp2040_base.lib_deps}
2935

3036
[env:waveshare_rp2040_lora_Repeater]

variants/waveshare_rp2040_lora/target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <helpers/radiolib/CustomSX1262Wrapper.h>
88
#include <helpers/radiolib/RadioLibWrappers.h>
99
#include <helpers/SensorManager.h>
10-
#include <helpers/rp2040/WaveshareBoard.h>
10+
#include <WaveshareBoard.h>
1111

1212
extern WaveshareBoard board;
1313
extern WRAPPER_CLASS radio_driver;

0 commit comments

Comments
 (0)