Skip to content

Commit c7b939d

Browse files
committed
lora: shift drivers to dedicated loramac-node folder
Move the current implementation of the LoRa API using `loramac-node` to a dedicated folder in preparation for the LoRa basics modem implementation. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent bbc56b3 commit c7b939d

File tree

12 files changed

+38
-26
lines changed

12 files changed

+38
-26
lines changed

drivers/lora/CMakeLists.txt

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
# LoRa drivers depend on the include directories exposed by the loramac-node
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 loramac-node)
7-
set(ZEPHYR_CURRENT_LIBRARY loramac-node)
8-
else()
9-
zephyr_library_named(loramac-node)
10-
endif()
3+
zephyr_sources_ifdef(CONFIG_LORA_SHELL shell.c)
114

12-
zephyr_library_sources_ifdef(CONFIG_LORA_SHELL shell.c)
13-
zephyr_library_sources_ifdef(CONFIG_HAS_SEMTECH_RADIO_DRIVERS hal_common.c)
14-
zephyr_library_sources_ifdef(CONFIG_HAS_SEMTECH_RADIO_DRIVERS sx12xx_common.c)
15-
zephyr_library_sources_ifdef(CONFIG_LORA_SX127X sx127x.c)
16-
17-
if (CONFIG_LORA_SX126X OR CONFIG_LORA_STM32WL_SUBGHZ_RADIO)
18-
zephyr_library_sources(sx126x.c)
19-
endif()
20-
21-
zephyr_library_sources_ifdef(CONFIG_LORA_SX126X sx126x_standalone.c)
22-
zephyr_library_sources_ifdef(CONFIG_LORA_STM32WL_SUBGHZ_RADIO sx126x_stm32wl.c)
23-
zephyr_library_sources_ifdef(CONFIG_LORA_RYLRXXX rylrxxx.c)
5+
add_subdirectory_ifdef(CONFIG_LORA_MODULE_BACKEND_LORAMAC_NODE loramac_node)

drivers/lora/Kconfig

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ menuconfig LORA
1515

1616
if LORA
1717

18+
choice LORA_MODULE_BACKEND
19+
prompt "Low-level LoRa modem integration to use"
20+
21+
config LORA_MODULE_BACKEND_LORAMAC_NODE
22+
bool "loramac-node backend"
23+
depends on ZEPHYR_LORAMAC_NODE_MODULE
24+
25+
endchoice
26+
1827
module = LORA
1928
module-str = lora
2029
source "subsys/logging/Kconfig.template.log_config"
@@ -31,8 +40,7 @@ config LORA_INIT_PRIORITY
3140
help
3241
System initialization priority for LoRa drivers.
3342

34-
source "drivers/lora/Kconfig.sx12xx"
35-
36-
source "drivers/lora/Kconfig.rylrxxx"
43+
rsource "Kconfig.sx12xx"
44+
rsource "Kconfig.rylrxxx"
3745

3846
endif # LORA
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# LoRa drivers depend on the include directories exposed by the loramac-node
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 loramac-node)
7+
set(ZEPHYR_CURRENT_LIBRARY loramac-node)
8+
else()
9+
zephyr_library_named(loramac-node)
10+
endif()
11+
12+
zephyr_library_sources_ifdef(CONFIG_HAS_SEMTECH_RADIO_DRIVERS hal_common.c)
13+
zephyr_library_sources_ifdef(CONFIG_HAS_SEMTECH_RADIO_DRIVERS sx12xx_common.c)
14+
zephyr_library_sources_ifdef(CONFIG_LORA_SX127X sx127x.c)
15+
16+
if (CONFIG_LORA_SX126X OR CONFIG_LORA_STM32WL_SUBGHZ_RADIO)
17+
zephyr_library_sources(sx126x.c)
18+
endif()
19+
20+
zephyr_library_sources_ifdef(CONFIG_LORA_SX126X sx126x_standalone.c)
21+
zephyr_library_sources_ifdef(CONFIG_LORA_STM32WL_SUBGHZ_RADIO sx126x_stm32wl.c)
22+
zephyr_library_sources_ifdef(CONFIG_LORA_RYLRXXX ../rylrxxx.c)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)