Skip to content

Commit bda1ce8

Browse files
committed
Add alternative, inactive pin config for Waveshare SX1262 module to examples:
- hello_abp - hello_otaa examples - otaa_temperature_led
1 parent ecd1491 commit bda1ce8

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

examples/hello_abp/main.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,38 @@
1919
// edit with LoRaWAN Node Region and ABP settings
2020
#include "config.h"
2121

22-
// pin configuration for SX1276 radio module
22+
/*
23+
* Pin configuration for SX1276 radio module (default)
24+
*/
2325
const struct lorawan_sx12xx_settings sx12xx_settings = {
2426
.spi = {
2527
.inst = PICO_DEFAULT_SPI_INSTANCE,
2628
.mosi = PICO_DEFAULT_SPI_TX_PIN,
2729
.miso = PICO_DEFAULT_SPI_RX_PIN,
2830
.sck = PICO_DEFAULT_SPI_SCK_PIN,
29-
.nss = 8
31+
.nss = 8
3032
},
3133
.reset = 9,
32-
.dio0 = 7,
33-
.dio1 = 10
34+
.dio0 = 7,
35+
.dio1 = 10
3436
};
3537

38+
/*
39+
* Configuration for SX1262 Waveshare module
40+
*/
41+
//const struct lorawan_sx12xx_settings sx12xx_settings = {
42+
// .spi = {
43+
// .inst = spi1,
44+
// .mosi = 11,
45+
// .miso = 12,
46+
// .sck = 10,
47+
// .nss = 3
48+
// },
49+
// .reset = 15,
50+
// .busy = 2,
51+
// .dio1 = 20
52+
//};
53+
3654
// ABP settings
3755
const struct lorawan_abp_settings abp_settings = {
3856
.device_address = LORAWAN_DEV_ADDR,

examples/hello_otaa/main.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
// edit with LoRaWAN Node Region and OTAA settings
1919
#include "config.h"
2020

21-
// pin configuration for SX1276 radio module
21+
/*
22+
* Pin configuration for SX1276 radio module (default)
23+
*/
2224
const struct lorawan_sx12xx_settings sx12xx_settings = {
2325
.spi = {
2426
.inst = PICO_DEFAULT_SPI_INSTANCE,
@@ -32,6 +34,22 @@ const struct lorawan_sx12xx_settings sx12xx_settings = {
3234
.dio1 = 10
3335
};
3436

37+
/*
38+
* Configuration for SX1262 Waveshare module
39+
*/
40+
//const struct lorawan_sx12xx_settings sx12xx_settings = {
41+
// .spi = {
42+
// .inst = spi1,
43+
// .mosi = 11,
44+
// .miso = 12,
45+
// .sck = 10,
46+
// .nss = 3
47+
// },
48+
// .reset = 15,
49+
// .busy = 2,
50+
// .dio1 = 20
51+
//};
52+
3553
// OTAA settings
3654
const struct lorawan_otaa_settings otaa_settings = {
3755
.device_eui = LORAWAN_DEVICE_EUI,

examples/otaa_temperature_led/main.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
// edit with LoRaWAN Node Region and OTAA settings
2323
#include "config.h"
2424

25-
// pin configuration for SX1276 radio module
25+
/*
26+
* Pin configuration for SX1276 radio module (default)
27+
*/
2628
const struct lorawan_sx12xx_settings sx12xx_settings = {
2729
.spi = {
2830
.inst = PICO_DEFAULT_SPI_INSTANCE,
@@ -36,6 +38,22 @@ const struct lorawan_sx12xx_settings sx12xx_settings = {
3638
.dio1 = 10
3739
};
3840

41+
/*
42+
* Configuration for SX1262 Waveshare module
43+
*/
44+
//const struct lorawan_sx12xx_settings sx12xx_settings = {
45+
// .spi = {
46+
// .inst = spi1,
47+
// .mosi = 11,
48+
// .miso = 12,
49+
// .sck = 10,
50+
// .nss = 3
51+
// },
52+
// .reset = 15,
53+
// .busy = 2,
54+
// .dio1 = 20
55+
//};
56+
3957
// OTAA settings
4058
const struct lorawan_otaa_settings otaa_settings = {
4159
.device_eui = LORAWAN_DEVICE_EUI,

0 commit comments

Comments
 (0)