-
Notifications
You must be signed in to change notification settings - Fork 3.8k
basicstation, sx1302_hal: initial commit #19188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # | ||
| # Copyright (C) 2022 TDT AG <development@tdt.de> | ||
| # | ||
| # This is free software, licensed under the GNU General Public License v2. | ||
| # See /LICENSE for more information. | ||
| # | ||
| # | ||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_NAME:=sx1302_hal | ||
| PKG_VERSION:=2.1.0 | ||
| PKG_RELEASE:=$(AUTORELEASE) | ||
|
|
||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||
| PKG_SOURCE_URL:=https://codeload.github.com/Lora-net/sx1302_hal/tar.gz/V$(PKG_VERSION)? | ||
| PKG_HASH:=4b62aa6a83ad449c68fdd844fc35024586c9faabca3c5a90a2544735b380de5b | ||
|
|
||
| PKG_MAINTAINER:=Marcus Schref <mschref@tdt.de> | ||
| PKG_LICENSE:=MIT BSD-3-Clause | ||
| PKG_LICENSE_FILES:=LICENSE.TXT | ||
|
|
||
| include $(INCLUDE_DIR)/package.mk | ||
|
|
||
| define Package/sx1302_hal/Default | ||
| SECTION:=libs | ||
| CATEGORY:=Libraries | ||
| SUBMENU:=IoT | ||
| TITLE:=SX1302/SX1303 HAL | ||
| endef | ||
|
|
||
| define Package/sx1302_hal-tests | ||
| $(call Package/sx1302_hal/Default) | ||
| TITLE+=(Tests) | ||
| DEPENDS:=+kmod-usb-acm | ||
| endef | ||
|
|
||
| define Package/sx1302_hal-tests/description | ||
| Tests for SX1302/SX1303 Hardware Abstraction Layer | ||
| endef | ||
|
|
||
| define Package/sx1302_hal-utils | ||
| $(call Package/sx1302_hal/Default) | ||
| TITLE+=(Utilities) | ||
| DEPENDS:=+kmod-usb-acm | ||
| endef | ||
|
|
||
| define Package/sx1302_hal-utils/description | ||
| Utilities for SX1302/SX1303 Hardware Abstraction Layer | ||
| endef | ||
|
|
||
| CFLAGS = $(TARGET_CFLAGS) | ||
|
|
||
| define Build/Compile | ||
| $(MAKE) -C $(PKG_BUILD_DIR)/libtools \ | ||
| CROSS_COMPILE="$(TARGET_CROSS)" \ | ||
| ARCH="$(ARCH)" | ||
|
|
||
| $(MAKE) -C $(PKG_BUILD_DIR)/libloragw \ | ||
| CROSS_COMPILE="$(TARGET_CROSS)" \ | ||
| ARCH="$(ARCH)" | ||
|
|
||
| $(MAKE) -C $(PKG_BUILD_DIR)/util_boot \ | ||
| CROSS_COMPILE="$(TARGET_CROSS)" \ | ||
| ARCH="$(ARCH)" | ||
|
|
||
| $(MAKE) -C $(PKG_BUILD_DIR)/util_chip_id \ | ||
| CROSS_COMPILE="$(TARGET_CROSS)" \ | ||
| ARCH="$(ARCH)" | ||
|
|
||
| $(MAKE) -C $(PKG_BUILD_DIR)/util_net_downlink \ | ||
| CROSS_COMPILE="$(TARGET_CROSS)" \ | ||
| ARCH="$(ARCH)" | ||
|
|
||
| $(MAKE) -C $(PKG_BUILD_DIR)/util_spectral_scan \ | ||
| CROSS_COMPILE="$(TARGET_CROSS)" \ | ||
| ARCH="$(ARCH)" | ||
| endef | ||
|
|
||
| define Build/InstallDev | ||
| $(INSTALL_DIR) $(1)/usr/include | ||
| $(CP) $(PKG_BUILD_DIR)/libtools/inc/tinymt32.h $(1)/usr/include | ||
|
|
||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_BUILD_DIR)/libtools/libtinymt32.a $(1)/usr/lib | ||
|
|
||
| $(INSTALL_DIR) $(1)/usr/include/lgw | ||
| $(CP) $(PKG_BUILD_DIR)/libloragw/inc/*.h $(1)/usr/include/lgw | ||
|
|
||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_BUILD_DIR)/libloragw/*.a $(1)/usr/lib | ||
| endef | ||
|
|
||
| define Package/sx1302_hal-tests/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/libloragw/test* $(1)/usr/bin | ||
| endef | ||
|
|
||
| define Package/sx1302_hal-utils/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_boot/boot $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_chip_id/chip_id $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_net_downlink/net_downlink \ | ||
| $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_spectral_scan/spectral_scan \ | ||
| $(1)/usr/bin | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,sx1302_hal-tests)) | ||
| $(eval $(call BuildPackage,sx1302_hal-utils)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| From 389e8138f543baf334442ca52edf5f7b4cfe13dc Mon Sep 17 00:00:00 2001 | ||
| From: Marcus Schref <mschref@web.de> | ||
| Date: Mon, 22 Aug 2022 10:02:13 +0200 | ||
| Subject: [PATCH] sx1302_hal: edit cflags | ||
|
|
||
| Enable use of TARGET_CFLAGS in addition to specified CFLAGS | ||
|
|
||
| Signed-off-by: Marcus Schref <mschref@web.de> | ||
| --- | ||
| libloragw/Makefile | 2 +- | ||
| libtools/Makefile | 2 +- | ||
| 2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
|
||
| --- a/libloragw/Makefile | ||
| +++ b/libloragw/Makefile | ||
mars642 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @@ -11,7 +11,7 @@ CROSS_COMPILE ?= | ||
| CC := $(CROSS_COMPILE)gcc | ||
| AR := $(CROSS_COMPILE)ar | ||
|
|
||
| -CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libtools/inc | ||
| +CFLAGS += -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libtools/inc | ||
|
|
||
| OBJDIR = obj | ||
| INCLUDES = $(wildcard inc/*.h) $(wildcard ../libtools/inc/*.h) | ||
| --- a/libtools/Makefile | ||
| +++ b/libtools/Makefile | ||
| @@ -7,7 +7,7 @@ CROSS_COMPILE ?= | ||
| CC := $(CROSS_COMPILE)gcc | ||
| AR := $(CROSS_COMPILE)ar | ||
|
|
||
| -CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I. | ||
| +CFLAGS += -O2 -Wall -Wextra -std=c99 -Iinc -I. | ||
|
|
||
| OBJDIR = obj | ||
| INCLUDES = $(wildcard inc/*.h) | ||
22 changes: 22 additions & 0 deletions
22
libs/sx1302_hal/patches/001-add_compatibility_with_basicstation.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| From a6ae15dc6709e32f0604b6eeb0f07cc50bde18b1 Mon Sep 17 00:00:00 2001 | ||
| From: Marcus Schref <mschref@web.de> | ||
| Date: Mon, 22 Aug 2022 10:06:03 +0200 | ||
| Subject: [PATCH] sx1302_hal: add compatibility with basicstation | ||
|
|
||
| Add LGW_LBT_ISSUE define used by Basicstation | ||
mars642 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Signed-off-by: Marcus Schref <mschref@web.de> | ||
| --- | ||
| libloragw/inc/loragw_hal.h | 1 + | ||
| 1 file changed, 1 insertion(+) | ||
|
|
||
| --- a/libloragw/inc/loragw_hal.h | ||
| +++ b/libloragw/inc/loragw_hal.h | ||
mars642 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @@ -45,6 +45,7 @@ License: Revised BSD License, see LICENS | ||
| #define LGW_HAL_SUCCESS 0 | ||
| #define LGW_HAL_ERROR -1 | ||
| #define LGW_LBT_NOT_ALLOWED 1 | ||
| +#define LGW_LBT_ISSUE 1 | ||
|
|
||
| /* radio-specific parameters */ | ||
| #define LGW_XTAL_FREQU 32000000 /* frequency of the RF reference oscillator */ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| if [ "$1" = 'sx1302_hal-tests' ]; then | ||
| test_loragw_com -h 2>&1 | grep "$2" | ||
| elif [ "$1" = 'sx1302_hal-utils' ]; then | ||
| chip_id -h 2>&1 | grep "$2" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # | ||
| # Copyright (C) 2022 TDT AG <development@tdt.de> | ||
| # | ||
| # This is free software, licensed under the GNU General Public License v2. | ||
| # See /LICENSE for more information. | ||
| # | ||
| # | ||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_NAME:=basicstation | ||
| PKG_VERSION:=2.0.6 | ||
| PKG_RELEASE:=$(AUTORELEASE) | ||
|
|
||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||
| PKG_SOURCE_URL:=https://codeload.github.com/lorabasics/basicstation/tar.gz/v$(PKG_VERSION)? | ||
| PKG_HASH:=7e285de94bae1174b4c3496fc3ab15fe67c72f92c0693d2320bafc654a9dfb43 | ||
|
|
||
| PKG_MAINTAINER:=Marcus Schref <mschref@tdt.de> | ||
| PKG_LICENSE:=BSD-3-Clause | ||
| PKG_LICENSE_FILES:=LICENSE | ||
|
|
||
| PKG_BUILD_DEPENDS:=sx1302_hal mbedtls | ||
|
|
||
| include $(INCLUDE_DIR)/package.mk | ||
| include $(INCLUDE_DIR)/cmake.mk | ||
|
|
||
| define Package/basicstation | ||
| SECTION:=net | ||
| CATEGORY:=Network | ||
| SUBMENU:=LoRaWAN | ||
| TITLE:=LoRa Basic Station | ||
| DEPENDS:=+kmod-usb-acm | ||
| endef | ||
|
|
||
| define Package/basicstation/description | ||
| LoRa Basic Station. The LoRaWAN Gateway Software. | ||
| endef | ||
|
|
||
| define Package/basicstation/conffiles | ||
| /etc/config/basicstation | ||
| endef | ||
|
|
||
| define Build/Prepare | ||
| $(call Build/Prepare/Default) | ||
| rm -rf $(PKG_BUILD_DIR)/deps/ | ||
| rm -f $(PKG_BUILD_DIR)/makefile | ||
| rm -f $(PKG_BUILD_DIR)/makefile.s2core | ||
| rm -f $(PKG_BUILD_DIR)/setup.gmk | ||
BKPepe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| endef | ||
|
|
||
| define Package/basicstation/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/station $(1)/usr/bin | ||
| $(INSTALL_DIR) $(1)/etc/config | ||
| $(INSTALL_CONF) ./files/etc/config/basicstation $(1)/etc/config/basicstation | ||
| $(INSTALL_DIR) $(1)/etc/init.d | ||
| $(INSTALL_BIN) ./files/etc/init.d/basicstation $(1)/etc/init.d/basicstation | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,basicstation)) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| config auth 'auth' | ||
| option cred '' | ||
| option mode '' | ||
| option addr '' | ||
| option port '' | ||
| option token '' | ||
| option key '' | ||
| option crt '' | ||
| option trust '' | ||
|
|
||
| config sx130x 'sx130x' | ||
| option comif '' | ||
| option devpath '' | ||
| option pps '' | ||
| option public '' | ||
| option clksrc '' | ||
| option radio0 '' | ||
| option radio1 '' | ||
|
|
||
| config rfconf 'rfconf0' | ||
| option type 'SX1250' | ||
| option txEnable '1' | ||
| option freq '' | ||
| option antennaGain '3' | ||
| option rssiOffset '-215.4' | ||
| option useRssiTcomp 'std' | ||
|
|
||
| config rfconf 'rfconf1' | ||
| option type 'SX1250' | ||
| option txEnable '0' | ||
| option freq '' | ||
| option antennaGain '3' | ||
| option rssiOffset '-215.4' | ||
| option useRssiTcomp 'std' | ||
|
|
||
| config rssitcomp 'std' | ||
| option coeff_a '0' | ||
| option coeff_b '0' | ||
| option coeff_c '20.41' | ||
| option coeff_d '2162.56' | ||
| option coeff_e '0' | ||
|
|
||
| config txlut | ||
| option rfPower '12' | ||
| option paGain '0' | ||
| option pwrIdx '15' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '13' | ||
| option paGain '0' | ||
| option pwrIdx '16' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '14' | ||
| option paGain '0' | ||
| option pwrIdx '17' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '15' | ||
| option paGain '0' | ||
| option pwrIdx '19' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '16' | ||
| option paGain '0' | ||
| option pwrIdx '20' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '17' | ||
| option paGain '0' | ||
| option pwrIdx '22' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '18' | ||
| option paGain '1' | ||
| option pwrIdx '1' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '19' | ||
| option paGain '1' | ||
| option pwrIdx '2' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '20' | ||
| option paGain '1' | ||
| option pwrIdx '3' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '21' | ||
| option paGain '1' | ||
| option pwrIdx '4' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '22' | ||
| option paGain '1' | ||
| option pwrIdx '5' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '23' | ||
| option paGain '1' | ||
| option pwrIdx '6' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '24' | ||
| option paGain '1' | ||
| option pwrIdx '7' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '25' | ||
| option paGain '1' | ||
| option pwrIdx '9' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '26' | ||
| option paGain '1' | ||
| option pwrIdx '11' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config txlut | ||
| option rfPower '27' | ||
| option paGain '1' | ||
| option pwrIdx '14' | ||
| list usedBy 'rfconf0' | ||
|
|
||
| config station 'station' | ||
| option idGenIf '' | ||
| option routerid '' | ||
| option stationid '' | ||
| option logFile '' | ||
| option logLevel '' | ||
| option logSize '' | ||
| option logRotate '' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.