From 016e459a1fee9ae940eee7d93976698711e9aec2 Mon Sep 17 00:00:00 2001 From: Asaril Date: Sat, 20 Mar 2021 15:53:47 +0100 Subject: [PATCH] Add files for RFM driver and SPI --- raspyrfm.diff | 14 ++++++++++++++ spi0-3cs-overlay.dts | 44 +++++++++++++++++++++++++++++++++++++++++++ spi0-3cs.dtbo | Bin 0 -> 1329 bytes 3 files changed, 58 insertions(+) create mode 100644 raspyrfm.diff create mode 100644 spi0-3cs-overlay.dts create mode 100644 spi0-3cs.dtbo diff --git a/raspyrfm.diff b/raspyrfm.diff new file mode 100644 index 0000000..c88329c --- /dev/null +++ b/raspyrfm.diff @@ -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 + diff --git a/spi0-3cs-overlay.dts b/spi0-3cs-overlay.dts new file mode 100644 index 0000000..65b0248 --- /dev/null +++ b/spi0-3cs-overlay.dts @@ -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"; + }; +}; + diff --git a/spi0-3cs.dtbo b/spi0-3cs.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..b1d000801ce2433ae15c78452b07f81d797fec08 GIT binary patch literal 1329 zcmah}J#W-N5MAd(0fk6_ghUaEpioe7I@<|RbPZQf&{0rPt@eC-hZXy5yuK(GB|Q}t zHGhC64gZ5b!e0R1^X{G3OJ zx7NJ&4curQdWZI?O7d5uB#(~|UOQhfsnj&rvw9ddGvsan+kYX@ft1Cmt}?Zdk_7r6 z0FQxtz!tzczit;c_g!;n%JzV7Zz}X%_jY$Xv$cJ_Ww?+lK0|=pAytww!1c=Q%jvZs7F) zyDL|}NqROfeesyf6X1IrBOKJKn(EpX5I)cO(Q=|yoD*=bI-G94gJr!!aVI5;@8-nz zKHZtJB2k&Vb~4=A4ZXs5z+R#7zrgcxjy*x?&hhRkevW<0JEnB|@_tg}rK;0WriCq^ z{e!R*Mfpk1#&GPb@wn2)^b(zAM(msPTszyBN4Vap^psDkm#eehq|%?~dX_9iVnT_C g(2>*eQo9GpmI?*Gk$aP&jA?~3F(jL2AowW6KU-J@X8-^I literal 0 HcmV?d00001