Skip to content

Commit f580fb6

Browse files
committed
boards: shields: Add configuration for LoRa LR11xx and SX126x shields
Those shields are sold by Semtech and are arduino compatible. Signed-off-by: Félix Piédallu <[email protected]>
1 parent 91c99f3 commit f580fb6

19 files changed

+658
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2024 Semtech Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_SEMTECH_LR1110MB1xxS
5+
def_bool $(shields_list_contains,semtech_lr1110mb1xxs)
6+
7+
config SHIELD_SEMTECH_LR1120MB1xxS
8+
def_bool $(shields_list_contains,semtech_lr1120mb1xxs)
9+
10+
config SHIELD_SEMTECH_LR1121MB1xxS
11+
def_bool $(shields_list_contains,semtech_lr1121mb1xxs)
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
.. semtech_lr11xxmb1xxs:
2+
3+
Semtech LR11xxMB1xxS LoRa Shields
4+
#################################
5+
6+
Overview
7+
********
8+
9+
Semtech provides a series of Arduino compatible shields based on their LoRa
10+
transceivers LR1110, LR1120, and LR1121.
11+
Those shields are mostly similar and include a LIS2DE12 3-axis i2c accelerometer
12+
from STMicroelectronics.
13+
14+
More information about the shield can be found at the `Semtech LR1110MB1LBKS
15+
website`_.
16+
17+
Pins Assignment of the Semtech LR1110MB1xxS LoRa Shield
18+
=======================================================
19+
20+
+-------------+---------------------+
21+
| Shield Pin | Function |
22+
+=============+=====================+
23+
| A0 | LR1110 NRESET |
24+
+-------------+---------------------+
25+
| A1 | 32kHz Osc out |
26+
+-------------+---------------------+
27+
| A2 | LR111x / LR1110 |
28+
+-------------+---------------------+
29+
| A3 | LNA Control |
30+
+-------------+---------------------+
31+
| A4 | LED TX |
32+
+-------------+---------------------+
33+
| A5 | LED RX |
34+
+-------------+---------------------+
35+
| D2 | To Display Shield |
36+
+-------------+---------------------+
37+
| D3 | LR1110 DIO0 (BUSY) |
38+
+-------------+---------------------+
39+
| D4 | LED Sniffing |
40+
+-------------+---------------------+
41+
| D5 | LR1110 DIO9 |
42+
+-------------+---------------------+
43+
| D7 | LR1110 SPI NSS |
44+
+-------------+---------------------+
45+
| D8 | MEMS Accel INT1 |
46+
+-------------+---------------------+
47+
| D9 | Display D/C |
48+
+-------------+---------------------+
49+
| D10 | Display CS |
50+
+-------------+---------------------+
51+
| D11 | LR1110 SPI MOSI |
52+
+-------------+---------------------+
53+
| D12 | LR1110 SPI MISO |
54+
+-------------+---------------------+
55+
| D13 | LR1110 SPI SCK |
56+
+-------------+---------------------+
57+
| D14 | MEMS+EEPROM i2c SDA |
58+
+-------------+---------------------+
59+
| D15 | MEMS+EEPROM i2c SCL |
60+
+-------------+---------------------+
61+
62+
LR1110 and LR1120 based shields use a TCXO and LR1121 based shields use a crystal.
63+
64+
Requirements
65+
************
66+
67+
This shield can only be used with a board which provides a configuration for
68+
Arduino connectors and defines node aliases for SPI and GPIO interfaces (see
69+
:ref:`shields` for more details).
70+
71+
Programming
72+
***********
73+
74+
Set ``-DSHIELD=semtech_lr1110mb1xxs`` when you invoke ``west build``. For
75+
example:
76+
77+
.. zephyr-app-commands::
78+
:zephyr-app: samples/subsys/lorawan/class_a
79+
:board: nucleo_l073rz
80+
:shield: semtech_lr1110mb1xxs
81+
:goals: build
82+
83+
References
84+
**********
85+
86+
.. target-notes::
87+
88+
.. _Semtech LR1110MB1LBKS website:
89+
https://www.semtech.com/products/wireless-rf/lora-edge/lr1110mb1lbks
90+
91+
92+
License
93+
*******
94+
95+
This document Copyright (c) 2024 Semtech Corporation
96+
97+
SPDX-License-Identifier: Apache-2.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2024 Semtech Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "semtech_lr11xxmb1xxs_common.dtsi"
8+
9+
lora_semtech_lr1110mb1xxs: &lora_semtech_lr11xxmb1xxs {
10+
compatible = "semtech,lr1110";
11+
12+
tcxo-wakeup-time = <8>;
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2024 Semtech Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "semtech_lr11xxmb1xxs_common.dtsi"
8+
9+
lora_semtech_lr1120mb1xxs: &lora_semtech_lr11xxmb1xxs {
10+
compatible = "semtech,lr1120";
11+
12+
tcxo-wakeup-time = <8>;
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2024 Semtech Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "semtech_lr11xxmb1xxs_common.dtsi"
8+
9+
lora_semtech_lr1121mb1xxs: &lora_semtech_lr11xxmb1xxs {
10+
compatible = "semtech,lr1121";
11+
12+
/* LR1121 shields all have XTAL */
13+
};
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/*
2+
* Copyright (c) 2024 Semtech Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/lora_lbm/lr11xx.h>
8+
9+
/ {
10+
chosen {
11+
zephyr,lorawan-transceiver = &lora_semtech_lr11xxmb1xxs;
12+
};
13+
aliases {
14+
lora-transceiver = &lora_semtech_lr11xxmb1xxs;
15+
};
16+
leds {
17+
lora_rx_led: lr11xx_rx_led {
18+
gpios = <&arduino_header 5 GPIO_ACTIVE_HIGH>;
19+
label = "RX LED";
20+
};
21+
lora_tx_led: lr11xx_tx_led {
22+
gpios = <&arduino_header 4 GPIO_ACTIVE_HIGH>;
23+
label = "TX LED";
24+
};
25+
lora_scanning_led: lr11xx_scanning_led {
26+
gpios = <&arduino_header 10 GPIO_ACTIVE_HIGH>;
27+
label = "Scanning LED";
28+
};
29+
lora_gnss_lna_control: lr11xx_gnss_lna_control {
30+
/* Not an LED but necessary */
31+
gpios = <&arduino_header 3 GPIO_ACTIVE_HIGH>;
32+
label = "LR11xx GNSS LNA control";
33+
};
34+
};
35+
};
36+
37+
38+
&arduino_spi {
39+
status = "okay";
40+
41+
cs-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>;
42+
43+
lora_semtech_lr11xxmb1xxs: lora@0 {
44+
reg = <0>;
45+
spi-max-frequency = <DT_FREQ_M(4)>;
46+
47+
reset-gpios = <&arduino_header 0 GPIO_ACTIVE_LOW>;
48+
49+
busy-gpios = <&arduino_header 9 GPIO_ACTIVE_HIGH>;
50+
51+
event-gpios = <&arduino_header 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
52+
53+
lf-tx-path = <LR11XX_TX_PATH_LF_LP_HP>;
54+
55+
lf-clk = <LR11XX_LFCLK_XTAL>;
56+
reg-mode = <LR11XX_REG_MODE_DCDC>;
57+
58+
rf-sw-enable = <(LR11XX_DIO5 | LR11XX_DIO6 | LR11XX_DIO7)>;
59+
rf-sw-rx-mode = <LR11XX_DIO5>;
60+
rf-sw-tx-mode = <(LR11XX_DIO5 | LR11XX_DIO6)>;
61+
rf-sw-tx-hp-mode = <LR11XX_DIO6>;
62+
rf-sw-gnss-mode = <LR11XX_DIO7>;
63+
64+
tcxo-voltage = <LR11XX_TCXO_SUPPLY_1_8V>;
65+
/* Default to XTAL board */
66+
tcxo-wakeup-time = <0>;
67+
68+
tx-power-cfg-lf-lp =
69+
/* power, pa_duty_cycle, pa_hp_sel */
70+
< (-15) 0x00 0x00>, /* Expected output power = -17dBm */
71+
< (-14) 0x00 0x00>, /* Expected output power = -16dBm */
72+
< (-13) 0x00 0x00>, /* Expected output power = -15dBm */
73+
< (-12) 0x00 0x00>, /* Expected output power = -14dBm */
74+
< (-11) 0x00 0x00>, /* Expected output power = -13dBm */
75+
< (-9) 0x00 0x00>, /* Expected output power = -12dBm */
76+
< (-8) 0x00 0x00>, /* Expected output power = -11dBm */
77+
< (-7) 0x00 0x00>, /* Expected output power = -10dBm */
78+
< (-6) 0x00 0x00>, /* Expected output power = -9dBm */
79+
< (-5) 0x00 0x00>, /* Expected output power = -8dBm */
80+
< (-4) 0x00 0x00>, /* Expected output power = -7dBm */
81+
< (-3) 0x00 0x00>, /* Expected output power = -6dBm */
82+
< (-2) 0x00 0x00>, /* Expected output power = -5dBm */
83+
< (-1) 0x00 0x00>, /* Expected output power = -4dBm */
84+
< ( 0) 0x00 0x00>, /* Expected output power = -3dBm */
85+
< ( 1) 0x00 0x00>, /* Expected output power = -2dBm */
86+
< ( 2) 0x00 0x00>, /* Expected output power = -1dBm */
87+
< ( 3) 0x00 0x00>, /* Expected output power = 0dBm */
88+
< ( 3) 0x01 0x00>, /* Expected output power = 1dBm */
89+
< ( 4) 0x01 0x00>, /* Expected output power = 2dBm */
90+
< ( 7) 0x00 0x00>, /* Expected output power = 3dBm */
91+
< ( 8) 0x00 0x00>, /* Expected output power = 4dBm */
92+
< ( 9) 0x00 0x00>, /* Expected output power = 5dBm */
93+
< ( 10) 0x00 0x00>, /* Expected output power = 6dBm */
94+
< ( 12) 0x00 0x00>, /* Expected output power = 7dBm */
95+
< ( 13) 0x00 0x00>, /* Expected output power = 8dBm */
96+
< ( 14) 0x00 0x00>, /* Expected output power = 9dBm */
97+
< ( 13) 0x01 0x00>, /* Expected output power = 10dBm */
98+
< ( 13) 0x02 0x00>, /* Expected output power = 11dBm */
99+
< ( 14) 0x02 0x00>, /* Expected output power = 12dBm */
100+
< ( 14) 0x03 0x00>, /* Expected output power = 13dBm */
101+
< ( 14) 0x04 0x00>, /* Expected output power = 14dBm */
102+
< ( 14) 0x07 0x00>; /* Expected output power = 15dBm */
103+
104+
tx-power-cfg-lf-hp =
105+
/* power, pa_duty_cycle, pa_hp_sel */
106+
< ( 9) 0x00 0x00>, /* Expected output power = -9dBm */
107+
< ( 10) 0x00 0x00>, /* Expected output power = -8dBm */
108+
< ( 11) 0x00 0x00>, /* Expected output power = -7dBm */
109+
< ( 12) 0x00 0x00>, /* Expected output power = -6dBm */
110+
< ( 13) 0x00 0x00>, /* Expected output power = -5dBm */
111+
< ( 13) 0x01 0x00>, /* Expected output power = -4dBm */
112+
< ( 13) 0x02 0x00>, /* Expected output power = -3dBm */
113+
< ( 17) 0x02 0x00>, /* Expected output power = -2dBm */
114+
< ( 14) 0x04 0x00>, /* Expected output power = -1dBm */
115+
< ( 12) 0x00 0x01>, /* Expected output power = 0dBm */
116+
< ( 13) 0x00 0x01>, /* Expected output power = 1dBm */
117+
< ( 13) 0x01 0x01>, /* Expected output power = 2dBm */
118+
< ( 13) 0x02 0x01>, /* Expected output power = 3dBm */
119+
< ( 15) 0x00 0x02>, /* Expected output power = 4dBm */
120+
< ( 15) 0x04 0x01>, /* Expected output power = 5dBm */
121+
< ( 14) 0x02 0x02>, /* Expected output power = 6dBm */
122+
< ( 14) 0x01 0x03>, /* Expected output power = 7dBm */
123+
< ( 17) 0x04 0x02>, /* Expected output power = 8dBm */
124+
< ( 22) 0x00 0x01>, /* Expected output power = 9dBm */
125+
< ( 22) 0x01 0x01>, /* Expected output power = 10dBm */
126+
< ( 22) 0x02 0x01>, /* Expected output power = 11dBm */
127+
< ( 22) 0x03 0x01>, /* Expected output power = 12dBm */
128+
< ( 22) 0x00 0x03>, /* Expected output power = 13dBm */
129+
< ( 22) 0x01 0x03>, /* Expected output power = 14dBm */
130+
< ( 22) 0x04 0x02>, /* Expected output power = 15dBm */
131+
< ( 22) 0x01 0x04>, /* Expected output power = 16dBm */
132+
< ( 22) 0x02 0x04>, /* Expected output power = 17dBm */
133+
< ( 22) 0x01 0x06>, /* Expected output power = 18dBm */
134+
< ( 22) 0x03 0x05>, /* Expected output power = 19dBm */
135+
< ( 22) 0x03 0x07>, /* Expected output power = 20dBm */
136+
< ( 22) 0x04 0x06>, /* Expected output power = 21dBm */
137+
< ( 22) 0x04 0x07>; /* Expected output power = 22dBm */
138+
139+
tx-power-cfg-hf =
140+
/* power, pa_duty_cycle, pa_hp_sel */
141+
< (-18) 0x04 0x00>, //Expected output power = -18dBm
142+
< (-18) 0x04 0x00>, /* Expected output power = -17dBm */
143+
< (-17) 0x04 0x00>, /* Expected output power = -16dBm */
144+
< (-16) 0x04 0x00>, /* Expected output power = -15dBm */
145+
< (-15) 0x04 0x00>, /* Expected output power = -14dBm */
146+
< (-14) 0x04 0x00>, /* Expected output power = -13dBm */
147+
< (-14) 0x04 0x00>, /* Expected output power = -12dBm */
148+
< (-12) 0x04 0x00>, /* Expected output power = -11dBm */
149+
< (-10) 0x04 0x00>, /* Expected output power = -10dBm */
150+
< ( -9) 0x04 0x00>, /* Expected output power = -9dBm */
151+
< ( -8) 0x04 0x00>, /* Expected output power = -8dBm */
152+
< ( -7) 0x04 0x00>, /* Expected output power = -7dBm */
153+
< ( -6) 0x04 0x00>, /* Expected output power = -6dBm */
154+
< ( -5) 0x04 0x00>, /* Expected output power = -5dBm */
155+
< ( -4) 0x04 0x00>, /* Expected output power = -4dBm */
156+
< ( -3) 0x04 0x00>, /* Expected output power = -3dBm */
157+
< ( -2) 0x03 0x00>, /* Expected output power = -2dBm */
158+
< ( -1) 0x04 0x00>, /* Expected output power = -1dBm */
159+
< ( 0) 0x04 0x00>, /* Expected output power = 0dBm */
160+
< ( 1) 0x00 0x00>, /* Expected output power = 1dBm */
161+
< ( 2) 0x00 0x00>, /* Expected output power = 2dBm */
162+
< ( 4) 0x04 0x00>, /* Expected output power = 3dBm */
163+
< ( 5) 0x04 0x00>, /* Expected output power = 4dBm */
164+
< ( 6) 0x04 0x00>, /* Expected output power = 5dBm */
165+
< ( 7) 0x04 0x00>, /* Expected output power = 6dBm */
166+
< ( 8) 0x04 0x00>, /* Expected output power = 7dBm */
167+
< ( 9) 0x04 0x00>, /* Expected output power = 8dBm */
168+
< ( 10) 0x04 0x00>, /* Expected output power = 9dBm */
169+
< ( 11) 0x04 0x00>, /* Expected output power = 10dBm */
170+
< ( 12) 0x03 0x00>, /* Expected output power = 11dBm */
171+
< ( 13) 0x04 0x00>, /* Expected output power = 12dBm */
172+
< ( 13) 0x00 0x00>; /* Expected output power = 13dBm */
173+
174+
175+
/* Tune is G4 G5 G6 G7 G8 G9 G10 G11 G12 G13
176+
* G13hp1 G13hp2 G13hp3 G13hp4 G13hp5 G13hp6 G13hp7
177+
*/
178+
rssi-calibration-lf-offset = <0>;
179+
rssi-calibration-lf-tune = <12 12 14 0 1 3 4 4 3 6 6 6 6 6 6 6 6>;
180+
181+
rssi-calibration-mf-offset = <0>;
182+
rssi-calibration-mf-tune = <2 2 2 3 3 4 5 4 4 6 5 5 6 6 6 7 6>;
183+
184+
rssi-calibration-hf-offset = <2030>;
185+
rssi-calibration-hf-tune = <6 7 6 4 3 4 14 12 14 12 12 12 12 8 8 9 9>;
186+
187+
};
188+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2024 Semtech Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_SEMTECH_SX1261MB1BAS
5+
def_bool $(shields_list_contains,semtech_sx1261mb1bas)
6+
7+
config SHIELD_SEMTECH_SX1261MB1CAS
8+
def_bool $(shields_list_contains,semtech_sx1261mb1cas)
9+
10+
config SHIELD_SEMTECH_SX1261MB2BAS
11+
def_bool $(shields_list_contains,semtech_sx1261mb2bas)
12+
13+
14+
config SHIELD_SEMTECH_SX1262MB1CAS
15+
def_bool $(shields_list_contains,semtech_sx1262mb1cas)
16+
17+
config SHIELD_SEMTECH_SX1262MB1CBS
18+
def_bool $(shields_list_contains,semtech_sx1262mb1cbs)
19+
20+
config SHIELD_SEMTECH_SX1262MB1DAS
21+
def_bool $(shields_list_contains,semtech_sx1262mb1das)
22+
23+
config SHIELD_SEMTECH_SX1262MB1PAS
24+
def_bool $(shields_list_contains,semtech_sx1262mb1pas)
25+
26+
config SHIELD_SEMTECH_SX1262MB2CAS
27+
def_bool $(shields_list_contains,semtech_sx1262mb2cas)
28+
29+
30+
config SHIELD_SEMTECH_SX1268MB1GAS
31+
def_bool $(shields_list_contains,semtech_sx1268mb1gas)

0 commit comments

Comments
 (0)