Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lora] add lora from https://github.com/starnight/LoRa
- Loading branch information
Showing
6 changed files
with
1,777 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,28 @@ | ||
PROJ=sx1278 | ||
obj-m := $(PROJ).o | ||
|
||
#KERNEL_LOCATION=/lib/modules/$(shell uname -r) | ||
KERNEL_LOCATION=../.. | ||
BUILDDIR=$(KERNEL_LOCATION) | ||
|
||
all: | ||
make -C $(BUILDDIR) M=$(PWD) modules | ||
|
||
install: | ||
sudo make -C $(BUILDDIR) M=$(PWD) modules_install | ||
# Rebuild the kernel module dependencies for modprobe | ||
sudo depmod -a | ||
|
||
uninstall: | ||
sudo modprobe -r $(PROJ) | ||
sudo rm $(KERNEL_LOCATION)/extra/$(PROJ).ko.gz | ||
# Rebuild the kernel module dependencies for modprobe | ||
sudo depmod -a | ||
|
||
test: | ||
make install; echo | ||
ls -l /dev/$(PROJ)* | ||
make uninstall | ||
|
||
clean: | ||
make -C $(BUILDDIR) M=$(PWD) clean |
This file contains 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,3 @@ | ||
#!/bin/bash | ||
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm CFLAGS="-D__LINUX_ARM_ARCH__=7" | ||
#make |
This file contains 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,9 @@ | ||
OVERLAY_SRC=rpi-lora-spi-overlay.dts | ||
OVERLAY_DST=rpi-lora-spi.dtbo | ||
|
||
all: | ||
dtc -I dts -O dtb -@ -o $(OVERLAY_DST) $(OVERLAY_SRC) | ||
|
||
test: | ||
dtc -I fs /proc/device-tree | ||
|
This file contains 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,32 @@ | ||
# SX1278 Compatible Radio Device Tree | ||
|
||
## Required properties: | ||
- compatible: should be "semtech,sx1276", "semtech,sx1277", | ||
"semtech,sx1277" or "semtech,sx1279" depends on your | ||
transceiver board | ||
- spi-max-frequency: maximal bus speed, should be set something under or | ||
equal 10000000 Hz | ||
- reg: the chipselect index | ||
- clock-frequency: the external crystal oscillator frequency in Hz of the | ||
transceiver | ||
- center-carrier-frq: the RF center carrier frequency in Hz | ||
|
||
## Optional properties: | ||
- rf-bandwidth: the RF bandwidth in Hz | ||
- minimal-RF-channel: the minimal RF channel number and the value must be with | ||
prefix "/bits/ 8" because of being a byte datatype | ||
- maximum-RF-channel: the maximum RF channel number and the value must be with | ||
prefix "/bits/ 8" because of being a byte datatype | ||
- spreading-factor: the spreading factor of Chirp Spread Spectrum modulation | ||
|
||
## Example: | ||
|
||
sx1278@0 { | ||
compatible = "semtech,sx1278"; | ||
spi-max-frequency = <15200>; | ||
reg = <0>; | ||
clock-frequency = <32000000>; | ||
center-carrier-frq = <434000000>; | ||
minimal-RF-channel = /bits/ 8 <11>; | ||
maximum-RF-channel = /bits/ 8 <11>; | ||
}; |
This file contains 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,42 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
fragment@0 { | ||
target = <&spi>; | ||
__overlay__ { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
spidev@0 { | ||
status = "disabled"; | ||
}; | ||
|
||
spidev@1 { | ||
status = "disabled"; | ||
}; | ||
|
||
sx1278@0 { | ||
compatible = "sx1278"; | ||
reg = <0>; | ||
status = "okay"; | ||
spi-max-frequency = <0x3b60>; | ||
center-carrier-frq = <434000000>; | ||
clock-frequency = <32000000>; | ||
minimal-RF-channel = /bits/ 8 <11>; | ||
maximum-RF-channel = /bits/ 8 <11>; | ||
}; | ||
|
||
sx1278@1 { | ||
compatible = "sx1278"; | ||
reg = <1>; | ||
status = "okay"; | ||
spi-max-frequency = <0x3b60>; | ||
center-carrier-frq = <434000000>; | ||
clock-frequency = <32000000>; | ||
minimal-RF-channel = /bits/ 8 <11>; | ||
maximum-RF-channel = /bits/ 8 <11>; | ||
}; | ||
}; | ||
}; | ||
}; |
Oops, something went wrong.