Skip to content

Commit 94a4b92

Browse files
committed
lora: LoRa Basics Modem backend for SX12xx chips
As a first integration of the LoRa Basics Modem backend, implement the LoRa API for the standard SX126x/SX127x chips. Much of the logic from `lbm_common.c` is taken from the loramac-node `sx12xx_common` implementation, but it should now be agnostic for all LoRa RF transceivers. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent 3010686 commit 94a4b92

File tree

8 files changed

+1616
-0
lines changed

8 files changed

+1616
-0
lines changed

drivers/lora/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
zephyr_sources_ifdef(CONFIG_LORA_SHELL shell.c)
44

55
add_subdirectory_ifdef(CONFIG_LORA_MODULE_BACKEND_LORAMAC_NODE loramac_node)
6+
add_subdirectory_ifdef(CONFIG_LORA_MODULE_BACKEND_LORA_BASICS_MODEM lora_basics_modem)

drivers/lora/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ config LORA_MODULE_BACKEND_LORAMAC_NODE
2222
bool "loramac-node backend"
2323
depends on ZEPHYR_LORAMAC_NODE_MODULE
2424

25+
config LORA_MODULE_BACKEND_LORA_BASICS_MODEM
26+
bool "LoRa Basic modem backend [EXPERIMENTAL]"
27+
depends on ZEPHYR_LORA_BASICS_MODEM_MODULE
28+
depends on DT_HAS_SEMTECH_SX1262_ENABLED || DT_HAS_SEMTECH_SX1261_ENABLED || DT_HAS_SEMTECH_SX1272_ENABLED || DT_HAS_SEMTECH_SX1276_ENABLED
29+
select USE_LORA_BASICS_MODEM_DRIVERS
30+
help
31+
Experimental support for implementing the LoRa API using the LoRa Basics Modem module.
32+
2533
endchoice
2634

2735
module = LORA
@@ -42,5 +50,6 @@ config LORA_INIT_PRIORITY
4250

4351
rsource "Kconfig.sx12xx"
4452
rsource "Kconfig.rylrxxx"
53+
rsource "lora_basics_modem/Kconfig"
4554

4655
endif # LORA
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# LoRa drivers depend on the include directories exposed by the lora_basics_modem
4+
# library. Hence, if it exists then the source files are added to that otherwise
5+
# a library with same name is created.
6+
if(TARGET lora_basics_modem)
7+
set(ZEPHYR_CURRENT_LIBRARY lora_basics_modem)
8+
else()
9+
zephyr_library_named(lora_basics_modem)
10+
endif()
11+
12+
zephyr_library_sources(lbm_common.c)
13+
zephyr_library_sources_ifdef(CONFIG_LORA_SX126X lbm_sx126x.c)
14+
zephyr_library_sources_ifdef(CONFIG_LORA_SX127X lbm_sx127x.c)
15+
zephyr_library_sources_ifdef(CONFIG_LORA_RYLRXXX ../rylrxxx.c)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2025 Embeint Inc
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
if LORA_MODULE_BACKEND_LORA_BASICS_MODEM
8+
9+
config LORA_BASICS_MODEM_ASYNC_RX_MAX_PAYLOAD
10+
int "Maximum size payload that can be received by async RX"
11+
default 256
12+
help
13+
A buffer of this size is allocated on the system workqueue stack when
14+
running the async RX handler.
15+
16+
endif

0 commit comments

Comments
 (0)