Add files for RFM driver and SPI

This commit is contained in:
Asaril 2021-03-20 15:53:47 +01:00
parent a1a010ea3e
commit 016e459a1f
3 changed files with 58 additions and 0 deletions

14
raspyrfm.diff Normal file
View file

@ -0,0 +1,14 @@
diff --git a/raspyrfm/__init__.py b/raspyrfm/__init__.py
index 3587a64..08d895d 100644
--- a/raspyrfm/__init__.py
+++ b/raspyrfm/__init__.py
@@ -12,6 +12,9 @@ def __get_hw_params(mod):
dio0 = 1
elif mod == 4:
dio0 = 18
+ elif mod == 5:
+ dio0 = 2
+ mod = 3 # spidev0.2
else:
return

44
spi0-3cs-overlay.dts Normal file
View file

@ -0,0 +1,44 @@
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target = <&spi0_cs_pins>;
frag0: __overlay__ {
brcm,pins = <8 7 3>;
};
};
fragment@1 {
target = <&spi0>;
frag1: __overlay__ {
#address-cells = <1>;
#size-cells = <0>;
cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 3 1>;
status = "okay";
spidev0_2: spidev@2 {
compatible = "spidev";
reg = <2>; /* CE0 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <125000000>;
};
};
};
__overrides__ {
cs0_pin = <&frag0>,"brcm,pins:0",
<&frag1>,"cs-gpios:4";
cs1_pin = <&frag0>,"brcm,pins:4",
<&frag1>,"cs-gpios:16";
cs2_pin = <&frag0>,"brcm,pins:8",
<&frag1>,"cs-gpios:28";
cs2_spidev = <&spidev0_2>, "status";
};
};

BIN
spi0-3cs.dtbo Normal file

Binary file not shown.